class Gitti::GitProject
Public Class Methods
new( path )
click to toggle source
# File lib/gitti/project.rb, line 8 def initialize( path ) raise ArgumentError, "dir >#{path}< not found; dir MUST already exist for GitProject class - sorry" unless Dir.exist?( path ) raise ArgumentError, "dir >#{path}/.git< not found; dir MUST already be initialized with git for GitProject class - sorry" unless Dir.exist?( "#{path}/.git" ) @path = path end
open( path, &blk )
click to toggle source
# File lib/gitti/project.rb, line 4 def self.open( path, &blk ) new( path ).open( &blk ) end
Public Instance Methods
add( *pathspecs )
click to toggle source
# File lib/gitti/project.rb, line 38 def add( *pathspecs ) Git.add( *pathspecs ); end
add_all()
click to toggle source
# File lib/gitti/project.rb, line 39 def add_all() Git.add_all; end
branch()
click to toggle source
branch management
# File lib/gitti/project.rb, line 53 def branch() Git.branch; end
changes()
click to toggle source
# File lib/gitti/project.rb, line 25 def changes() Git.changes; end
changes?()
click to toggle source
# File lib/gitti/project.rb, line 27 def changes?() Git.changes?; end
Also aliased as: dirty?
clean?()
click to toggle source
# File lib/gitti/project.rb, line 26 def clean?() Git.clean?; end
commit( message )
click to toggle source
# File lib/gitti/project.rb, line 40 def commit( message ) Git.commit( message ); end
fast_forward()
click to toggle source
# File lib/gitti/project.rb, line 33 def fast_forward() Git.fast_forward; end
Also aliased as: ff
fetch()
click to toggle source
# File lib/gitti/project.rb, line 31 def fetch() Git.fetch; end
files()
click to toggle source
# File lib/gitti/project.rb, line 42 def files() Git.files; end
main?()
click to toggle source
# File lib/gitti/project.rb, line 55 def main?() Git.main?; end
master?()
click to toggle source
# File lib/gitti/project.rb, line 54 def master?() Git.master?; end
open( &blk )
click to toggle source
# File lib/gitti/project.rb, line 15 def open( &blk ) ## puts "Dir.getwd: #{Dir.getwd}" Dir.chdir( @path ) do blk.call( self ) end ## puts "Dir.getwd: #{Dir.getwd}" end
origin()
click to toggle source
# File lib/gitti/project.rb, line 47 def origin() Git.origin; end
origin?()
click to toggle source
# File lib/gitti/project.rb, line 49 def origin?() Git.origin?; end
pull()
click to toggle source
# File lib/gitti/project.rb, line 32 def pull() Git.pull; end
push()
click to toggle source
# File lib/gitti/project.rb, line 36 def push() Git.push; end
remote()
click to toggle source
remote show origin|upstream|etc.
# File lib/gitti/project.rb, line 46 def remote() Git.remote; end
run( cmd )
click to toggle source
# File lib/gitti/project.rb, line 58 def run( cmd ) Git::Shell.run( cmd ); end
status( short: false )
click to toggle source
# File lib/gitti/project.rb, line 24 def status( short: false ) Git.status( short: short ); end
upstream()
click to toggle source
# File lib/gitti/project.rb, line 48 def upstream() Git.upstream; end
upstream?()
click to toggle source
# File lib/gitti/project.rb, line 50 def upstream?() Git.upstream?; end