sinatra-asset-pipeline 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -13
- data/lib/sinatra/asset_pipeline/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -2,15 +2,11 @@
|
|
2
2
|
|
3
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
|
-
|
6
|
-
|
7
|
-
Install sinatra-asset-pipeline from RubyGems:
|
5
|
+
sinatra-asset-pipeline supports both compiling assets on the fly for development as well as precompiling assets for production.
|
8
6
|
|
9
|
-
|
10
|
-
$ gem install sinatra-asset-pipeline
|
11
|
-
```
|
7
|
+
# Installation
|
12
8
|
|
13
|
-
|
9
|
+
Include sinatra-asset-pipeline in your project's Gemfile:
|
14
10
|
|
15
11
|
```ruby
|
16
12
|
gem 'sinatra-asset-pipeline'
|
@@ -25,21 +21,21 @@ require './app'
|
|
25
21
|
Sinatra::AssetPipeline::Task.define! App
|
26
22
|
```
|
27
23
|
|
28
|
-
Now, when everything is in place you can precompile assets located in `assets/<asset-type>` with:
|
24
|
+
Now, when everything is in place you can precompile assets located in `assets/<asset-type>` with:
|
29
25
|
|
30
26
|
```bash
|
31
|
-
$ rake assets:precompile
|
27
|
+
$ RACK_ENV=production rake assets:precompile
|
32
28
|
```
|
33
29
|
|
34
30
|
And remove old compiled assets with:
|
35
31
|
|
36
32
|
```bash
|
37
|
-
$ rake assets:clean
|
33
|
+
$ RACK_ENV=production rake assets:clean
|
38
34
|
```
|
39
35
|
|
40
36
|
# Example
|
41
37
|
|
42
|
-
In it's most simple form you just register the `Sinatra::AssetPipeline` Sinatra extension within your
|
38
|
+
In it's most simple form you just register the `Sinatra::AssetPipeline` Sinatra extension within your application:
|
43
39
|
|
44
40
|
```ruby
|
45
41
|
Bundler.require
|
@@ -90,7 +86,7 @@ class App < Sinatra::Base
|
|
90
86
|
end
|
91
87
|
```
|
92
88
|
|
93
|
-
Now when everything is in place you can use all helpers provided by [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers),
|
89
|
+
Now when everything is in place you can use all helpers provided by [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers), an example:
|
94
90
|
|
95
91
|
```scss
|
96
92
|
body {
|
@@ -98,9 +94,11 @@ body {
|
|
98
94
|
}
|
99
95
|
```
|
100
96
|
|
97
|
+
Note that you don't need to require [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers) inside your code to leverage the functionallity given to you by the integration, sinatra-asset-pipeline handles that for you.
|
98
|
+
|
101
99
|
### CSS and JavaScript minification
|
102
100
|
|
103
|
-
If you would like to use CSS and/or JavaScript minification make sure to require the gems
|
101
|
+
If you would like to use CSS and/or JavaScript minification make sure to require the needed gems in your `Gemfile`:
|
104
102
|
|
105
103
|
<table>
|
106
104
|
<tr>
|
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.3.
|
4
|
+
version: 0.3.3
|
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-
|
12
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|