sinatra-asset-pipeline 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDNiMDhiMTBiMGRkYWUwNzQ1MDM2NDA5NjFlMDdiYTY1N2E2MGQzZQ==
4
+ MGE0MWMwMjQ5NTNmZTI3NTI2ZWU3MzVmZmRmNGQwMmY0MjJjNjlkYQ==
5
5
  data.tar.gz: !binary |-
6
- MWY1ODg2N2RhZDVlZmYyMTQ3ZGZhMzhmMzdlYTdkNWNjOGI5Y2FhNw==
6
+ ZDE1MTAyYjRhMTFjZDM3MWZiZDYwMTVjMzk0ZjRlZGUyY2QxMmU1Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjA2ODI5NDlhYWY1N2MwMTZjOWJhMDdhYWFjODJiNjgwZmQ5YjBjNTc5Zjlm
10
- ZTE5YjA3MTc2MWY0NWZjNGVhZWU5ODE4YmQyNWY0OWZmMDEzNjRjOGJmMDM1
11
- ZmIyMTczZDI4OGZkNzcwZDZlNDQ3ZjI1Mjg3OWEzMmFkNDNlMDA=
9
+ NDg5YTk3OGRlMWFmZDEwNzQ3ZTViMDFkNWY4NGViODU1ZWJhZjZiZjkwNWI0
10
+ YzVlMjJlZmNmNzRkODU1NTQxYmY5MWI1NTBhMzAzYmU5M2VjOWZiMjY1OWQ4
11
+ ZmI5M2MxOGVkNWFiNTgzMTRkNzU5NGE3MjA3MDMyZmRlYTUxNTc=
12
12
  data.tar.gz: !binary |-
13
- NzJiZWQwMDAwMWI5NjYzN2Q4ZjYwN2FkMTU1MTIzODRiMTUwM2QwOTE3NGZm
14
- NDdlNDk5ODM0ZTBmM2FkNTIwMTlkNjU5MTA1ZjRiNThmYTI1ZDUxYzA3YTlk
15
- NDYzNTU5NzI5OTllMTk3Nzc3NGMxNjdmN2RkOTJmNDNkMTQ1OGI=
13
+ ODAxMDlhMzkxMDFlM2RmNWQ1YjdmMDA0MjdiZjQ0NGMxNWNhNDY2NjY2YTNi
14
+ MDYxMzAwYmE3MmJhNGI3MmUxYzM5YThiYzU2YmU5NjNmODM2NTYzZTcyOTg5
15
+ NTExYTFmODgzYjY3YjQzZDg3ZmQ1OTM2YzQ1NjFiMTI1YTZlMzI=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # sinatra-asset-pipeline
2
2
 
3
- An asset pipeline implementation for Sinatra based on Sprockets with support for SASS, CoffeeScript and ERB. Built upon [sprockets-sass](https://github.com/petebrowne/sprockets-sass) and [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers) from [petebrowne](https://github.com/petebrowne).
3
+ An asset pipeline implementation for Sinatra based on [Sprockets](https://github.com/sstephenson/sprockets) with support for CoffeeScript, SASS, SCSS, LESS, ERB as well as CSS (SASS, YUI) and JavaScript (uglifier, YUI, Closure) minification.
4
4
 
5
5
  # Installation
6
6
 
@@ -12,7 +12,7 @@ Or include it in your project's Gemfile with Bundler:
12
12
 
13
13
  gem 'sinatra-asset-pipeline'
14
14
 
15
- Make sure to add the sinatra-asset-pipeline Rake task in your applications Rakefile:
15
+ Make sure to add the sinatra-asset-pipeline Rake task in your applications `Rakefile`:
16
16
 
17
17
  require 'sinatra/asset_pipeline/task.rb'
18
18
  require './app'
@@ -21,15 +21,15 @@ Make sure to add the sinatra-asset-pipeline Rake task in your applications Rakef
21
21
 
22
22
  Now, when everything is in place you can precompile assets with:
23
23
 
24
- rake assets:precompile
24
+ $ rake assets:precompile
25
25
 
26
26
  And remove old compiled assets with:
27
27
 
28
- rake assets:clean
28
+ $ rake assets:clean
29
29
 
30
30
  # Example
31
31
 
32
- In it's most simple form you just register the Sinatra::AssetPipe Sinatra extension within your Sinatra app.
32
+ In it's most simple form you just register the `Sinatra::AssetPipe` Sinatra extension within your Sinatra app.
33
33
 
34
34
  Bundler.require
35
35
 
@@ -62,8 +62,11 @@ However, if your application doesn't follow the defaults you can customize it as
62
62
  # Serve assets using this protocol
63
63
  set :assets_protocol, :http
64
64
 
65
- # Compress CSS using SASS
66
- set :assets_sass_style, :compress
65
+ # CSS minification
66
+ set :assets_css_compressor, :sass
67
+
68
+ # JavaScript minification
69
+ set :assets_js_minification, :uglifier
67
70
 
68
71
  register Sinatra::AssetPipeline
69
72
 
@@ -78,7 +81,34 @@ Now when everything is in place you can use all helpers provided by [sprockets-h
78
81
  background-image: image-url('cat.png');
79
82
  }
80
83
 
81
- # Compass integration
82
-
83
- Given that we're using [sprockets-sass](https://github.com/petebrowne/sprockets-sass) we have out of the box support for compass. Just include the compass gem in your Gemfile and include the compass mixins in your app.css.scss file.
84
+ ### CSS and JavaScript minification
85
+
86
+ If you would like to use CSS and/or JavaScript minification make sure to require the gems needed in your `Gemfile`.
87
+
88
+ <table>
89
+ <tr>
90
+ <th>Minifier</th>
91
+ <th>Gem</th>
92
+ </tr>
93
+ <tr>
94
+ <td>:sass</td>
95
+ <td>sass</td>
96
+ </tr>
97
+ <tr>
98
+ <td>:closure</td>
99
+ <td>closure-compiler</td>
100
+ </tr>
101
+ <tr>
102
+ <td>:uglifier</td>
103
+ <td>uglifier</td>
104
+ </tr>
105
+ <tr>
106
+ <td>:yui</td>
107
+ <td>yui-compressor</td>
108
+ </tr>
109
+ </table>
110
+
111
+ ### Compass integration
112
+
113
+ Given that we're using [sprockets-sass](https://github.com/petebrowne/sprockets-sass) we have out of the box support for compass. Just include the compass gem in your `Gemfile` and include the compass mixins in your `app.css.scss` file.
84
114
 
@@ -10,7 +10,8 @@ module Sinatra
10
10
  app.set_default :assets_prefix, 'assets'
11
11
  app.set_default :assets_path, -> { File.join(public_folder, assets_prefix) }
12
12
  app.set_default :assets_protocol, :http
13
- app.set_default :assets_sass_style, :compressed
13
+ app.set_default :assets_css_compressor, :none
14
+ app.set_default :assets_js_compressor, :none
14
15
 
15
16
  app.set :static, true
16
17
  app.set :assets_digest, true
@@ -32,7 +33,9 @@ module Sinatra
32
33
  end
33
34
 
34
35
  app.configure :production do
35
- Sprockets::Sass.options[:style] = :compressed
36
+ app.sprockets.css_compressor = app.assets_css_compressor unless app.assets_css_compressor == :none
37
+ app.sprockets.js_compressor = app.assets_js_compressor unless app.assets_js_compressor == :none
38
+
36
39
  Sprockets::Helpers.configure do |config|
37
40
  config.protocol = app.assets_protocol
38
41
  config.asset_host = app.assets_host if app.respond_to? :assets_host
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module AssetPipeline
3
- VERSION = '0.1.3'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-asset-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joakim Ekberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-31 00:00:00.000000000 Z
11
+ date: 2013-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake