Class: GitRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/mono/git/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ GitRepo

Returns a new instance of GitRepo.

Raises:

  • (ArgumentError)


143
144
145
146
# File 'lib/mono/git/base.rb', line 143

def initialize( path )
  raise ArgumentError, "dir >#{path}< not found; dir MUST already exist for GitRepo class - sorry"   unless Dir.exist?( path )
  @path = path
end

Class Method Details

.open(path, &blk) ⇒ Object



139
140
141
# File 'lib/mono/git/base.rb', line 139

def self.open( path, &blk )
  new( path ).open( &blk )
end

Instance Method Details

#add(pathspec) ⇒ Object



169
# File 'lib/mono/git/base.rb', line 169

def add( pathspec )           Git.add( pathspec ); end

#add_allObject



170
# File 'lib/mono/git/base.rb', line 170

def add_all()                 Git.add_all; end

#changesObject



158
# File 'lib/mono/git/base.rb', line 158

def changes()                 Git.changes; end

#changes?Boolean Also known as: dirty?

Returns:

  • (Boolean)


160
# File 'lib/mono/git/base.rb', line 160

def changes?()                Git.changes?; end

#clean?Boolean

Returns:

  • (Boolean)


159
# File 'lib/mono/git/base.rb', line 159

def clean?()                  Git.clean?; end

#commit(message:) ⇒ Object



171
# File 'lib/mono/git/base.rb', line 171

def commit( message: )        Git.commit( message: message ); end

#fast_forwardObject Also known as: ff



164
# File 'lib/mono/git/base.rb', line 164

def fast_forward()            Git.fast_forward; end

#open(&blk) ⇒ Object



148
149
150
151
152
153
154
# File 'lib/mono/git/base.rb', line 148

def open( &blk )
  ## puts "Dir.getwd: #{Dir.getwd}"
  Dir.chdir( @path ) do
    blk.call( self )
  end
  ## puts "Dir.getwd: #{Dir.getwd}"
end

#pullObject



163
# File 'lib/mono/git/base.rb', line 163

def pull()                    Git.pull; end

#pushObject



167
# File 'lib/mono/git/base.rb', line 167

def push()                    Git.push; end

#status(short: false) ⇒ Object



157
# File 'lib/mono/git/base.rb', line 157

def status( short: false )    Git.status( short: short ); end