class Gitit::GitRepo
Attributes
location[R]
Public Class Methods
new(location)
click to toggle source
# File lib/gitit/git_repo.rb, line 12 def initialize(location) raise 'Invalid path specified' unless File.directory? location @location = location end
Public Instance Methods
init()
click to toggle source
# File lib/gitit/git_repo.rb, line 26 def init raise 'already a git repo' if valid? `(cd #{@location} && git init)` end
valid?()
click to toggle source
# File lib/gitit/git_repo.rb, line 19 def valid? `(cd #{@location} && git rev-parse --git-dir 2>&1)` $?.exitstatus == 0 end