Class: Postnhost::CssBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/postnhost/css_build.rb

Constant Summary collapse

POLL_INTERVAL =
0.1

Class Method Summary collapse

Class Method Details

.run(command:, unscoped_path:, output_path:, watch: false) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/postnhost/css_build.rb', line 11

def run(command:, unscoped_path:, output_path:, watch: false)
  FileUtils.rm_f(unscoped_path)

  if watch
    watch(command:, unscoped_path:, output_path:)
  else
    system(*command, exception: true)
    CssScope.scope_file(unscoped_path, output_path)
  end
ensure
  FileUtils.rm_f(unscoped_path)
end