Class: RubyLeiningen::Commands::Base
- Inherits:
-
Object
- Object
- RubyLeiningen::Commands::Base
show all
- Defined in:
- lib/ruby_leiningen/commands/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(binary: nil) ⇒ Base
Returns a new instance of Base.
8
9
10
|
# File 'lib/ruby_leiningen/commands/base.rb', line 8
def initialize(binary: nil)
@binary = binary || RubyLeiningen.configuration.binary
end
|
Instance Attribute Details
#binary ⇒ Object
Returns the value of attribute binary.
6
7
8
|
# File 'lib/ruby_leiningen/commands/base.rb', line 6
def binary
@binary
end
|
Instance Method Details
45
46
47
|
# File 'lib/ruby_leiningen/commands/base.rb', line 45
def configure_command(builder, opts)
builder
end
|
#do_after(opts) ⇒ Object
49
50
|
# File 'lib/ruby_leiningen/commands/base.rb', line 49
def do_after(opts)
end
|
#do_before(opts) ⇒ Object
42
43
|
# File 'lib/ruby_leiningen/commands/base.rb', line 42
def do_before(opts)
end
|
#execute(opts = {}) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/ruby_leiningen/commands/base.rb', line 24
def execute(opts = {})
builder = instantiate_builder
do_before(opts)
configure_command(builder, opts)
.build
.execute(
stdin: stdin,
stdout: stdout,
stderr: stderr)
do_after(opts)
end
|
#instantiate_builder ⇒ Object
37
38
39
40
|
# File 'lib/ruby_leiningen/commands/base.rb', line 37
def instantiate_builder
Lino::CommandLineBuilder
.for_command(binary)
end
|
#stderr ⇒ Object
20
21
22
|
# File 'lib/ruby_leiningen/commands/base.rb', line 20
def stderr
STDERR
end
|
#stdin ⇒ Object
12
13
14
|
# File 'lib/ruby_leiningen/commands/base.rb', line 12
def stdin
''
end
|
#stdout ⇒ Object
16
17
18
|
# File 'lib/ruby_leiningen/commands/base.rb', line 16
def stdout
STDOUT
end
|