Sha256: bea8919a3c2028379d8b82e8e36ec5c3aafefc597d5927057cba8643b5830461

Contents?: true

Size: 562 Bytes

Versions: 19

Compression:

Stored size: 562 Bytes

Contents

require 'sinatra'
class ApplicationController < Sinatra::Base
  # Application manifest file accessor method
  helpers do
    def manifest(*args)
      html = String.new
      args.map(&:to_sym).each do |arg|
        html << %{<link href="/assets/application.css" type="text/css" rel="stylesheet">} if arg == :stylesheet
        html << %{<script src="/assets/application.js" type="text/javascript"></script>} if arg == :script
      end
      html
    rescue
      raise ArgumentError.new "Expected arguments to be any of: [stylesheet, script]"
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
eucalypt-0.9.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.8.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.7.2 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.7.1 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.7.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.6.2 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.6.1 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.6.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.5.4 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.5.3 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.5.2 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.5.1 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.5.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.4.2 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.4.1 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.4.0 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.3.5 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.3.4 lib/eucalypt/core/helpers/manifest.rb
eucalypt-0.3.3 lib/eucalypt/core/helpers/manifest.rb