Class: Svnx::Base::CommandLine
- Inherits:
-
Object
- Object
- Svnx::Base::CommandLine
- Includes:
- Logue::Loggable
- 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_line(cmdargs) ⇒ 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.
21 22 23 24 25 26 27 28 29 |
# File 'lib/svnx/base/cmdline.rb', line 21 def initialize subcommand: nil, xml: true, caching: false, args: Array.new debug "subcommand: #{subcommand}" debug "args: #{args}" @subcommand = subcommand @xml = xml @caching = caching @args = args debug "@args: #{@args}" end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
18 19 20 |
# File 'lib/svnx/base/cmdline.rb', line 18 def error @error end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
17 18 19 |
# File 'lib/svnx/base/cmdline.rb', line 17 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
19 20 21 |
# File 'lib/svnx/base/cmdline.rb', line 19 def status @status end |
Instance Method Details
#command_line(cmdargs) ⇒ Object
48 49 50 |
# File 'lib/svnx/base/cmdline.rb', line 48 def command_line cmdargs Command::Cacheable::Command.new cmdargs, caching: @caching, dir: Svnx::Env.instance.cache_dir end |
#execute ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/svnx/base/cmdline.rb', line 31 def execute cmdargs = [ 'svn', @subcommand ] cmdargs << '--xml' if @xml cmdargs.concat @args debug "cmdargs: #{cmdargs}" cmdline = command_line cmdargs cmdline.execute debug "cmdline: #{cmdline}" @output = cmdline.output @error = cmdline.error @status = cmdline.status @output end |