rack-pagespeed 1.0.0 → 1.0.1

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.
data/README.md CHANGED
@@ -1,14 +1,6 @@
1
1
  # rack-pagespeed
2
2
 
3
- This middleware _will_ (as in this is a work in progress) replicate possibly every feature found in Google's [modpagespeed](http://www.modpagespeed.com/).
4
-
5
- # To do
6
-
7
- Everything. I'm just reserving the name for now.
8
-
9
- # Where's rack-bundle?
10
-
11
- I kept it in a branch called `bundle`. Though I strongly recommend you _not_ to use it. You can get the same effect (better actually, considering rack-pagespeed doesn't do some dumb stuff rack-bundle used to) by activating only the equivalent features in rack-pagespeed.
3
+ Please refer to [the instructions manual](http://rack-pagespeed.heroku.com) for details. GitHub ain't stylish enough.
12
4
 
13
5
  # License
14
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -31,8 +31,8 @@ class Rack::PageSpeed::Config
31
31
  end
32
32
  end
33
33
 
34
- def method_missing filter
35
- raise NoSuchFilter, "No such filter \"#{filter}\". Available filters: #{(Rack::PageSpeed::Filters::Base.available_filters).join(', ')}"
34
+ def method_missing filter, *args
35
+ raise NoSuchFilter, "No such filter \"#{filter}\". Available filters: #{(Rack::PageSpeed::Filter.available_filters).join(', ')}"
36
36
  end
37
37
 
38
38
  private
@@ -61,7 +61,7 @@ class Rack::PageSpeed::Config
61
61
  end
62
62
 
63
63
  def filters_to_methods
64
- Rack::PageSpeed::Filters::Base.available_filters.each do |klass|
64
+ Rack::PageSpeed::Filter.available_filters.each do |klass|
65
65
  (class << self; self; end).send :define_method, klass.name do |*options|
66
66
  default_options = {:public => @options[:public], :store => @store}
67
67
  instance = klass.new(options.any? ? default_options.merge(*options) : default_options)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-pagespeed}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julio Cesar Ody"]
12
- s.date = %q{2011-01-14}
12
+ s.date = %q{2011-01-20}
13
13
  s.description = %q{Web page speed optimizations at the Rack level}
14
14
  s.email = %q{julio@awesomebydesign.com}
15
15
  s.extra_rdoc_files = [
@@ -42,24 +42,22 @@ describe 'rack-pagespeed configuration' do
42
42
  end
43
43
 
44
44
  context 'enabling filters, options hash based' do
45
- context 'options[:filters]' do
46
- before { File.stub(:directory?).and_return(true) }
45
+ before { File.stub(:directory?).and_return(true) }
47
46
 
48
- it "if it's an array, it enables filters listed in it with their default options" do
49
- config = Rack::PageSpeed::Config.new :filters => [:makes_it_look_good]
50
- config.filters.first.should be_a MakesItLookGood
51
- end
47
+ it "if it's an array, it enables filters listed in it with their default options" do
48
+ config = Rack::PageSpeed::Config.new :filters => [:makes_it_look_good]
49
+ config.filters.first.should be_a MakesItLookGood
50
+ end
52
51
 
53
- it "if it's a hash, it let's you pass options to the filters logically" do
54
- config = Rack::PageSpeed::Config.new :filters => {:makes_it_look_good => {:test => 6000}}
55
- filter = config.filters.first
56
- filter.should be_a MakesItLookGood
57
- filter.options[:test].should == 6000 # yeah, 2 assertions, bad, bad
58
- end
52
+ it "if it's a hash, it let's you pass options to the filters logically" do
53
+ config = Rack::PageSpeed::Config.new :filters => {:makes_it_look_good => {:test => 6000}}
54
+ filter = config.filters.first
55
+ filter.should be_a MakesItLookGood
56
+ filter.options[:test].should == 6000 # yeah, 2 assertions, bad, bad
59
57
  end
60
58
 
61
- it 'raises a NoSuchFilterError when a non-existing filter is passed to :filters' do
62
- expect { Rack::PageSpeed.new page, :filters => [:whoops!] }.to raise_error
59
+ it 'raises a NoSuchFilter error when a non-existing filter is passed to :filters' do
60
+ expect { Rack::PageSpeed::Config.new :filters => [:whoops!] }.to raise_error(Rack::PageSpeed::Config::NoSuchFilter)
63
61
  end
64
62
  end
65
63
 
@@ -92,6 +90,10 @@ describe 'rack-pagespeed configuration' do
92
90
  config = Rack::PageSpeed::Config.new do needs_store end
93
91
  config.filters.should be_empty
94
92
  end
93
+
94
+ it 'raises a NoSuchFilter error when a non-existing filter is called ' do
95
+ expect { Rack::PageSpeed::Config.new do whateva :foo => 'bar' end }.to raise_error(Rack::PageSpeed::Config::NoSuchFilter)
96
+ end
95
97
  end
96
98
 
97
99
  context 'setting a storage mechanism' do
@@ -76,7 +76,7 @@ describe 'rack-pagespeed' do
76
76
  end
77
77
 
78
78
  it "responds with the contents in store that match the asset unique id" do
79
- @response.to_s.should == 'Little poney'
79
+ @response.first.to_s.should == 'Little poney'
80
80
  end
81
81
 
82
82
  it "responds with the appropriate MIME type for the asset stored" do
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-pagespeed
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 0
9
- - 0
10
- version: 1.0.0
8
+ - 1
9
+ version: 1.0.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Julio Cesar Ody
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-01-14 00:00:00 +11:00
17
+ date: 2011-01-20 00:00:00 +11:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - "="
28
27
  - !ruby/object:Gem::Version
29
- hash: 15
30
28
  segments:
31
29
  - 1
32
30
  - 4
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - "="
44
42
  - !ruby/object:Gem::Version
45
- hash: 29
46
43
  segments:
47
44
  - 1
48
45
  - 2
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - "="
60
57
  - !ruby/object:Gem::Version
61
- hash: 19
62
58
  segments:
63
59
  - 1
64
60
  - 0
@@ -74,7 +70,6 @@ dependencies:
74
70
  requirements:
75
71
  - - "="
76
72
  - !ruby/object:Gem::Version
77
- hash: 21
78
73
  segments:
79
74
  - 1
80
75
  - 0
@@ -90,7 +85,6 @@ dependencies:
90
85
  requirements:
91
86
  - - "="
92
87
  - !ruby/object:Gem::Version
93
- hash: 15
94
88
  segments:
95
89
  - 1
96
90
  - 4
@@ -106,7 +100,6 @@ dependencies:
106
100
  requirements:
107
101
  - - "="
108
102
  - !ruby/object:Gem::Version
109
- hash: 29
110
103
  segments:
111
104
  - 1
112
105
  - 2
@@ -122,7 +115,6 @@ dependencies:
122
115
  requirements:
123
116
  - - "="
124
117
  - !ruby/object:Gem::Version
125
- hash: 19
126
118
  segments:
127
119
  - 1
128
120
  - 0
@@ -138,7 +130,6 @@ dependencies:
138
130
  requirements:
139
131
  - - "="
140
132
  - !ruby/object:Gem::Version
141
- hash: 47
142
133
  segments:
143
134
  - 1
144
135
  - 16
@@ -153,7 +144,6 @@ dependencies:
153
144
  requirements:
154
145
  - - "="
155
146
  - !ruby/object:Gem::Version
156
- hash: 21
157
147
  segments:
158
148
  - 1
159
149
  - 0
@@ -169,7 +159,6 @@ dependencies:
169
159
  requirements:
170
160
  - - "="
171
161
  - !ruby/object:Gem::Version
172
- hash: 11
173
162
  segments:
174
163
  - 2
175
164
  - 1
@@ -185,7 +174,6 @@ dependencies:
185
174
  requirements:
186
175
  - - "="
187
176
  - !ruby/object:Gem::Version
188
- hash: 23
189
177
  segments:
190
178
  - 1
191
179
  - 0
@@ -201,7 +189,6 @@ dependencies:
201
189
  requirements:
202
190
  - - "="
203
191
  - !ruby/object:Gem::Version
204
- hash: 15
205
192
  segments:
206
193
  - 0
207
194
  - 4
@@ -298,7 +285,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
298
285
  requirements:
299
286
  - - ">="
300
287
  - !ruby/object:Gem::Version
301
- hash: 3
302
288
  segments:
303
289
  - 0
304
290
  version: "0"
@@ -307,7 +293,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
293
  requirements:
308
294
  - - ">="
309
295
  - !ruby/object:Gem::Version
310
- hash: 3
311
296
  segments:
312
297
  - 0
313
298
  version: "0"