Class: CabezaDeTermo::AssetsPublisher::CommandLineCompiler
- Defined in:
- lib/cabeza-de-termo/assets-publisher/compilers/command-line-compiler.rb
Instance Method Summary collapse
- #command_line(*args) ⇒ Object
- #compile_assets ⇒ Object
-
#initialize(&block) ⇒ CommandLineCompiler
constructor
A new instance of CommandLineCompiler.
Methods inherited from Compiler
#compilation_job, #compile_job, #source_assets
Constructor Details
#initialize(&block) ⇒ CommandLineCompiler
Returns a new instance of CommandLineCompiler.
8 9 10 11 |
# File 'lib/cabeza-de-termo/assets-publisher/compilers/command-line-compiler.rb', line 8 def initialize(&block) super() @block = block end |
Instance Method Details
#command_line(*args) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cabeza-de-termo/assets-publisher/compilers/command-line-compiler.rb', line 17 def command_line(*args) ouput, status = Open3.capture2e(*args) raise_compilation_failed_error(ouput.strip) unless status.success? ouput end |
#compile_assets ⇒ Object
13 14 15 |
# File 'lib/cabeza-de-termo/assets-publisher/compilers/command-line-compiler.rb', line 13 def compile_assets() @block.call(self, compilation_job) end |