Class: GitRails::Command
- Inherits:
-
Object
- Object
- GitRails::Command
- Defined in:
- lib/git-rails/commands.rb
Direct Known Subclasses
GitRails::Commands::Init, GitRails::Commands::Install, GitRails::Commands::Update
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#git ⇒ Object
Returns the value of attribute git.
-
#local ⇒ Object
Returns the value of attribute local.
-
#svn ⇒ Object
Returns the value of attribute svn.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Command
constructor
A new instance of Command.
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( = {}) # @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
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/git-rails/commands.rb', line 4 def config @config end |
#git ⇒ Object
Returns the value of attribute git.
4 5 6 |
# File 'lib/git-rails/commands.rb', line 4 def git @git end |
#local ⇒ Object
Returns the value of attribute local.
4 5 6 |
# File 'lib/git-rails/commands.rb', line 4 def local @local end |
#svn ⇒ Object
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. || e} (#{e})" end |