appstats 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -3
- data/lib/appstats.rb +2 -1
- data/lib/appstats/tasks.rb +1 -1
- data/lib/appstats/version.rb +1 -1
- data/lib/templates/appstats_config.rb +1 -1
- data/spec/logger_spec.rb +11 -11
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
appstats (0.0.
|
5
|
-
rails (
|
4
|
+
appstats (0.0.9)
|
5
|
+
rails (>= 2.3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
@@ -91,6 +91,5 @@ DEPENDENCIES
|
|
91
91
|
ZenTest
|
92
92
|
appstats!
|
93
93
|
mysql
|
94
|
-
rails (= 3.0.3)
|
95
94
|
rspec
|
96
95
|
standalone_migrations
|
data/lib/appstats.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'active_record'
|
3
|
+
require "#{File.dirname(__FILE__)}/appstats/code_injections"
|
3
4
|
require "#{File.dirname(__FILE__)}/appstats/entry"
|
4
5
|
require "#{File.dirname(__FILE__)}/appstats/tasks"
|
6
|
+
require "#{File.dirname(__FILE__)}/appstats/version"
|
5
7
|
require "#{File.dirname(__FILE__)}/appstats/logger"
|
6
|
-
require "#{File.dirname(__FILE__)}/appstats/code_injections"
|
7
8
|
|
8
9
|
module Appstats
|
9
10
|
# Your code goes here...
|
data/lib/appstats/tasks.rb
CHANGED
@@ -18,7 +18,7 @@ module Appstats
|
|
18
18
|
@app_migrate = "#{base}/db/migrate"
|
19
19
|
@config = "#{base}/db/config.yml"
|
20
20
|
@schema = "#{base}/db/schema.rb"
|
21
|
-
@appstats_initializer = "#{base}/config/initializers/
|
21
|
+
@appstats_initializer = "#{base}/config/initializers/appstats_config.rb"
|
22
22
|
@appstats_initializer_template = "#{here}/lib/templates/appstats_config.rb"
|
23
23
|
@env = 'DB'
|
24
24
|
@default_env = 'development'
|
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.9 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.9 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.9 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.9 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.9 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,36 +159,36 @@ 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.9 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.9 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.9 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.9 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.9 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.9 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
|
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: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Forward
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-21 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|