emcee 1.0.8 → 1.0.9
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/lib/emcee/processors/script_processor.rb +10 -2
- data/lib/emcee/version.rb +1 -1
- data/test/compressors_test.rb +23 -23
- data/test/dummy/log/test.log +1525 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/069d8fd6c288adff1fb286d0d6c21606 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/458351c9b3b38136f089d00567fa2ab9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/88d5d991418d69ace2337e9eadebd140 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e0561b1cebd62df57d5d6ac9d2b23033 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f16d30b33e206690649697e498a2f1a8 +0 -0
- data/test/processors_test.rb +39 -2
- metadata +2 -2
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/processors_test.rb
CHANGED
@@ -9,6 +9,10 @@ require 'emcee/document'
|
|
9
9
|
class ResolverStub
|
10
10
|
attr_reader :asset_required
|
11
11
|
|
12
|
+
def initialize(contents)
|
13
|
+
@contents = contents
|
14
|
+
end
|
15
|
+
|
12
16
|
def absolute_path(path)
|
13
17
|
"/#{path}"
|
14
18
|
end
|
@@ -18,7 +22,7 @@ class ResolverStub
|
|
18
22
|
end
|
19
23
|
|
20
24
|
def evaluate(path)
|
21
|
-
|
25
|
+
@contents
|
22
26
|
end
|
23
27
|
|
24
28
|
def should_inline?(path)
|
@@ -28,7 +32,7 @@ end
|
|
28
32
|
|
29
33
|
class ProcessorsTest < ActiveSupport::TestCase
|
30
34
|
setup do
|
31
|
-
@resolver = ResolverStub.new
|
35
|
+
@resolver = ResolverStub.new "/* contents */"
|
32
36
|
@body = <<-EOS.strip_heredoc
|
33
37
|
<link rel="import" href="test.html">
|
34
38
|
<link rel="stylesheet" href="test.css">
|
@@ -79,4 +83,37 @@ class ProcessorsTest < ActiveSupport::TestCase
|
|
79
83
|
|
80
84
|
assert_equal correct, processed
|
81
85
|
end
|
86
|
+
|
87
|
+
test "processing scripts escapes </script>" do
|
88
|
+
@resolver = ResolverStub.new "// </script>"
|
89
|
+
|
90
|
+
processor = Emcee::Processors::ScriptProcessor.new(@resolver)
|
91
|
+
processed = processor.process(@doc).to_s
|
92
|
+
|
93
|
+
correct = <<-EOS.strip_heredoc
|
94
|
+
<link rel="import" href="test.html">
|
95
|
+
<link rel="stylesheet" href="test.css">
|
96
|
+
<script>// <\\/script></script>
|
97
|
+
<p>test</p>
|
98
|
+
EOS
|
99
|
+
|
100
|
+
assert_equal correct, processed
|
101
|
+
end
|
102
|
+
|
103
|
+
test "processing scripts escapes <!--" do
|
104
|
+
@resolver = ResolverStub.new "// <!--"
|
105
|
+
|
106
|
+
processor = Emcee::Processors::ScriptProcessor.new(@resolver)
|
107
|
+
processed = processor.process(@doc).to_s
|
108
|
+
|
109
|
+
correct = <<-EOS.strip_heredoc
|
110
|
+
<link rel="import" href="test.html">
|
111
|
+
<link rel="stylesheet" href="test.css">
|
112
|
+
<script>// <!\\--</script>
|
113
|
+
<p>test</p>
|
114
|
+
EOS
|
115
|
+
|
116
|
+
assert_equal correct, processed
|
117
|
+
end
|
82
118
|
end
|
119
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emcee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Huth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|