getclicky 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/getclicky/request.rb +1 -1
- data/lib/getclicky/version.rb +1 -1
- data/spec/getclicky/request_spec.rb +9 -4
- metadata +13 -13
data/lib/getclicky/request.rb
CHANGED
@@ -25,7 +25,7 @@ module Getclicky
|
|
25
25
|
# Build the hash of options for make resquest to API
|
26
26
|
#
|
27
27
|
def build_params(type, params = {})
|
28
|
-
query = { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => type, :output => :json }
|
28
|
+
query = { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => type.to_s.gsub(/_/, '-'), :output => :json }
|
29
29
|
query.merge(params) if params
|
30
30
|
end
|
31
31
|
end
|
data/lib/getclicky/version.rb
CHANGED
@@ -11,22 +11,27 @@ describe Getclicky::Request do
|
|
11
11
|
context "method build_params" do
|
12
12
|
it "should be set the right parameters" do
|
13
13
|
params = subject.build_params(:pages, :limit => 10, :hourly => 1)
|
14
|
-
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type =>
|
14
|
+
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => "pages", :limit => 10, :hourly => 1, :output => :json}
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should be leave hash parameters blank" do
|
18
18
|
params = subject.build_params(:pages)
|
19
|
-
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type =>
|
19
|
+
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => "pages", :output => :json}
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should default to an output format of json" do
|
23
23
|
params = subject.build_params(:pages)
|
24
|
-
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type =>
|
24
|
+
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => "pages", :output => :json}
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should allow overriding the output format" do
|
28
28
|
params = subject.build_params(:pages, :output => :xml)
|
29
|
-
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type =>
|
29
|
+
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => "pages", :output => :xml }
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should be able to set type with underscore" do
|
33
|
+
params = subject.build_params(:bounce_rate)
|
34
|
+
params.should == { :site_id => Getclicky.site_id, :sitekey => Getclicky.sitekey, :type => "bounce-rate", :output => :json }
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getclicky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-30 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70106845571760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.8.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70106845571760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hashie
|
27
|
-
requirement: &
|
27
|
+
requirement: &70106845570980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.1.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70106845570980
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70106845570520 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '2.6'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70106845570520
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: test_notifier
|
49
|
-
requirement: &
|
49
|
+
requirement: &70106845569860 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0.3'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70106845569860
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: fakeweb
|
60
|
-
requirement: &
|
60
|
+
requirement: &70106845566420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '1.3'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70106845566420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ruby-debug19
|
71
|
-
requirement: &
|
71
|
+
requirement: &70106845565720 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0.11'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70106845565720
|
80
80
|
description: Ruby Wrapper for GetClicky API Analytics
|
81
81
|
email:
|
82
82
|
- petersonferreiras@gmail.com
|