fnordmetric 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/VERSION +1 -1
- data/fnordmetric.gemspec +9 -3
- data/lib/fnordmetric/namespace.rb +2 -3
- data/readme.rdoc +5 -4
- data/spec/dashboard_spec.rb +5 -0
- data/spec/namespace_spec.rb +6 -1
- metadata +57 -35
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -21,6 +21,7 @@ GEM
|
|
21
21
|
git (1.2.5)
|
22
22
|
haml (3.1.2)
|
23
23
|
hiredis (0.3.2)
|
24
|
+
i18n (0.6.0)
|
24
25
|
jeweler (1.5.2)
|
25
26
|
bundler (~> 1.0.0)
|
26
27
|
git (>= 1.2.5)
|
@@ -61,6 +62,7 @@ DEPENDENCIES
|
|
61
62
|
em-hiredis
|
62
63
|
eventmachine
|
63
64
|
haml
|
65
|
+
i18n
|
64
66
|
jeweler (~> 1.5.2)
|
65
67
|
json
|
66
68
|
rack
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.4
|
data/fnordmetric.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "fnordmetric"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Asmuth"]
|
12
|
-
s.date = "2011-12-
|
12
|
+
s.date = "2011-12-28"
|
13
13
|
s.description = "FnordMetric is a Ruby Event-Tracking gem on steroids"
|
14
14
|
s.email = "paul@paulasmuth.com"
|
15
15
|
s.files = [
|
@@ -76,7 +76,7 @@ Gem::Specification.new do |s|
|
|
76
76
|
s.homepage = "http://github.com/paulasmuth/fnordmetric"
|
77
77
|
s.licenses = ["MIT"]
|
78
78
|
s.require_paths = ["lib"]
|
79
|
-
s.rubygems_version = "1.8.
|
79
|
+
s.rubygems_version = "1.8.11"
|
80
80
|
s.summary = "FnordMetric is a Ruby Event-Tracking gem on steroids"
|
81
81
|
s.test_files = [
|
82
82
|
"spec/app_spec.rb",
|
@@ -102,11 +102,13 @@ Gem::Specification.new do |s|
|
|
102
102
|
s.add_runtime_dependency(%q<eventmachine>, [">= 0"])
|
103
103
|
s.add_runtime_dependency(%q<em-hiredis>, [">= 0"])
|
104
104
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
105
|
+
s.add_runtime_dependency(%q<i18n>, [">= 0"])
|
105
106
|
s.add_runtime_dependency(%q<haml>, [">= 0"])
|
106
107
|
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
107
108
|
s.add_runtime_dependency(%q<rack-test>, [">= 0"])
|
108
109
|
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
|
109
110
|
s.add_runtime_dependency(%q<thin>, [">= 0"])
|
111
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
110
112
|
s.add_development_dependency(%q<delorean>, [">= 0"])
|
111
113
|
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
|
112
114
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
@@ -119,11 +121,13 @@ Gem::Specification.new do |s|
|
|
119
121
|
s.add_dependency(%q<eventmachine>, [">= 0"])
|
120
122
|
s.add_dependency(%q<em-hiredis>, [">= 0"])
|
121
123
|
s.add_dependency(%q<json>, [">= 0"])
|
124
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
122
125
|
s.add_dependency(%q<haml>, [">= 0"])
|
123
126
|
s.add_dependency(%q<rack>, [">= 0"])
|
124
127
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
125
128
|
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
126
129
|
s.add_dependency(%q<thin>, [">= 0"])
|
130
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
127
131
|
s.add_dependency(%q<delorean>, [">= 0"])
|
128
132
|
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
129
133
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
@@ -137,11 +141,13 @@ Gem::Specification.new do |s|
|
|
137
141
|
s.add_dependency(%q<eventmachine>, [">= 0"])
|
138
142
|
s.add_dependency(%q<em-hiredis>, [">= 0"])
|
139
143
|
s.add_dependency(%q<json>, [">= 0"])
|
144
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
140
145
|
s.add_dependency(%q<haml>, [">= 0"])
|
141
146
|
s.add_dependency(%q<rack>, [">= 0"])
|
142
147
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
143
148
|
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
144
149
|
s.add_dependency(%q<thin>, [">= 0"])
|
150
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
145
151
|
s.add_dependency(%q<delorean>, [">= 0"])
|
146
152
|
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
147
153
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
@@ -66,9 +66,8 @@ class FnordMetric::Namespace
|
|
66
66
|
|
67
67
|
def dashboards(name=nil)
|
68
68
|
return @dashboards unless name
|
69
|
-
|
70
|
-
|
71
|
-
)
|
69
|
+
dash = FnordMetric::Dashboard.new(:title => name)
|
70
|
+
@dashboards[dash.token.to_s] ||= dash
|
72
71
|
end
|
73
72
|
|
74
73
|
def sessions(_ids, opts={})
|
data/readme.rdoc
CHANGED
@@ -42,8 +42,9 @@ Simple Example: This will listen for json-events with type=unicorn_seen and rend
|
|
42
42
|
widget 'Overview', {
|
43
43
|
:title => "Unicorn-Sightings per Hour",
|
44
44
|
:type => :timeline,
|
45
|
-
:gauges => :unicorns_seen_per_hour,
|
46
|
-
:
|
45
|
+
:gauges => :unicorns_seen_per_hour,
|
46
|
+
:include_current => true,
|
47
|
+
:autoupdate => 2
|
47
48
|
}
|
48
49
|
|
49
50
|
end
|
@@ -56,11 +57,11 @@ Start the app (requires ruby >= 1.9.2):
|
|
56
57
|
|
57
58
|
Log all incoming events:
|
58
59
|
|
59
|
-
$ ruby my_stats_app.rb log
|
60
|
+
$ ruby my_stats_app.rb log DUMP_FILE=/tmp/foo.json
|
60
61
|
|
61
62
|
This is the easiest way to submit an event:
|
62
63
|
|
63
|
-
echo "{
|
64
|
+
echo "{\"_type\": \"unicorn_seen\"}" | nc localhost 1337
|
64
65
|
|
65
66
|
|
66
67
|
== Installation
|
data/spec/dashboard_spec.rb
CHANGED
@@ -15,6 +15,11 @@ describe FnordMetric::Dashboard do
|
|
15
15
|
dashboard.token.should == 'MyF00barDash_board'
|
16
16
|
end
|
17
17
|
|
18
|
+
it "should build the correct token if the dashboard name contains whitespaces" do
|
19
|
+
dashboard = FnordMetric::Dashboard.new(:title => 'My!F00bar Dash_board'){ |dash| }
|
20
|
+
dashboard.token.should == 'MyF00barDash_board'
|
21
|
+
end
|
22
|
+
|
18
23
|
it "should add a widget" do
|
19
24
|
pending("fix this")
|
20
25
|
#dashboard = FnordMetric::Dashboard.new(:title => 'My!F00bar-.Dash_board'){ |dash| }
|
data/spec/namespace_spec.rb
CHANGED
@@ -19,8 +19,13 @@ describe FnordMetric::Namespace do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should create a new dashboard if a widget is added" do
|
22
|
+
@namespace.widget("MyFooDash", nil)
|
23
|
+
@namespace.dashboards.keys.should == ["MyFooDash"]
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should create a new dashboard if the dashboard-title contains whitespaces" do
|
22
27
|
@namespace.widget("My Dash", nil)
|
23
|
-
@namespace.dashboards.keys.should == ["
|
28
|
+
@namespace.dashboards.keys.should == ["MyDash"]
|
24
29
|
end
|
25
30
|
|
26
31
|
it "should create a new dashboard if a widget is added and add the widget"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fnordmetric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
16
|
-
requirement: &
|
16
|
+
requirement: &84790870 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *84790870
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sinatra
|
27
|
-
requirement: &
|
27
|
+
requirement: &84790360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.2.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *84790360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: redis
|
38
|
-
requirement: &
|
38
|
+
requirement: &84789850 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.2.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *84789850
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: eventmachine
|
49
|
-
requirement: &
|
49
|
+
requirement: &84789450 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *84789450
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: em-hiredis
|
60
|
-
requirement: &
|
60
|
+
requirement: &84788980 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *84788980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
|
-
requirement: &
|
71
|
+
requirement: &84788680 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,21 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *84788680
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: i18n
|
82
|
+
requirement: &84788410 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *84788410
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: haml
|
82
|
-
requirement: &
|
93
|
+
requirement: &84733550 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,10 +98,10 @@ dependencies:
|
|
87
98
|
version: '0'
|
88
99
|
type: :runtime
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *84733550
|
91
102
|
- !ruby/object:Gem::Dependency
|
92
103
|
name: rack
|
93
|
-
requirement: &
|
104
|
+
requirement: &84733040 !ruby/object:Gem::Requirement
|
94
105
|
none: false
|
95
106
|
requirements:
|
96
107
|
- - ! '>='
|
@@ -98,10 +109,10 @@ dependencies:
|
|
98
109
|
version: '0'
|
99
110
|
type: :runtime
|
100
111
|
prerelease: false
|
101
|
-
version_requirements: *
|
112
|
+
version_requirements: *84733040
|
102
113
|
- !ruby/object:Gem::Dependency
|
103
114
|
name: rack-test
|
104
|
-
requirement: &
|
115
|
+
requirement: &84732470 !ruby/object:Gem::Requirement
|
105
116
|
none: false
|
106
117
|
requirements:
|
107
118
|
- - ! '>='
|
@@ -109,10 +120,10 @@ dependencies:
|
|
109
120
|
version: '0'
|
110
121
|
type: :runtime
|
111
122
|
prerelease: false
|
112
|
-
version_requirements: *
|
123
|
+
version_requirements: *84732470
|
113
124
|
- !ruby/object:Gem::Dependency
|
114
125
|
name: yajl-ruby
|
115
|
-
requirement: &
|
126
|
+
requirement: &84731710 !ruby/object:Gem::Requirement
|
116
127
|
none: false
|
117
128
|
requirements:
|
118
129
|
- - ! '>='
|
@@ -120,10 +131,21 @@ dependencies:
|
|
120
131
|
version: '0'
|
121
132
|
type: :runtime
|
122
133
|
prerelease: false
|
123
|
-
version_requirements: *
|
134
|
+
version_requirements: *84731710
|
124
135
|
- !ruby/object:Gem::Dependency
|
125
136
|
name: thin
|
126
|
-
requirement: &
|
137
|
+
requirement: &84730670 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
type: :runtime
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: *84730670
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: activesupport
|
148
|
+
requirement: &84730280 !ruby/object:Gem::Requirement
|
127
149
|
none: false
|
128
150
|
requirements:
|
129
151
|
- - ! '>='
|
@@ -131,10 +153,10 @@ dependencies:
|
|
131
153
|
version: '0'
|
132
154
|
type: :runtime
|
133
155
|
prerelease: false
|
134
|
-
version_requirements: *
|
156
|
+
version_requirements: *84730280
|
135
157
|
- !ruby/object:Gem::Dependency
|
136
158
|
name: delorean
|
137
|
-
requirement: &
|
159
|
+
requirement: &84729890 !ruby/object:Gem::Requirement
|
138
160
|
none: false
|
139
161
|
requirements:
|
140
162
|
- - ! '>='
|
@@ -142,10 +164,10 @@ dependencies:
|
|
142
164
|
version: '0'
|
143
165
|
type: :development
|
144
166
|
prerelease: false
|
145
|
-
version_requirements: *
|
167
|
+
version_requirements: *84729890
|
146
168
|
- !ruby/object:Gem::Dependency
|
147
169
|
name: rspec
|
148
|
-
requirement: &
|
170
|
+
requirement: &84729450 !ruby/object:Gem::Requirement
|
149
171
|
none: false
|
150
172
|
requirements:
|
151
173
|
- - ~>
|
@@ -153,10 +175,10 @@ dependencies:
|
|
153
175
|
version: 2.6.0
|
154
176
|
type: :development
|
155
177
|
prerelease: false
|
156
|
-
version_requirements: *
|
178
|
+
version_requirements: *84729450
|
157
179
|
- !ruby/object:Gem::Dependency
|
158
180
|
name: shoulda
|
159
|
-
requirement: &
|
181
|
+
requirement: &84728530 !ruby/object:Gem::Requirement
|
160
182
|
none: false
|
161
183
|
requirements:
|
162
184
|
- - ! '>='
|
@@ -164,10 +186,10 @@ dependencies:
|
|
164
186
|
version: '0'
|
165
187
|
type: :development
|
166
188
|
prerelease: false
|
167
|
-
version_requirements: *
|
189
|
+
version_requirements: *84728530
|
168
190
|
- !ruby/object:Gem::Dependency
|
169
191
|
name: bundler
|
170
|
-
requirement: &
|
192
|
+
requirement: &84727640 !ruby/object:Gem::Requirement
|
171
193
|
none: false
|
172
194
|
requirements:
|
173
195
|
- - ~>
|
@@ -175,10 +197,10 @@ dependencies:
|
|
175
197
|
version: 1.0.0
|
176
198
|
type: :development
|
177
199
|
prerelease: false
|
178
|
-
version_requirements: *
|
200
|
+
version_requirements: *84727640
|
179
201
|
- !ruby/object:Gem::Dependency
|
180
202
|
name: jeweler
|
181
|
-
requirement: &
|
203
|
+
requirement: &84602760 !ruby/object:Gem::Requirement
|
182
204
|
none: false
|
183
205
|
requirements:
|
184
206
|
- - ~>
|
@@ -186,7 +208,7 @@ dependencies:
|
|
186
208
|
version: 1.5.2
|
187
209
|
type: :development
|
188
210
|
prerelease: false
|
189
|
-
version_requirements: *
|
211
|
+
version_requirements: *84602760
|
190
212
|
description: FnordMetric is a Ruby Event-Tracking gem on steroids
|
191
213
|
email: paul@paulasmuth.com
|
192
214
|
executables: []
|
@@ -273,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
295
|
version: '0'
|
274
296
|
requirements: []
|
275
297
|
rubyforge_project:
|
276
|
-
rubygems_version: 1.8.
|
298
|
+
rubygems_version: 1.8.11
|
277
299
|
signing_key:
|
278
300
|
specification_version: 3
|
279
301
|
summary: FnordMetric is a Ruby Event-Tracking gem on steroids
|