Class: Postnhost::TailwindCompiler
- Inherits:
-
Object
- Object
- Postnhost::TailwindCompiler
- Defined in:
- lib/postnhost/tailwind_compiler.rb
Defined Under Namespace
Classes: IncompatibleVersion, MissingCompiler
Constant Summary collapse
- REQUIRED_MAJOR =
4
Instance Method Summary collapse
- #command(input_path:, output_path:, watch: false) ⇒ Object
-
#initialize(root:, loaded_specs: Gem.loaded_specs) ⇒ TailwindCompiler
constructor
A new instance of TailwindCompiler.
Constructor Details
#initialize(root:, loaded_specs: Gem.loaded_specs) ⇒ TailwindCompiler
Returns a new instance of TailwindCompiler.
12 13 14 15 |
# File 'lib/postnhost/tailwind_compiler.rb', line 12 def initialize(root:, loaded_specs: Gem.loaded_specs) @root = Pathname.new(root) @loaded_specs = loaded_specs end |
Instance Method Details
#command(input_path:, output_path:, watch: false) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/postnhost/tailwind_compiler.rb', line 17 def command(input_path:, output_path:, watch: false) command = npm_command(input_path:, output_path:) || ruby_command(input_path:, output_path:) raise MissingCompiler, unless command command << "--watch" if watch command end |