linner 0.6.3 → 0.6.4
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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/linner.rb +19 -10
- data/lib/linner/cache.rb +3 -3
- data/lib/linner/compressor.rb +2 -0
- data/lib/linner/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e785dfaa4d3d75d851dc95472e4b4c67498136cb
|
4
|
+
data.tar.gz: 5b7fca59e81147ce0d9038c702620399e6391d91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b479fc61a9697c2122ab51001ba0f0df96d0b9aeed1b0644fc66620ab9e46f0eeae4138aebc66f7acb588d568f4cb28589daf6550e115f34dfaa0d03e6ca92
|
7
|
+
data.tar.gz: 1df1468c43a72ab91ed8f5c2e3d1b47eb7f98dc6400ab878fe85621d58c13d5f820e6a6a420136caa55b331c17c304433eebf53969593fcd1527b7c0a589222e
|
data/CHANGELOG
CHANGED
data/lib/linner.rb
CHANGED
@@ -118,7 +118,7 @@ module Linner
|
|
118
118
|
config["concat"].each_with_index do |pair, index|
|
119
119
|
dest, pattern, order = pair.first, pair.last, config["order"]||[]
|
120
120
|
matches = Dir.glob(pattern).sort_by(&:downcase).order_by(order)
|
121
|
-
next if matches.select {|
|
121
|
+
next if matches.select {|path| cache.miss?(dest, path)}.empty?
|
122
122
|
write_asset(dest, matches)
|
123
123
|
end
|
124
124
|
end
|
@@ -126,11 +126,20 @@ module Linner
|
|
126
126
|
def copy(config)
|
127
127
|
config["copy"].each do |dest, pattern|
|
128
128
|
Dir.glob(pattern).each do |path|
|
129
|
-
next if not cache.miss?(path)
|
130
|
-
|
131
|
-
dest_path = File.join(env.public_folder, dest, logical_path)
|
132
|
-
|
133
|
-
|
129
|
+
next if not cache.miss?(dest, path)
|
130
|
+
asset = Asset.new(path)
|
131
|
+
dest_path = File.join(env.public_folder, dest, asset.logical_path)
|
132
|
+
if asset.javascript? or asset.stylesheet?
|
133
|
+
asset.content
|
134
|
+
asset.compress if compile?
|
135
|
+
dest_path = dest_path.sub(/[^.]+\z/,"js") if asset.javascript?
|
136
|
+
dest_path = dest_path.sub(/[^.]+\z/,"css") if asset.stylesheet?
|
137
|
+
asset.path = dest_path
|
138
|
+
asset.write
|
139
|
+
else
|
140
|
+
FileUtils.mkdir_p File.dirname(dest_path)
|
141
|
+
FileUtils.cp_r path, dest_path
|
142
|
+
end
|
134
143
|
end
|
135
144
|
end
|
136
145
|
end
|
@@ -138,7 +147,7 @@ module Linner
|
|
138
147
|
def precompile(config)
|
139
148
|
config["precompile"].each do |dest, pattern|
|
140
149
|
matches = Dir.glob(pattern).sort_by(&:downcase)
|
141
|
-
next if matches.select { |
|
150
|
+
next if matches.select { |path| cache.miss?(dest, path) }.empty?
|
142
151
|
write_template(dest, matches)
|
143
152
|
end
|
144
153
|
end
|
@@ -146,7 +155,7 @@ module Linner
|
|
146
155
|
def sprite(config)
|
147
156
|
config["sprite"].each do |dest, pattern|
|
148
157
|
matches = Dir.glob(pattern).sort_by(&:downcase)
|
149
|
-
next if matches.select { |
|
158
|
+
next if matches.select { |path| cache.miss?(dest, path) }.empty?
|
150
159
|
paint_sprite(dest, matches)
|
151
160
|
end
|
152
161
|
end
|
@@ -183,7 +192,7 @@ module Linner
|
|
183
192
|
|
184
193
|
def write_template(dest, child_assets)
|
185
194
|
asset = Asset.new(File.join env.public_folder, dest)
|
186
|
-
content = child_assets.inject("") {|s, m| s << cache[m].content}
|
195
|
+
content = child_assets.inject("") {|s, m| s << cache["#{dest}:#{m}"].content}
|
187
196
|
asset.content = Wrapper::Template.definition(content)
|
188
197
|
asset.compress if compile?
|
189
198
|
asset.write
|
@@ -192,7 +201,7 @@ module Linner
|
|
192
201
|
def write_asset(dest, child_assets)
|
193
202
|
asset = Asset.new(File.join env.public_folder, dest)
|
194
203
|
definition = (asset.path == env.definition ? Wrapper::Module.definition : "")
|
195
|
-
asset.content = child_assets.inject(definition) {|s, m| s << cache[m].content}
|
204
|
+
asset.content = child_assets.inject(definition) {|s, m| s << cache["#{dest}:#{m}"].content}
|
196
205
|
asset.compress if compile?
|
197
206
|
asset.write
|
198
207
|
end
|
data/lib/linner/cache.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Linner
|
2
2
|
class Cache < Hash
|
3
|
-
def miss? path
|
3
|
+
def miss? ns, path
|
4
4
|
asset = Asset.new path
|
5
|
-
if self[path] and self[path].mtime == asset.mtime
|
5
|
+
if self["#{ns}:#{path}"] and self["#{ns}:#{path}"].mtime == asset.mtime
|
6
6
|
false
|
7
7
|
else
|
8
|
-
self[path] = asset
|
8
|
+
self["#{ns}:#{path}"] = asset
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/lib/linner/compressor.rb
CHANGED
data/lib/linner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reel
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
312
|
version: '0'
|
313
313
|
requirements: []
|
314
314
|
rubyforge_project:
|
315
|
-
rubygems_version: 2.2.
|
315
|
+
rubygems_version: 2.2.2
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: HTML5 Application Assembler
|