appstats 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/appstats/version.rb +1 -1
- data/spec/logger_spec.rb +14 -18
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/appstats/version.rb
CHANGED
data/spec/logger_spec.rb
CHANGED
@@ -127,29 +127,29 @@ module Appstats
|
|
127
127
|
|
128
128
|
it "should handle a statistics entry" do
|
129
129
|
expected = { :action => "address_search", :timestamp => "2010-09-21 23:15:20" }
|
130
|
-
actual = Appstats::Logger.entry_to_hash("0.0.
|
130
|
+
actual = Appstats::Logger.entry_to_hash("0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search")
|
131
131
|
actual.should == expected
|
132
132
|
end
|
133
133
|
|
134
134
|
it "should handle contexts" do
|
135
135
|
expected = { :action => "address_filter", :timestamp => "2010-09-21 23:15:20", :server => "Live", :app_name => 'Market' }
|
136
|
-
actual = Appstats::Logger.entry_to_hash("0.0.
|
136
|
+
actual = Appstats::Logger.entry_to_hash("0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live")
|
137
137
|
actual.should == expected
|
138
138
|
end
|
139
139
|
|
140
140
|
it "should handle actions with the delimiter (and change the delimiter)" do
|
141
141
|
expected = { :action => "address:=search-n", :timestamp => "2010-09-21 23:15:20" }
|
142
|
-
actual = Appstats::Logger.entry_to_hash("0.0.
|
142
|
+
actual = Appstats::Logger.entry_to_hash("0.0.11 setup[::,==,--n] 2010-09-21 23:15:20 action==address:=search-n")
|
143
143
|
actual.should == expected
|
144
144
|
|
145
145
|
expected = { :action => "address::search==--n", :timestamp => "2010-09-21 23:15:20" }
|
146
|
-
actual = Appstats::Logger.entry_to_hash("0.0.
|
146
|
+
actual = Appstats::Logger.entry_to_hash("0.0.11 setup[:::,===,---n] 2010-09-21 23:15:20 action===address::search==--n")
|
147
147
|
actual.should == expected
|
148
148
|
end
|
149
149
|
|
150
150
|
it "should handle contexts with the delimiter (and change the delimiter)" do
|
151
151
|
expected = { :action => "address", :timestamp => "2010-09-21 23:15:20", :server => "market:eval=-n" }
|
152
|
-
actual = Appstats::Logger.entry_to_hash("0.0.
|
152
|
+
actual = Appstats::Logger.entry_to_hash("0.0.11 setup[::,==,--n] 2010-09-21 23:15:20 action==address :: server==market:eval=-n")
|
153
153
|
actual.should == expected
|
154
154
|
end
|
155
155
|
|
@@ -159,61 +159,57 @@ module Appstats
|
|
159
159
|
describe "#entry_to_s" do
|
160
160
|
|
161
161
|
it "should handle a statistics entry" do
|
162
|
-
expected = "0.0.
|
162
|
+
expected = "0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search"
|
163
163
|
actual = Appstats::Logger.entry_to_s("address_search")
|
164
164
|
actual.should == expected
|
165
165
|
end
|
166
166
|
|
167
167
|
it "should handle default contexts" do
|
168
168
|
Appstats::Logger.default_contexts[:app_name] = "market"
|
169
|
-
expected = "0.0.
|
169
|
+
expected = "0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search : app_name=market"
|
170
170
|
actual = Appstats::Logger.entry_to_s("address_search")
|
171
171
|
actual.should == expected
|
172
172
|
end
|
173
173
|
|
174
174
|
it "should handle contexts (and sort them by symbol)" do
|
175
|
-
expected = "0.0.
|
175
|
+
expected = "0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live"
|
176
176
|
actual = Appstats::Logger.entry_to_s("address_filter", { :server => "Live", :app_name => 'Market' })
|
177
177
|
actual.should == expected
|
178
178
|
end
|
179
179
|
|
180
180
|
it "should handle actions with the delimiter (and change the delimiter)" do
|
181
|
-
expected = "0.0.
|
181
|
+
expected = "0.0.11 setup[::,==,--n] 2010-09-21 23:15:20 action==address:=search-n"
|
182
182
|
actual = Appstats::Logger.entry_to_s("address:=search-n")
|
183
183
|
actual.should == expected
|
184
184
|
|
185
|
-
expected = "0.0.
|
185
|
+
expected = "0.0.11 setup[:::,===,---n] 2010-09-21 23:15:20 action===address::search==--n"
|
186
186
|
actual = Appstats::Logger.entry_to_s("address::search==--n")
|
187
187
|
actual.should == expected
|
188
188
|
end
|
189
189
|
|
190
190
|
it "should handle contexts with the delimiter (and change the delimiter)" do
|
191
|
-
expected = "0.0.
|
191
|
+
expected = "0.0.11 setup[::,==,--n] 2010-09-21 23:15:20 action==address :: server==market:eval=-n"
|
192
192
|
actual = Appstats::Logger.entry_to_s("address", :server => 'market:eval=-n')
|
193
193
|
actual.should == expected
|
194
194
|
end
|
195
195
|
|
196
196
|
it "should convert newlines in action" do
|
197
|
-
expected = "0.0.
|
197
|
+
expected = "0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_-nsearch"
|
198
198
|
actual = Appstats::Logger.entry_to_s("address_\nsearch")
|
199
199
|
actual.should == expected
|
200
200
|
end
|
201
201
|
|
202
202
|
it "should convert newlines in context" do
|
203
|
-
expected = "0.0.
|
203
|
+
expected = "0.0.11 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search : blah=some-nlong-nstatement"
|
204
204
|
actual = Appstats::Logger.entry_to_s("address_search",:blah => "some\nlong\nstatement")
|
205
205
|
actual.should == expected
|
206
206
|
end
|
207
207
|
|
208
208
|
it "should convert newlines based on the delimiter" do
|
209
|
-
expected = "0.0.
|
209
|
+
expected = "0.0.11 setup[::,==,--n] 2010-09-21 23:15:20 action==address:=--nsearch-n"
|
210
210
|
actual = Appstats::Logger.entry_to_s("address:=\nsearch-n")
|
211
211
|
actual.should == expected
|
212
212
|
end
|
213
|
-
|
214
|
-
|
215
213
|
end
|
216
|
-
|
217
|
-
|
218
214
|
end
|
219
215
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Forward
|