Class: ZendeskAppsSupport::StylesheetCompiler
- Inherits:
-
Object
- Object
- ZendeskAppsSupport::StylesheetCompiler
- Defined in:
- lib/zendesk_apps_support/stylesheet_compiler.rb
Instance Method Summary collapse
- #app_asset_url(name) ⇒ Object
- #compile(sassc: false) ⇒ Object
-
#initialize(source, app_id, url_prefix) ⇒ StylesheetCompiler
constructor
A new instance of StylesheetCompiler.
Constructor Details
#initialize(source, app_id, url_prefix) ⇒ StylesheetCompiler
Returns a new instance of StylesheetCompiler.
8 9 10 11 12 |
# File 'lib/zendesk_apps_support/stylesheet_compiler.rb', line 8 def initialize(source, app_id, url_prefix) @source = source @app_id = app_id @url_prefix = url_prefix end |
Instance Method Details
#app_asset_url(name) ⇒ Object
27 28 29 |
# File 'lib/zendesk_apps_support/stylesheet_compiler.rb', line 27 def app_asset_url(name) "#{@url_prefix}#{name}" end |
#compile(sassc: false) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/zendesk_apps_support/stylesheet_compiler.rb', line 14 def compile(sassc: false) = { syntax: :scss, app_asset_url_builder: self } if sassc compiler_class = SassC [:style] = :compressed else compiler_class = Sass end compiler_class::Engine.new(wrapped_source.dup, ).render end |