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
32 33 34 35 36 37 38 39 40 |
# File 'lib/svnx/base/cmdline.rb', line 32 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.
29 30 31 |
# File 'lib/svnx/base/cmdline.rb', line 29 def error @error end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
28 29 30 |
# File 'lib/svnx/base/cmdline.rb', line 28 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
30 31 32 |
# File 'lib/svnx/base/cmdline.rb', line 30 def status @status end |
Instance Method Details
#command_line(cmdargs) ⇒ Object
59 60 61 62 |
# File 'lib/svnx/base/cmdline.rb', line 59 def command_line cmdargs cls = @caching ? CachingCommandLine : CmdLine::CommandLine cls.new cmdargs end |
#execute ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/svnx/base/cmdline.rb', line 42 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 |