Class: Command::Base
- Inherits:
-
Object
- Object
- Command::Base
- Defined in:
- lib/command/base.rb
Direct Known Subclasses
Add, Branch, Checkout, CherryPick, Commit, Config, Diff, Fetch, Init, Log, Merge, Push, ReceivePack, Remote, Reset, RevList, Revert, Rm, Status, UploadPack
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir, env, args, stdin, stdout, stderr) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(dir, env, args, stdin, stdout, stderr) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/command/base.rb', line 14 def initialize(dir, env, args, stdin, stdout, stderr) @dir = dir @env = env @args = args @stdin = stdin @stdout = stdout @stderr = stderr @isatty = @stdout.isatty end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/command/base.rb', line 12 def status @status end |
Instance Method Details
#execute ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/command/base.rb', line 25 def execute catch(:exit) { run } if defined? @pager @stdout.close_write @pager.wait end end |