Module: Sinatra::Sprockets::Helpers

Defined in:
lib/sinatra/sprockets/helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.registered(app) ⇒ Object


7
8
9
10
# File 'lib/sinatra/sprockets/helpers.rb', line 7

def self.registered(app)
  app.helpers ::Sprockets::Helpers
  app.configure_sprockets_helpers
end

Instance Method Details

#configure_sprockets_helpers(&block) ⇒ Object


12
13
14
15
16
17
18
19
20
# File 'lib/sinatra/sprockets/helpers.rb', line 12

def configure_sprockets_helpers(&block)
  ::Sprockets::Helpers.configure do |helpers|
    with_setting(:sprockets) { |value| helpers.environment = value }
    with_setting(:public_folder) { |value| helpers.public_path = value }
    with_setting(:digest_assets) { |value| helpers.digest = value }
    with_setting(:assets_prefix) { |value| helpers.prefix = value }
  end
  ::Sprockets::Helpers.configure(&block) if block_given?
end