sinatra-asset-pipeline 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -66,8 +66,8 @@ class App < Sinatra::Base
66
66
  # Include these files when precompiling assets
67
67
  set :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff)
68
68
 
69
- # Logical path to your assets
70
- set :assets_prefix, 'assets'
69
+ # Logical paths to your assets
70
+ set :assets_prefix, %w(assets, vendor/assets)
71
71
 
72
72
  # Use another host for serving assets
73
73
  set :assets_host, '<id>.cloudfront.net'
@@ -7,8 +7,8 @@ module Sinatra
7
7
  def self.registered(app)
8
8
  app.set_default :sprockets, Sprockets::Environment.new
9
9
  app.set_default :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff)
10
- app.set_default :assets_prefix, 'assets'
11
- app.set_default :assets_path, -> { File.join(public_folder, assets_prefix) }
10
+ app.set_default :assets_prefix, %w(assets vendor/assets)
11
+ app.set_default :assets_path, -> { File.join(public_folder, "assets") }
12
12
  app.set_default :assets_protocol, :http
13
13
  app.set_default :assets_css_compressor, :none
14
14
  app.set_default :assets_js_compressor, :none
@@ -18,8 +18,9 @@ module Sinatra
18
18
  app.set :static_cache_control, [:public, :max_age => 60 * 60 * 24 * 365]
19
19
 
20
20
  app.configure do
21
- Dir[File.join app.assets_prefix, "*"].each {|path| app.sprockets.append_path path}
22
-
21
+ app.assets_prefix.each do |prefix|
22
+ Dir[File.join prefix, "*"].each { |path| app.sprockets.append_path path }
23
+ end
23
24
  Sprockets::Helpers.configure do |config|
24
25
  config.environment = app.sprockets
25
26
  config.digest = app.assets_digest
@@ -5,24 +5,24 @@ require 'rake/sprocketstask'
5
5
  module Sinatra
6
6
  module AssetPipeline
7
7
  class Task < Rake::TaskLib
8
- def initialize(app)
8
+ def initialize(app_klass)
9
9
  namespace :assets do
10
10
  desc "Precompile assets"
11
11
  task :precompile do
12
- environment = app.sprockets
13
- manifest = Sprockets::Manifest.new(environment.index, app.assets_path)
14
- manifest.compile(app.assets_precompile)
12
+ environment = app_klass.sprockets
13
+ manifest = Sprockets::Manifest.new(environment.index, app_klass.assets_path)
14
+ manifest.compile(app_klass.assets_precompile)
15
15
  end
16
16
 
17
17
  desc "Clean assets"
18
18
  task :clean do
19
- FileUtils.rm_rf(app.assets_path)
19
+ FileUtils.rm_rf(app_klass.assets_path)
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
- def self.define!(app)
25
- self.new app
24
+ def self.define!(app_klass)
25
+ self.new app_klass
26
26
  end
27
27
  end
28
28
  end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module AssetPipeline
3
- VERSION = '0.2.1'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-asset-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-24 00:00:00.000000000 Z
12
+ date: 2013-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -152,7 +152,8 @@ files:
152
152
  - lib/sinatra/asset_pipeline/version.rb
153
153
  - lib/sinatra/asset_pipeline.rb
154
154
  homepage: https://github.com/kalasjocke/sinatra-asset-pipeline
155
- licenses: []
155
+ licenses:
156
+ - MIT
156
157
  post_install_message:
157
158
  rdoc_options: []
158
159
  require_paths:
@@ -176,3 +177,4 @@ signing_key:
176
177
  specification_version: 3
177
178
  summary: An asset pipeline implementation for Sinatra.
178
179
  test_files: []
180
+ has_rdoc: