Class: Svnx::Base::CommandLine
- Inherits:
-
Object
- Object
- Svnx::Base::CommandLine
- Defined in:
- lib/svnx/base/cmdline.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #command ⇒ Object
- #execute ⇒ Object
-
#initialize(subcommand: nil, xml: true, caching: false, args: Array.new) ⇒ CommandLine
constructor
A new instance of CommandLine.
Constructor Details
#initialize(subcommand: nil, xml: true, caching: false, args: Array.new) ⇒ CommandLine
Returns a new instance of CommandLine.
13 14 15 16 17 18 |
# File 'lib/svnx/base/cmdline.rb', line 13 def initialize subcommand: nil, xml: true, caching: false, args: Array.new @subcommand = subcommand @xml = xml @caching = caching @args = args end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/svnx/base/cmdline.rb', line 10 def error @error end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
9 10 11 |
# File 'lib/svnx/base/cmdline.rb', line 9 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/svnx/base/cmdline.rb', line 11 def status @status end |
Instance Method Details
#command ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/svnx/base/cmdline.rb', line 20 def command Array.new.tap do |a| a << 'svn' a << @subcommand if @xml a << '--xml' end a.concat @args end end |
#execute ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/svnx/base/cmdline.rb', line 31 def execute cmdline = ::Command::Cacheable::Command.new command, caching: @caching, cachedir: Svnx::Env.instance.cache_dir cmdline.execute @output = cmdline.output @error = cmdline.error @status = cmdline.status @output end |