Class: AlpacaBuildTool::Wrapper
- Defined in:
- lib/alpacabuildtool/tools/wrapper.rb
Overview
Wrapper represents console tools that execute other console tools inside their own process (like OpenCover, Ssh…)
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Log
Instance Method Summary collapse
-
#call(args) {|@tool| ... } ⇒ Object
Execute wrapper tool with arguments.
-
#initialize(configuration, tool) ⇒ Wrapper
constructor
Creates an instance Overrides Tool initialization by adding tool that should be executed later.
Constructor Details
#initialize(configuration, tool) ⇒ Wrapper
Creates an instance Overrides Tool initialization by adding tool that should be executed later
configuration
-
wrapper tool configuration
tool
-
tool to be used inside wrapper tool
14 15 16 17 18 |
# File 'lib/alpacabuildtool/tools/wrapper.rb', line 14 def initialize(configuration, tool) super(configuration) @tool = tool.dup wrap_tool end |
Instance Method Details
#call(args) {|@tool| ... } ⇒ Object
Execute wrapper tool with arguments
args
-
wrapper tool arguments
requires &block to be executed against inner tool
wrapper.call([debug: true]) do |tool|
tool.call(['file.cs', {c: true, type: 'test'}])
end
# >> wrapper.exe /target:'tool.exe' /targetargs:'file.cs /c /type:test'
# /debug
31 32 33 34 35 36 |
# File 'lib/alpacabuildtool/tools/wrapper.rb', line 31 def call(args) yield @tool @target = encapsulate(@tool.exe) @target_args = encapsulate(@tool.arguments) super(args) end |