linner 0.4.2 → 0.4.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 +4 -4
- data/CHANGELOG +7 -0
- data/lib/linner.rb +12 -5
- data/lib/linner/asset.rb +4 -1
- data/lib/linner/templates/app/views/index.html +1 -0
- data/lib/linner/templates/config.yml +1 -1
- data/lib/linner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 109f2ec4baaa54f466975a57fc9c394b792d57ba
|
4
|
+
data.tar.gz: 8214045c7fe0035d5a85acb246e2e3fc6231a5ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a21df22ee4634f5fd183c4f2a4a7bee930f56a634c01772216b57b4312fbf9cbda3f50d0ebd8fdfd1f6facba19244bfa367a0b3a8bfacb0cb7d00f25cbbc195
|
7
|
+
data.tar.gz: 64d4b5700c56c57caaf86d49e41b98edd11f9a3e3c6a89d9e42e01b579716306665d52d69b26729c333dde04eaf50f1dc1fa1515d8395b60adb1012af4bbbd4c
|
data/CHANGELOG
CHANGED
data/lib/linner.rb
CHANGED
@@ -96,11 +96,11 @@ private
|
|
96
96
|
|
97
97
|
def revision
|
98
98
|
dump_manifest
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
[env.revision].flatten.each do |rev|
|
100
|
+
file = File.join env.public_folder, rev.to_s
|
101
|
+
next if not File.exist?(file)
|
102
|
+
replace_attributes file
|
103
|
+
end
|
104
104
|
end
|
105
105
|
|
106
106
|
private
|
@@ -113,6 +113,13 @@ private
|
|
113
113
|
asset.write
|
114
114
|
end
|
115
115
|
|
116
|
+
def replace_attributes file
|
117
|
+
doc = Nokogiri::HTML.parse(File.read file)
|
118
|
+
replace_tag_with_manifest_value doc, "script", "src"
|
119
|
+
replace_tag_with_manifest_value doc, "link", "href"
|
120
|
+
File.open(file, "w") {|f| f.write doc.to_html}
|
121
|
+
end
|
122
|
+
|
116
123
|
def replace_tag_with_manifest_value doc, tag, attribute
|
117
124
|
doc.search(tag).each do |x|
|
118
125
|
next unless node = x.attributes[attribute]
|
data/lib/linner/asset.rb
CHANGED
@@ -2,6 +2,7 @@ require "digest"
|
|
2
2
|
|
3
3
|
module Linner
|
4
4
|
class Asset
|
5
|
+
class RenderError < StandardError; end
|
5
6
|
|
6
7
|
attr_accessor :path, :content
|
7
8
|
|
@@ -37,6 +38,8 @@ module Linner
|
|
37
38
|
File.exist?(path) ? Tilt.new(path, :default_encoding => "UTF-8").render : ""
|
38
39
|
rescue RuntimeError
|
39
40
|
File.read(path)
|
41
|
+
rescue => e
|
42
|
+
raise RenderError, "#{e.message} in (#{path})"
|
40
43
|
end
|
41
44
|
if wrappable?
|
42
45
|
@content = wrap(source)
|
@@ -73,7 +76,7 @@ module Linner
|
|
73
76
|
end
|
74
77
|
|
75
78
|
def logical_path
|
76
|
-
@logical_path ||= @path.gsub(
|
79
|
+
@logical_path ||= @path.gsub(/^(#{Linner.env.paths.join("|")})\/?/, "")
|
77
80
|
end
|
78
81
|
end
|
79
82
|
end
|
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.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reel
|