linner 0.7.2 → 0.7.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9560019bb82e87b3dc2bd5b56c54e1d0190789fa
4
- data.tar.gz: bc7ee012bf8f8a68da6a7225d085faee0d545990
3
+ metadata.gz: fb27a0e45fbecbbc4602af358f6dfcb3e48cc842
4
+ data.tar.gz: 980da5ad5a54a919a8f446fd52537ba969e234cb
5
5
  SHA512:
6
- metadata.gz: 27ea5249edf87569812cc804b31bb97d9401d6350656bc705a89a54b8311d97105bbbb22a94d892abf3ac72a99bd0b6ff1cea3f4123c4dc892df3aa0bb13c1dc
7
- data.tar.gz: 7dc2d9c4b18e85a6077e8245c4131da3cb3a469ba37e10f4f389ec828be8db9d261438831e3a8f3a68aec0fce03074fb6f17ca3a7bd89b0e0269c9d29c79e118
6
+ metadata.gz: 97bd63e2ee2bfad5f860f755c97ba6bf7bc13c398cfa218c54d9f50ebc01849af9bedeed4879073811aef4ac80fa0ecfae87a2ec794919bc75de7aefc9988916
7
+ data.tar.gz: 5bdcbb509510707615cf7b9c7a3f7292f2d5e649e4b78981cc86a72041bd046df376fc0218727ce3b2b9190d95e1f2bd7b52330f7893b64dfb5d2ec94b4d38cf
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ v0.7.3
2
+ - fix a merge bug from the latest version
3
+
4
+ v0.7.2
5
+ - add a unstrict mode by default to replace the revision, change the original one to strict mode, use `-s` to trigger.
6
+
1
7
  v0.7.1
2
8
  - prevent multiple instance running error
3
9
 
@@ -62,13 +62,14 @@ module Linner
62
62
  name = File.basename(dest).sub /[^.]+\z/, "png"
63
63
  dest = File.join env.sprites["path"], name
64
64
  asset = Asset.new(File.join env.public_folder, dest)
65
- hash[dest] = env.revision["prefix"] + asset.relative_digest_path
65
+ prefix = env.revision["prefix"] || ""
66
+ hash[dest] = prefix + asset.relative_digest_path
66
67
  asset.revision!
67
68
 
68
69
  (concat_assets + copy_assets).flatten.each do |file|
69
70
  path = File.join env.public_folder, file
70
71
  next unless Asset.new(path).stylesheet?
71
- puts = File.read(path).gsub(File.join(env.sprites["path"], File.basename(dest)), File.join(env.revision["prefix"], env.sprites["path"], File.basename(asset.relative_digest_path)))
72
+ puts = File.read(path).gsub(File.join(env.sprites["path"], File.basename(dest)), File.join(prefix, env.sprites["path"], File.basename(asset.relative_digest_path)))
72
73
  File.open(path, "w") { |file| file << puts }
73
74
  end
74
75
  end
@@ -76,8 +77,9 @@ module Linner
76
77
  # revision concat template and copy assets
77
78
  (concat_assets + template_assets + copy_assets).flatten.each do |dest|
78
79
  asset = Asset.new(File.join env.public_folder, dest)
80
+ prefix = env.revision["prefix"] || ""
79
81
  next unless asset.revable?
80
- hash[dest] = env.revision["prefix"] + asset.relative_digest_path
82
+ hash[dest] = prefix + asset.relative_digest_path
81
83
  asset.revision!
82
84
  end
83
85
 
@@ -112,7 +114,7 @@ module Linner
112
114
  copy(config) if config["copy"]
113
115
  concat(config) if config["concat"]
114
116
  end
115
- revision if compile? and env.revision and env.revision["files"]
117
+ revision if compile? and env.revision
116
118
  end
117
119
 
118
120
  private
@@ -164,7 +166,8 @@ module Linner
164
166
 
165
167
  def revision
166
168
  dump_manifest
167
- env.revision["files"].flatten.each do |rev|
169
+ files = env.revision["files"] || []
170
+ files.flatten.each do |rev|
168
171
  file = File.join env.public_folder, rev.to_s
169
172
  next if not File.exist?(file)
170
173
  replace_attributes file
@@ -227,7 +230,8 @@ module Linner
227
230
  end
228
231
 
229
232
  def dump_manifest
230
- File.open(File.join(env.public_folder, env.revision["manifest"]), "w") do |f|
233
+ manifest_file = env.revision["manifest"] || "manifest.yml"
234
+ File.open(File.join(env.public_folder, manifest_file), "w") do |f|
231
235
  YAML.dump(manifest, f)
232
236
  end
233
237
  end
@@ -16,7 +16,6 @@
16
16
  <div class="icon-logo"></div>
17
17
  <script src="/scripts/vendor.js"></script>
18
18
  <script src="/scripts/app.js"></script>
19
- <script src="/scripts/templates.js"></script>
20
19
  <script>require("app")()</script>
21
20
  </body>
22
21
  </html>
@@ -30,7 +30,7 @@ groups:
30
30
  paths:
31
31
  - app/templates
32
32
  precompile:
33
- "/scripts/templates.js": "app/templates/**/*.hbs"
33
+ "../vendor/templates.js": "app/templates/**/*.hbs"
34
34
  modules:
35
35
  wrapper: cmd
36
36
  ignored: vendor/**/*
@@ -39,6 +39,8 @@ sprites:
39
39
  path: /images/
40
40
  selector: .icon-
41
41
  revision:
42
+ prefix: ""
43
+ manifest: "manifest.yml"
42
44
  files:
43
45
  - index.html
44
46
  notification: true
@@ -1,3 +1,3 @@
1
1
  module Linner
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -17,9 +17,6 @@ describe Environment do
17
17
  it "should equals default config" do
18
18
  @env.notification.should be_true
19
19
  @env.wrapper.should == "cmd"
20
- @env.revision["prefix"].should == ""
21
- @env.revision["manifest"].should == "manifest.yml"
22
- @env.revision["files"].should == nil
23
20
  @env.groups.should respond_to(:each)
24
21
  end
25
22
  end
@@ -26,8 +26,4 @@ modules:
26
26
  ignored: "vendor/**/*"
27
27
  definition: "/scripts/app.js"
28
28
 
29
- revision:
30
- prefix: ""
31
- manifest: "manifest.yml"
32
-
33
29
  notification: true
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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reel