Class: Mercurial::Command
- Inherits:
-
Object
- Object
- Mercurial::Command
- Defined in:
- lib/mercurial-ruby/command.rb
Overview
This class represents a shell command. You probably don’t want to deal with this yourself, use the Shell class instead.
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#use_cache ⇒ Object
Returns the value of attribute use_cache.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(cmd, options = {}) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(cmd, options = {}) ⇒ Command
Returns a new instance of Command.
15 16 17 18 19 20 |
# File 'lib/mercurial-ruby/command.rb', line 15 def initialize(cmd, ={}) @command = cmd @repository = [:repository] @use_cache = [:cache].nil? || [:cache] == false ? false : true @timeout = [:timeout] ? [:timeout].to_i : global_execution_timeout.to_i end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
13 14 15 |
# File 'lib/mercurial-ruby/command.rb', line 13 def command @command end |
#repository ⇒ Object
Returns the value of attribute repository.
13 14 15 |
# File 'lib/mercurial-ruby/command.rb', line 13 def repository @repository end |
#timeout ⇒ Object
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/mercurial-ruby/command.rb', line 13 def timeout @timeout end |
#use_cache ⇒ Object
Returns the value of attribute use_cache.
13 14 15 |
# File 'lib/mercurial-ruby/command.rb', line 13 def use_cache @use_cache end |
Instance Method Details
#execute ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/mercurial-ruby/command.rb', line 22 def execute if cache_commands? execute_with_caching else execute_without_caching end end |