Module: Sinatra::Assets

Defined in:
lib/sinatra/assets.rb

Overview

Sinatra::Assets

Methods for working with assets like images, links etc.

Usage:

Just add the extension as a helper in your sub-classed Sinatra application.

class YourApp < Sinatra::Base

  register( Sinatra::Assets )
  <snip...>
end

See the method definitions for further information.

Dependencies:

This extension depends on the following:

Ruby Gems:

  • alt/rext/hash/conversions

    • Methods used:

      • :to_html_attributes

Extensions:

None

Configurations:

None

Routes:

None

Code Inspirations:

  • The Chicago gem by Thumble Monks

  • The ActiveSupport gem by DHH & Rails Core Team

  • sinatra-url-for by Eric Kidd

Defined Under Namespace

Modules: Helpers

Constant Summary collapse

VERSION =
'0.1.1'

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/sinatra/assets.rb', line 284

def self.registered(app)
  app.helpers Assets::Helpers
  
  ## add the extension specific options to those inspectable by :settings_inspect method
  #  provided by the Sinatra::Settings extension
  # if app.respond_to?(:sinatra_settings_for_inspection)
  #   %w().each do |m|
  #     app.sinatra_settings_for_inspection << m
  #   end
  # end
  
end

.versionObject



63
# File 'lib/sinatra/assets.rb', line 63

def self.version; "Sinatra::Assets v#{VERSION}"; end