Class: GitRails::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/git-rails/commands.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Command

Returns a new instance of Command.



6
7
8
9
10
11
# File 'lib/git-rails/commands.rb', line 6

def initialize(options = {})
  # @config = options["config"] || Giston::Config.new
  # @svn    = options["svn"]    || Giston::Svn.new
  # @git    = options["git"]    || Giston::Git.new
  # @local  = options["local"]  || Giston::Local.new
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



4
5
6
# File 'lib/git-rails/commands.rb', line 4

def config
  @config
end

#gitObject

Returns the value of attribute git.



4
5
6
# File 'lib/git-rails/commands.rb', line 4

def git
  @git
end

#localObject

Returns the value of attribute local.



4
5
6
# File 'lib/git-rails/commands.rb', line 4

def local
  @local
end

#svnObject

Returns the value of attribute svn.



4
5
6
# File 'lib/git-rails/commands.rb', line 4

def svn
  @svn
end

Class Method Details

.run(command, *args) ⇒ Object



13
14
15
16
17
18
# File 'lib/git-rails/commands.rb', line 13

def self.run(command, *args)
  klass = GitRails::Commands.const_get(command.to_s.capitalize)
  klass.new.run(*args)
rescue GitRails::Exception => e
  puts "git-rails: An exception has occured: #{e.message || e} (#{e})"
end