sinatra-asset-pipeline 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +25 -15
- data/lib/sinatra/asset_pipeline.rb +4 -1
- data/lib/sinatra/asset_pipeline/version.rb +1 -1
- metadata +26 -12
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTQ5NTcyZjc4ZWE0YWM1YTQ0NjE0OTFiNTVhMTJhYWFhYWNhY2QxYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTVkNTQ2YWI3YTJjZWNiMjJmNTBlZGYwMGVlYWZlMGZiZGNmMDY1MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODkwZDY1ZjhkNWZjY2NlZTI0NDc0Y2E3ZDAzMzFiMDU5NGViMGQzMjhlNWMw
|
10
|
+
ODM0YmYwZTYzODAyM2IyNTFmZGMwN2Y0MjVjMzcyZWY1YWJhZjgzMzY2NzVj
|
11
|
+
NmZmN2NiYWVlM2IzOTE2YTE2MjIzYzJlNjMyNWJkZDQ1Y2MyMmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGY1ZWMzNjMzZTI4MjMwM2RmN2MzMzhmNTBhNWEyNTJkMjZkNDVjMGQ5OTNj
|
14
|
+
OTc3Y2YxYjhkM2U3YWY2YTM0ZWFhYTgyNGZhZmQ1OGQ1MDg4OWEwN2VhYTYz
|
15
|
+
NzgxY2FlZmFhNTAzNmZiMjAyOTdhYmEwM2Y1ODBjNGQyYzZiNjQ=
|
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
|
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).
|
4
4
|
|
5
5
|
# Installation
|
6
6
|
|
@@ -43,28 +43,34 @@ In it's most simple form you just register the Sinatra::AssetPipe Sinatra extens
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
However, if
|
46
|
+
However, if your application doesn't follow the defaults you can customize it as follows:
|
47
47
|
|
48
|
-
|
48
|
+
Bundler.require
|
49
|
+
|
50
|
+
require 'sinatra/asset_pipeline'
|
49
51
|
|
50
|
-
|
52
|
+
class App < Sinatra::Base
|
53
|
+
# Include these files when precompiling assets
|
54
|
+
set :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff)
|
55
|
+
|
56
|
+
# Logical path to your assets
|
57
|
+
set :assets_prefix, 'assets'
|
51
58
|
|
52
|
-
|
53
|
-
|
59
|
+
# Use another host for serving assets
|
60
|
+
set :asset_host, 'http://<id>.cloudfront.net'
|
54
61
|
|
55
|
-
|
56
|
-
|
62
|
+
# Serve assets using this protocol
|
63
|
+
set :assets_protocol, :http
|
57
64
|
|
58
|
-
|
59
|
-
|
65
|
+
# Compress CSS using SASS
|
66
|
+
set :assets_sass_style, :compress
|
60
67
|
|
61
|
-
|
62
|
-
set :assets_protocol, 'http'
|
68
|
+
register Sinatra::AssetPipeline
|
63
69
|
|
64
|
-
|
65
|
-
|
66
|
-
end
|
70
|
+
get '/' do
|
71
|
+
haml :index
|
67
72
|
end
|
73
|
+
end
|
68
74
|
|
69
75
|
Now when everything is in place you can use all helpers provided by [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers), here is a small example:
|
70
76
|
|
@@ -72,3 +78,7 @@ Now when everything is in place you can use all helpers provided by [sprockets-h
|
|
72
78
|
background-image: image-url('cat.png');
|
73
79
|
}
|
74
80
|
|
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
|
+
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'sprockets'
|
2
|
+
require 'sprockets-sass'
|
2
3
|
require 'sprockets-helpers'
|
3
4
|
|
4
5
|
module Sinatra
|
@@ -8,7 +9,8 @@ module Sinatra
|
|
8
9
|
app.set_default :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff)
|
9
10
|
app.set_default :assets_prefix, 'assets'
|
10
11
|
app.set_default :assets_path, -> { File.join(public_folder, assets_prefix) }
|
11
|
-
app.set_default :assets_protocol,
|
12
|
+
app.set_default :assets_protocol, :http
|
13
|
+
app.set_default :assets_sass_style, :compressed
|
12
14
|
|
13
15
|
app.set :static, true
|
14
16
|
app.set :assets_digest, true
|
@@ -30,6 +32,7 @@ module Sinatra
|
|
30
32
|
end
|
31
33
|
|
32
34
|
app.configure :production do
|
35
|
+
Sprockets::Sass.options[:style] = :compressed
|
33
36
|
Sprockets::Helpers.configure do |config|
|
34
37
|
config.protocol = App.assets_protocol
|
35
38
|
config.asset_host = App.assets_host if App.respond_to? :assets_host
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-asset-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2013-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ! '>='
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: sinatra
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ! '>='
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: coffee-script
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: sprockets
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ! '>='
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: sass
|
84
|
+
name: sprockets-sass
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: sprockets-helpers
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ! '>='
|
@@ -108,8 +108,22 @@ dependencies:
|
|
108
108
|
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
|
112
|
-
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: An asset pipeline implementation for Sinatra based on Sprockets with
|
126
|
+
support for SASS, CoffeeScript and ERB.
|
113
127
|
email:
|
114
128
|
- jocke.ekberg@gmail.com
|
115
129
|
executables: []
|
@@ -142,5 +156,5 @@ rubyforge_project:
|
|
142
156
|
rubygems_version: 2.0.3
|
143
157
|
signing_key:
|
144
158
|
specification_version: 4
|
145
|
-
summary: An asset pipeline implementation
|
159
|
+
summary: An asset pipeline implementation for Sinatra.
|
146
160
|
test_files: []
|