Class: GitProject

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ GitProject

Returns a new instance of GitProject.

Raises:

  • (ArgumentError)


168
169
170
171
172
# File 'lib/mono/git/base.rb', line 168

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

Class Method Details

.open(path, &blk) ⇒ Object



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

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

Instance Method Details

#add(pathspec) ⇒ Object



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

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

#add_allObject



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

def add_all()                 Git.add_all; end

#changesObject



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

def changes()                 Git.changes; end

#changes?Boolean Also known as: dirty?

Returns:

  • (Boolean)


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

def changes?()                Git.changes?; end

#clean?Boolean

Returns:

  • (Boolean)


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

def clean?()                  Git.clean?; end

#commit(message:) ⇒ Object



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

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

#fast_forwardObject Also known as: ff



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

def fast_forward()            Git.fast_forward; end

#fetchObject



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

def fetch()                   Git.fetch; end

#files(pathspec = nil) ⇒ Object



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

def files( pathspec=nil )     Git.files( pathspec ); end

#open(&blk) ⇒ Object



175
176
177
178
179
180
181
# File 'lib/mono/git/base.rb', line 175

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

#pullObject



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

def pull()                    Git.pull; end

#pushObject



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

def push()                    Git.push; end

#status(short: false) ⇒ Object



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

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