dassets 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +40 -5
- data/lib/dassets/version.rb +1 -1
- data/lib/dassets.rb +2 -0
- data/test/helper.rb +0 -2
- metadata +83 -107
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8eb00e1656956e770b1e509f47389da503b40842
|
4
|
+
data.tar.gz: f32473d4d3bc21276cc9e09dd8a0ad3ab8677614
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8293311bd021e41fc50a334f38d3c8ac1a93b07147660faa0b23df81fe64299411c5b6f6e56f6ca22cacf7a4a77c5f275534c591dd11116d45961ffae5a5c75c
|
7
|
+
data.tar.gz: b3b9914524b148a2809b1596c3f5c229b3ccd5a027bccc220c0629f15aebcf98b22f2b754e5a4b20a14064b97eb2e1c17003d2ec2170dad728945e7e44e65389
|
data/README.md
CHANGED
@@ -28,7 +28,6 @@ end
|
|
28
28
|
### Link To
|
29
29
|
|
30
30
|
```rb
|
31
|
-
Dassets.init
|
32
31
|
Dassets['css/site.css'].href # => "/css/site-123abc.css"
|
33
32
|
Dassets['img/logos/main.jpg'].href # => "/img/logos/main-a1b2c3.jpg"
|
34
33
|
```
|
@@ -51,9 +50,11 @@ Engines are "registered" with dassets based on source extensions. Name your sou
|
|
51
50
|
|
52
51
|
### Some Dassets Engines
|
53
52
|
|
54
|
-
Examples are key here, so check out some of the Dasset
|
53
|
+
Examples are key here, so check out some of the Dasset engines available:
|
55
54
|
|
56
|
-
|
55
|
+
* **Erb**: https://github.com/redding/dassets-erb
|
56
|
+
* **Sass**: https://github.com/redding/dassets-sass
|
57
|
+
* **Less (v1)**: https://github.com/redding/dassets-lessv1
|
57
58
|
|
58
59
|
### Creating your own Engine
|
59
60
|
|
@@ -64,11 +65,45 @@ TODO
|
|
64
65
|
|
65
66
|
## Sources
|
66
67
|
|
67
|
-
|
68
|
+
Sources model a root location for asset files. They also provide configuration for how assets in that location should be processed and handled.
|
69
|
+
|
70
|
+
You can specify filters that control which paths in the location are considered. You can also register engines which determine how the contents of assets files are handled. For example:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
Dassets.configure do |c|
|
74
|
+
c.source /path/to/assets do |s|
|
75
|
+
s.filter{ |paths| paths.reject{ |p| File.basename(p) =~ /^_/ } }
|
76
|
+
|
77
|
+
s.engine 'erb', Dassets::Erb::Engine
|
78
|
+
s.engine 'scss', Dassets::Sass::Engine, {
|
79
|
+
:syntax => 'scss'
|
80
|
+
# any other engine-specific options here
|
81
|
+
}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
```
|
85
|
+
|
86
|
+
This configuration says that Dassets, for assets in `/path/to/assets`, should 1) ignore any files beginning in `_` 2) process any files ending in `.erb` with the Erb engine and 3) process any files ending in `.scss` with the Sass engine (using 'scss' syntax).
|
87
|
+
|
88
|
+
The goal here is to allow you to control how certain asset files are handled based on their location root. This is handy for 3rd-paty gems that provide asset source files (such as [Romo](https://github.com/redding/romo)). See https://github.com/redding/romo/blob/master/lib/romo/dassets.rb for an example of how Romo integrates with Dassets.
|
68
89
|
|
69
90
|
## Combinations
|
70
91
|
|
71
|
-
|
92
|
+
Combinations are a way to alias many asset files as a single asset. Dassets responds to requests for the combined asset by concatenating the combination's asset files into a single response. For example:
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
Dassets.configure do |c|
|
96
|
+
c.combination "css/special.css", [
|
97
|
+
'css/romo/normalize.css',
|
98
|
+
'css/romo/base.css',
|
99
|
+
'css/romo/component1.css'
|
100
|
+
]
|
101
|
+
end
|
102
|
+
```
|
103
|
+
|
104
|
+
This example tells Dassets that if it receives a request for the `css/special.css` asset it should return the content of the 3 files concatenated in that order.
|
105
|
+
|
106
|
+
Combinations are treated just like regular asset files (think of them as a kind of alias). They can be cached/digested/etc just as if they were a true asset file. Again, see https://github.com/redding/romo/blob/master/lib/romo/dassets.rb for an example of using combinations to abstract the composition of 3rd-party asset files.
|
72
107
|
|
73
108
|
## Installation
|
74
109
|
|
data/lib/dassets/version.rb
CHANGED
data/lib/dassets.rb
CHANGED
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,110 +1,95 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dassets
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 0
|
10
|
-
version: 0.9.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Kelly Redding
|
14
8
|
- Collin Redding
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 27
|
28
|
-
segments:
|
29
|
-
- 2
|
30
|
-
- 12
|
31
|
-
version: "2.12"
|
32
|
-
type: :development
|
12
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
33
15
|
name: assert
|
34
|
-
|
35
|
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
requirements:
|
40
|
-
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 15
|
43
|
-
segments:
|
44
|
-
- 1
|
45
|
-
- 0
|
46
|
-
version: "1.0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.12'
|
47
21
|
type: :development
|
48
|
-
name: assert-rack-test
|
49
|
-
version_requirements: *id002
|
50
22
|
prerelease: false
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '2.12'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: assert-rack-test
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.0'
|
62
35
|
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
63
43
|
name: sinatra
|
64
|
-
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.4'
|
49
|
+
type: :development
|
65
50
|
prerelease: false
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
hash: 13
|
73
|
-
segments:
|
74
|
-
- 1
|
75
|
-
- 1
|
76
|
-
version: "1.1"
|
77
|
-
type: :runtime
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.4'
|
56
|
+
- !ruby/object:Gem::Dependency
|
78
57
|
name: ns-options
|
79
|
-
|
80
|
-
|
81
|
-
-
|
82
|
-
|
83
|
-
|
84
|
-
requirements:
|
85
|
-
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
hash: 15
|
88
|
-
segments:
|
89
|
-
- 1
|
90
|
-
- 0
|
91
|
-
version: "1.0"
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.1'
|
92
63
|
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.1'
|
70
|
+
- !ruby/object:Gem::Dependency
|
93
71
|
name: rack
|
94
|
-
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.0'
|
77
|
+
type: :runtime
|
95
78
|
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.0'
|
96
84
|
description: Digest and serve HTML asset files
|
97
|
-
email:
|
85
|
+
email:
|
98
86
|
- kelly@kellyredding.com
|
99
87
|
- collin.redding@me.com
|
100
88
|
executables: []
|
101
|
-
|
102
89
|
extensions: []
|
103
|
-
|
104
90
|
extra_rdoc_files: []
|
105
|
-
|
106
|
-
|
107
|
-
- .gitignore
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
108
93
|
- Gemfile
|
109
94
|
- LICENSE.txt
|
110
95
|
- README.md
|
@@ -157,39 +142,30 @@ files:
|
|
157
142
|
- test/unit/source_tests.rb
|
158
143
|
- tmp/.gitkeep
|
159
144
|
homepage: http://github.com/redding/dassets
|
160
|
-
licenses:
|
145
|
+
licenses:
|
161
146
|
- MIT
|
147
|
+
metadata: {}
|
162
148
|
post_install_message:
|
163
149
|
rdoc_options: []
|
164
|
-
|
165
|
-
require_paths:
|
150
|
+
require_paths:
|
166
151
|
- lib
|
167
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
-
|
169
|
-
requirements:
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
170
154
|
- - ">="
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
version: "0"
|
176
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
|
-
requirements:
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
179
159
|
- - ">="
|
180
|
-
- !ruby/object:Gem::Version
|
181
|
-
|
182
|
-
segments:
|
183
|
-
- 0
|
184
|
-
version: "0"
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
185
162
|
requirements: []
|
186
|
-
|
187
163
|
rubyforge_project:
|
188
|
-
rubygems_version:
|
164
|
+
rubygems_version: 2.4.5
|
189
165
|
signing_key:
|
190
|
-
specification_version:
|
166
|
+
specification_version: 4
|
191
167
|
summary: Digested asset files
|
192
|
-
test_files:
|
168
|
+
test_files:
|
193
169
|
- test/helper.rb
|
194
170
|
- test/support/app.rb
|
195
171
|
- test/support/app/assets/file1.txt
|