metrixapp 0.1.1 → 0.1.2
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/VERSION +1 -1
- data/lib/metrixapp.rb +1 -0
- data/metrixapp.gemspec +2 -2
- data/test/test_metrixapp.rb +6 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/metrixapp.rb
CHANGED
@@ -31,6 +31,7 @@ class MetrixApp
|
|
31
31
|
# m.log 'Upgrade', ['foo@example.org', 'Premium']
|
32
32
|
#
|
33
33
|
def log(event_name, data={})
|
34
|
+
event_name = event_name.to_s
|
34
35
|
raise ArgumentError.new 'You MUST give your event a name' unless event_name.match /.+/
|
35
36
|
|
36
37
|
@http.request URI.parse("http://www.metrixapp.com/log?name=#{CGI::escape(event_name)}&data=#{CGI::escape(data.to_json)}&account_code=#{@account_code}")
|
data/metrixapp.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{metrixapp}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Keith McDonnell"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-28}
|
13
13
|
s.description = %q{MetrixApp Ruby API: send data to MetrixApp}
|
14
14
|
s.email = %q{keith@dancingtext.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_metrixapp.rb
CHANGED
@@ -23,15 +23,18 @@ class TestMetrixapp < Test::Unit::TestCase
|
|
23
23
|
MetrixApp.new(account_code).log 'foo', 'foo'
|
24
24
|
end
|
25
25
|
|
26
|
+
test "should accept symbol as event name" do
|
27
|
+
assert_nothing_raised { MetrixApp.new(account_code).log :foo}
|
28
|
+
end
|
29
|
+
|
26
30
|
def mock_log_request(name, data)
|
27
31
|
event_name = CGI::escape name
|
28
32
|
event_data = CGI::escape data.to_json
|
29
33
|
|
30
34
|
uri = URI.expects(:parse).
|
31
|
-
with("http://www.metrixapp.com/log?name=#{event_name}&data=#{event_data}&account_code=#{account_code}")
|
32
|
-
returns URI.parse 'http://example.org'
|
35
|
+
with("http://www.metrixapp.com/log?name=#{event_name}&data=#{event_data}&account_code=#{account_code}")
|
33
36
|
|
34
|
-
Net::HTTP::Persistent.any_instance.expects(:request)
|
37
|
+
Net::HTTP::Persistent.any_instance.expects(:request)
|
35
38
|
end
|
36
39
|
|
37
40
|
def account_code
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Keith McDonnell
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-28 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|