fozzie_rails 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +1 -2
- data/Gemfile +1 -1
- data/README.md +14 -0
- data/fozzie_rails.gemspec +4 -2
- data/lib/fozzie/rails/version.rb +1 -1
- data/spec/lib/fozzie/rails/middleware_spec.rb +18 -18
- data/spec/lib/fozzie/rails/railtie_spec.rb +2 -2
- metadata +37 -63
- data/.rvmrc.example +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7c2e18ab2c7606091a6fd322fe8906fe644649d5
|
4
|
+
data.tar.gz: 89f479f1cf03703b8341ac970b455086cd51d9de
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: baccca526fe5f57124ec4b0dc07373eb9e08d0e9236628d8803b3811bbc195c35e33d2f48341bd42a05f1b95ddc8f247fc9b1aa3f31b3767839a3074050e8d8e
|
7
|
+
data.tar.gz: 0d47a2fc6067a84368afb8656a501f4aba5d0094c60dbf5e34231e37b6bcd508bc45eb5633bd52dde9075aa52514500a46dd144fdebfd431f953605c960225ee
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
fozzie_rails
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.5
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@ See [Fozzie](http://github.com/lonelyplanet/fozzie) for full details on what Foz
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
+
*NOTE: Fozzie requires Ruby 1.9.3 or greater*
|
10
|
+
|
9
11
|
Add this line to your application's Gemfile:
|
10
12
|
|
11
13
|
gem 'fozzie_rails'
|
@@ -25,3 +27,15 @@ Or install it yourself as:
|
|
25
27
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
26
28
|
4. Push to the branch (`git push origin my-new-feature`)
|
27
29
|
5. Create new Pull Request
|
30
|
+
|
31
|
+
## License
|
32
|
+
|
33
|
+
Copyright [2014] [LONELY PLANET PUBLICATIONS LTD]
|
34
|
+
|
35
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
36
|
+
You may obtain a copy of the License at
|
37
|
+
|
38
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
39
|
+
|
40
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
41
|
+
See the License for the specific language governing permissions and limitations under the License.
|
data/fozzie_rails.gemspec
CHANGED
@@ -16,10 +16,12 @@ Gem::Specification.new do |gem|
|
|
16
16
|
|
17
17
|
gem.rubyforge_project = "fozzie_rails"
|
18
18
|
|
19
|
-
gem.
|
19
|
+
gem.required_ruby_version = ">= 1.9.3"
|
20
|
+
|
21
|
+
gem.add_dependency 'fozzie', '~> 1.0.3'
|
20
22
|
|
21
23
|
gem.add_development_dependency 'rake'
|
22
|
-
gem.add_development_dependency 'rspec'
|
24
|
+
gem.add_development_dependency 'rspec', '~> 3.2'
|
23
25
|
gem.add_development_dependency 'guard'
|
24
26
|
gem.add_development_dependency 'guard-rspec'
|
25
27
|
gem.add_development_dependency 'rb-fsevent'
|
data/lib/fozzie/rails/version.rb
CHANGED
@@ -12,32 +12,32 @@ module Fozzie::Rails
|
|
12
12
|
describe "#rails_version" do
|
13
13
|
|
14
14
|
it "returns the major version from Rails.version" do
|
15
|
-
subject.rails_version.
|
15
|
+
expect(subject.rails_version).to be_kind_of(Integer)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#routing_lookup" do
|
20
20
|
|
21
21
|
it "returns ::ActionDispatch::Routing::RouteSet instance for Rails 3 and up" do
|
22
|
-
subject.routing_lookup.
|
22
|
+
expect(subject.routing_lookup).to be_kind_of(::ActionDispatch::Routing::RouteSet)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "returns ActionController::Routing::Routes instance for Rails 2" do
|
26
|
-
::Rails.
|
27
|
-
subject.routing_lookup.
|
26
|
+
expect(::Rails).to receive(:version).and_return(2)
|
27
|
+
expect(subject.routing_lookup).to eq ::ActionController::Routing::Routes
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "#generate_key" do
|
33
|
-
let(:env) {
|
34
|
-
let(:path) {
|
35
|
-
let(:routes) {
|
33
|
+
let(:env) { double "env" }
|
34
|
+
let(:path) { double "path" }
|
35
|
+
let(:routes) { double 'routes' }
|
36
36
|
subject { Middleware.new({}) }
|
37
37
|
|
38
38
|
it "gets the path_info and request method from env parameter" do
|
39
|
-
env.
|
40
|
-
env.
|
39
|
+
expect(env).to receive(:[]).with("PATH_INFO")
|
40
|
+
expect(env).to receive(:[]).with("REQUEST_METHOD")
|
41
41
|
|
42
42
|
subject.generate_key(env)
|
43
43
|
end
|
@@ -46,17 +46,17 @@ module Fozzie::Rails
|
|
46
46
|
let(:env) { { "PATH_INFO" => nil } }
|
47
47
|
|
48
48
|
it "does not lookup routing" do
|
49
|
-
subject.
|
49
|
+
expect(subject).to_not receive(:routing_lookup)
|
50
50
|
|
51
51
|
subject.generate_key(env)
|
52
52
|
end
|
53
53
|
|
54
54
|
it "does not register any stats" do
|
55
|
-
S.
|
55
|
+
expect(S).to_not receive(:increment)
|
56
56
|
end
|
57
57
|
|
58
58
|
it "returns nil" do
|
59
|
-
subject.generate_key(env).
|
59
|
+
expect(subject.generate_key(env)).to be_nil
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -64,20 +64,20 @@ module Fozzie::Rails
|
|
64
64
|
let(:env) { { "PATH_INFO" => path, "REQUEST_METHOD" => 'generate_key' } }
|
65
65
|
|
66
66
|
before do
|
67
|
-
subject.
|
68
|
-
routes.
|
67
|
+
allow(subject).to receive(:routing_lookup).and_return(routes)
|
68
|
+
allow(routes).to receive(:recognize_path).and_return({:controller => "controller",:action => "action" })
|
69
69
|
end
|
70
70
|
|
71
71
|
it "looks up controller and action for the path and request method" do
|
72
|
-
subject.
|
73
|
-
routes.
|
72
|
+
expect(subject).to receive(:routing_lookup).and_return(routes)
|
73
|
+
expect(routes).to receive(:recognize_path).with(path, :method => 'generate_key')
|
74
74
|
|
75
75
|
subject.generate_key(env)
|
76
76
|
end
|
77
77
|
|
78
78
|
it "returns a bucket generated from the controller, action, and 'render'" do
|
79
|
-
subject.generate_key(env).
|
79
|
+
expect(subject.generate_key(env)).to eq "controller.action.render"
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
|
-
end
|
83
|
+
end
|
@@ -4,7 +4,7 @@ module Fozzie::Rails
|
|
4
4
|
describe Railtie do
|
5
5
|
|
6
6
|
it "is loaded when Rails exists" do
|
7
|
-
Application.middleware.middlewares.
|
7
|
+
expect(Application.middleware.middlewares).to include(Fozzie::Rails::Middleware)
|
8
8
|
end
|
9
9
|
end
|
10
|
-
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,174 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fozzie_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Marc Watts
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: fozzie
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0.
|
19
|
+
version: 1.0.3
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.
|
26
|
+
version: 1.0.3
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '3.2'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
54
|
+
version: '3.2'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: guard
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: guard-rspec
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rb-fsevent
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: activesupport
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - ">="
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: actionpack
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - ">="
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - ">="
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: railties
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - ">="
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: '0'
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - ">="
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: '0'
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: tzinfo
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- -
|
143
|
+
- - ">="
|
164
144
|
- !ruby/object:Gem::Version
|
165
145
|
version: '0'
|
166
146
|
type: :development
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- -
|
150
|
+
- - ">="
|
172
151
|
- !ruby/object:Gem::Version
|
173
152
|
version: '0'
|
174
153
|
description: Gem to make statistics sending from Rails applications simple and efficient
|
@@ -179,9 +158,10 @@ executables: []
|
|
179
158
|
extensions: []
|
180
159
|
extra_rdoc_files: []
|
181
160
|
files:
|
182
|
-
- .gitignore
|
183
|
-
- .
|
184
|
-
- .
|
161
|
+
- ".gitignore"
|
162
|
+
- ".ruby-gemset"
|
163
|
+
- ".ruby-version"
|
164
|
+
- ".travis.yml"
|
185
165
|
- Gemfile
|
186
166
|
- Guardfile
|
187
167
|
- LICENSE
|
@@ -197,35 +177,29 @@ files:
|
|
197
177
|
- spec/spec_helper.rb
|
198
178
|
homepage: http://devops.lonelyplanet.com
|
199
179
|
licenses: []
|
180
|
+
metadata: {}
|
200
181
|
post_install_message:
|
201
182
|
rdoc_options: []
|
202
183
|
require_paths:
|
203
184
|
- lib
|
204
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
205
|
-
none: false
|
206
186
|
requirements:
|
207
|
-
- -
|
187
|
+
- - ">="
|
208
188
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
210
|
-
segments:
|
211
|
-
- 0
|
212
|
-
hash: -2029736035426700573
|
189
|
+
version: 1.9.3
|
213
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
|
-
none: false
|
215
191
|
requirements:
|
216
|
-
- -
|
192
|
+
- - ">="
|
217
193
|
- !ruby/object:Gem::Version
|
218
194
|
version: '0'
|
219
|
-
segments:
|
220
|
-
- 0
|
221
|
-
hash: -2029736035426700573
|
222
195
|
requirements: []
|
223
196
|
rubyforge_project: fozzie_rails
|
224
|
-
rubygems_version:
|
197
|
+
rubygems_version: 2.2.2
|
225
198
|
signing_key:
|
226
|
-
specification_version:
|
199
|
+
specification_version: 4
|
227
200
|
summary: Ruby gem from Lonely Planet Online to register statistics in Rails
|
228
201
|
test_files:
|
229
202
|
- spec/lib/fozzie/rails/middleware_spec.rb
|
230
203
|
- spec/lib/fozzie/rails/railtie_spec.rb
|
231
204
|
- spec/spec_helper.rb
|
205
|
+
has_rdoc:
|
data/.rvmrc.example
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use --create 1.9.3@fozzie_rails
|