Module: Dartsass::Runner
- Defined in:
- lib/dartsass/runner.rb
Constant Summary collapse
- EXEC_PATH =
"#{Pathname.new(__dir__).to_s}/../../exe/dartsass"
- CSS_LOAD_PATH =
Rails.root.join("app/assets/stylesheets")
- CSS_BUILD_PATH =
Rails.root.join("app/assets/builds")
Class Method Summary collapse
- .dartsass_build_mapping ⇒ Object
- .dartsass_build_options ⇒ Object
- .dartsass_compile_command ⇒ Object
- .dartsass_load_paths ⇒ Object
Class Method Details
.dartsass_build_mapping ⇒ Object
9 10 11 12 13 |
# File 'lib/dartsass/runner.rb', line 9 def dartsass_build_mapping Rails.application.config.dartsass.builds.map { |input, output| "#{CSS_LOAD_PATH.join(input)}:#{CSS_BUILD_PATH.join(output)}" } end |
.dartsass_build_options ⇒ Object
15 16 17 |
# File 'lib/dartsass/runner.rb', line 15 def Rails.application.config.dartsass..flat_map(&:split) end |
.dartsass_compile_command ⇒ Object
23 24 25 |
# File 'lib/dartsass/runner.rb', line 23 def dartsass_compile_command [ RbConfig.ruby, EXEC_PATH ].concat().concat(dartsass_load_paths).concat(dartsass_build_mapping) end |
.dartsass_load_paths ⇒ Object
19 20 21 |
# File 'lib/dartsass/runner.rb', line 19 def dartsass_load_paths [ CSS_LOAD_PATH ].concat(Rails.application.config.assets.paths).flat_map { |path| ["--load-path", path.to_s] } end |