slimmer 4.3.0 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 4.3.1
2
+
3
+ * When running tests, don't hide exceptions in the processors. Fix a bug in the
4
+ Search-Parameters processor's handling of missing headers revealed by this.
5
+
1
6
  # 4.3.0
2
7
 
3
8
  * Add a Search-Parameters header, to allow apps to add extra parameters to
@@ -36,15 +36,8 @@ module Slimmer::Processors
36
36
  end
37
37
 
38
38
  def parse_search_parameters
39
- header_value = @response.headers.fetch(Slimmer::Headers::SEARCH_PARAMETERS_HEADER)
40
- if header_value.nil?
41
- []
42
- else
43
- JSON.parse(header_value)
44
- end
45
- rescue JSON::ParserError => e
46
- logger.error "Slimmer: Failed while parsing search parameters header: #{[ e.message, e.backtrace ].flatten.join("\n")}"
47
- []
39
+ header_value = @response.headers.fetch(Slimmer::Headers::SEARCH_PARAMETERS_HEADER, "{}")
40
+ JSON.parse(header_value)
48
41
  end
49
42
  end
50
43
  end
data/lib/slimmer/skin.rb CHANGED
@@ -93,6 +93,7 @@ module Slimmer
93
93
  if defined?(Airbrake)
94
94
  Airbrake.notify_or_ignore(e, rack_env: rack_env)
95
95
  end
96
+ raise if strict
96
97
  end
97
98
  processor_end_time = Time.now
98
99
  process_time = processor_end_time - processor_start_time
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = '4.3.0'
2
+ VERSION = '4.3.1'
3
3
  end
@@ -28,19 +28,6 @@ module SearchParameterInserterTest
28
28
  end
29
29
  end
30
30
 
31
- class WithInvalidHeaderTest < SlimmerIntegrationTest
32
- headers = {
33
- "X-Slimmer-Search-Parameters" => '[not-valid-json',
34
- }
35
-
36
- given_response 200, DOCUMENT_WITH_SEARCH, headers
37
-
38
- def test_should_not_add_hidden_input
39
- hidden_inputs = Nokogiri::HTML.parse(last_response.body).at_css('#search input[type=hidden]')
40
- assert_equal nil, hidden_inputs
41
- end
42
- end
43
-
44
31
  class WithoutHeaderTest < SlimmerIntegrationTest
45
32
  given_response 200, DOCUMENT_WITH_SEARCH, {}
46
33
 
@@ -149,6 +149,7 @@ module TypicalUsage
149
149
  <head><title>The title of the page</title>
150
150
  <!--[if lt IE 9]><link href="app-ie.css" rel="stylesheet" type="text/css"><![endif]-->
151
151
  </head>
152
+ <body class="body_class"><div id="wrapper"></div></body>
152
153
  </html>
153
154
  }
154
155
  def test_should_find_conditional_comments_copied_into_the_head
@@ -163,6 +164,7 @@ module TypicalUsage
163
164
  <head>
164
165
  <!--[if gt IE 8]><!--><link href="app.css" rel="stylesheet" type="text/css"><!--<![endif]-->
165
166
  </head>
167
+ <body class="body_class"><div id="wrapper"></div></body>
166
168
  </html>
167
169
  }
168
170
  def test_should_find_stylesheet_wrapped_with_conditional_comments
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-08-28 00:00:00.000000000 Z
13
+ date: 2014-08-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
- requirement: &12654680 !ruby/object:Gem::Requirement
17
+ requirement: &19342560 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.5.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *12654680
25
+ version_requirements: *19342560
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rack
28
- requirement: &12651000 !ruby/object:Gem::Requirement
28
+ requirement: &19341520 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.3.5
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *12651000
36
+ version_requirements: *19341520
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: plek
39
- requirement: &12611740 !ruby/object:Gem::Requirement
39
+ requirement: &19340020 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.1.8
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *12611740
47
+ version_requirements: *19340020
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: json
50
- requirement: &12610620 !ruby/object:Gem::Requirement
50
+ requirement: &19339280 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *12610620
58
+ version_requirements: *19339280
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: null_logger
61
- requirement: &12994680 !ruby/object:Gem::Requirement
61
+ requirement: &19338080 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *12994680
69
+ version_requirements: *19338080
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
- requirement: &12992200 !ruby/object:Gem::Requirement
72
+ requirement: &19336560 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *12992200
80
+ version_requirements: *19336560
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: activesupport
83
- requirement: &13077780 !ruby/object:Gem::Requirement
83
+ requirement: &19425860 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *13077780
91
+ version_requirements: *19425860
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: minitest
94
- requirement: &13162460 !ruby/object:Gem::Requirement
94
+ requirement: &19422940 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '5.4'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *13162460
102
+ version_requirements: *19422940
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rake
105
- requirement: &13161720 !ruby/object:Gem::Requirement
105
+ requirement: &19421680 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: 0.9.2.2
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *13161720
113
+ version_requirements: *19421680
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rack-test
116
- requirement: &13161220 !ruby/object:Gem::Requirement
116
+ requirement: &19420360 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ~>
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: 0.6.1
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *13161220
124
+ version_requirements: *19420360
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mocha
127
- requirement: &13157920 !ruby/object:Gem::Requirement
127
+ requirement: &19508080 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ~>
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '1.1'
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *13157920
135
+ version_requirements: *19508080
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: webmock
138
- requirement: &13228420 !ruby/object:Gem::Requirement
138
+ requirement: &19507520 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - =
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: 1.18.0
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *13228420
146
+ version_requirements: *19507520
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: therubyracer
149
- requirement: &13278420 !ruby/object:Gem::Requirement
149
+ requirement: &19507020 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ~>
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: 0.10.2
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *13278420
157
+ version_requirements: *19507020
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: gem_publisher
160
- requirement: &13276620 !ruby/object:Gem::Requirement
160
+ requirement: &19506480 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ~>
@@ -165,10 +165,10 @@ dependencies:
165
165
  version: 1.1.1
166
166
  type: :development
167
167
  prerelease: false
168
- version_requirements: *13276620
168
+ version_requirements: *19506480
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: gds-api-adapters
171
- requirement: &13275620 !ruby/object:Gem::Requirement
171
+ requirement: &19505980 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
174
  - - =
@@ -176,10 +176,10 @@ dependencies:
176
176
  version: 2.7.1
177
177
  type: :development
178
178
  prerelease: false
179
- version_requirements: *13275620
179
+ version_requirements: *19505980
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: timecop
182
- requirement: &13275100 !ruby/object:Gem::Requirement
182
+ requirement: &19505340 !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
185
185
  - - ~>
@@ -187,7 +187,7 @@ dependencies:
187
187
  version: 0.5.1
188
188
  type: :development
189
189
  prerelease: false
190
- version_requirements: *13275100
190
+ version_requirements: *19505340
191
191
  description: Rack middleware for skinning pages using a specific template
192
192
  email:
193
193
  - bengriffiths@gmail.com
@@ -287,7 +287,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
287
287
  version: '0'
288
288
  segments:
289
289
  - 0
290
- hash: 992587451464763226
290
+ hash: 1973016183234359331
291
291
  required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  none: false
293
293
  requirements:
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  version: '0'
297
297
  segments:
298
298
  - 0
299
- hash: 992587451464763226
299
+ hash: 1973016183234359331
300
300
  requirements: []
301
301
  rubyforge_project: slimmer
302
302
  rubygems_version: 1.8.11