getclicky 0.1.3 → 0.1.4
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.
- checksums.yaml +7 -0
- data/.travis.yml +8 -0
- data/Gemfile +9 -0
- data/README.md +21 -22
- data/getclicky.gemspec +7 -10
- data/lib/getclicky.rb +9 -10
- data/lib/getclicky/encode.rb +22 -0
- data/lib/getclicky/request.rb +1 -1
- data/lib/getclicky/response.rb +6 -4
- data/lib/getclicky/types.rb +15 -5
- data/lib/getclicky/version.rb +2 -2
- data/spec/getclicky/client_spec.rb +5 -5
- data/spec/getclicky/encode_spec.rb +10 -0
- data/spec/getclicky/request_spec.rb +47 -15
- data/spec/getclicky/response_spec.rb +50 -27
- data/spec/getclicky_spec.rb +11 -11
- data/spec/spec_helper.rb +6 -7
- metadata +34 -45
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 26054478b26bf56eef0014ec5a3fa344c3143901
|
4
|
+
data.tar.gz: 42d6d1dce6a2341e589baebf000a929a64568878
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6185eb7b9d18ac9571f0105212068e3a4e4bed9d920d793f3ca9fc147db6fb869953aeae9db9da2fee456d023a9aa9a66dab2774e8d444331f0aa8a4ce223861
|
7
|
+
data.tar.gz: a4a4f822e595582c70ee62ef99e002745d56e9b332d0e1584c858679daebcef8fdad4a412086e188893a8a8b7737b94787aee2c517128f174b50cf380e9e3809
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,19 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# Clicky Analytics API Library
|
2
2
|
|
3
|
-
|
3
|
+
[](http://badge.fury.io/rb/getclicky)
|
4
|
+
[](https://travis-ci.org/petersonfs/getclicky)
|
5
|
+
[](https://codeclimate.com/github/petersonfs/getclicky)
|
6
|
+
[](https://codeclimate.com/github/petersonfs/getclicky)
|
7
|
+
|
8
|
+
A swiss knife ruby wrapper for Clicky Analytics API. For more information see: http://clicky.com/help/api.
|
4
9
|
|
5
10
|
## Installation
|
6
11
|
|
7
12
|
``` ruby
|
8
|
-
## Gemfile for Rails
|
9
|
-
gem 'getclicky', '~> 0.1'
|
13
|
+
## Gemfile for Rails, Sinatra
|
14
|
+
gem 'getclicky', '~> 0.1.4'
|
10
15
|
```
|
11
16
|
|
12
17
|
## Usage
|
13
18
|
|
14
19
|
### Ruby wrapper
|
15
20
|
|
16
|
-
First, you'll need to set up your site_id and sitekey. You can discover this information by accessing settings in your account at http://
|
21
|
+
First, you'll need to set up your site_id and sitekey. You can discover this information by accessing settings in your account at http://clicky.com.
|
17
22
|
|
18
23
|
``` ruby
|
19
24
|
Getclicky.configure do |config|
|
@@ -28,15 +33,15 @@ Then you can simply instantiate a new Getclicky::Client object.
|
|
28
33
|
``` ruby
|
29
34
|
getclicky = Getclicky::Client.new
|
30
35
|
```
|
31
|
-
|
32
|
-
All types in API are methods here looks, you can find all types http://
|
36
|
+
|
37
|
+
All types in API are methods here looks, you can find all types http://clicky.com/help/api:
|
33
38
|
|
34
39
|
``` ruby
|
35
40
|
getclicky.pages()
|
36
41
|
getclicky.tweets()
|
37
42
|
getclicky.visitors()
|
38
43
|
```
|
39
|
-
|
44
|
+
|
40
45
|
In each method you can pass optional parameters as a hash looks:
|
41
46
|
|
42
47
|
``` ruby
|
@@ -50,35 +55,29 @@ You can also request more than one data type in a single request:
|
|
50
55
|
``` ruby
|
51
56
|
getclicky.multiple([:pages, :downloads], {:date => "last-7-days"})
|
52
57
|
```
|
53
|
-
|
54
|
-
By default
|
58
|
+
|
59
|
+
By default clicky API returns an array of [Hashies](https://github.com/intridea/hashie) as data, but you can change by providing an :output parameter like:
|
55
60
|
|
56
61
|
##### JSON
|
57
62
|
|
58
63
|
``` ruby
|
59
64
|
getclicky.visitors(:output => :json, :date => "last-7-days", :daily => 1)
|
60
65
|
```
|
61
|
-
|
62
|
-
##### CSV
|
63
66
|
|
64
|
-
|
65
|
-
getclicky.visitors(:output => :csv, :date => "last-7-days", :daily => 1)
|
66
|
-
```
|
67
|
-
|
68
|
-
##### PHP
|
67
|
+
##### XML
|
69
68
|
|
70
69
|
``` ruby
|
71
|
-
getclicky.visitors(:output => :
|
70
|
+
getclicky.visitors(:output => :xml, :date => "last-7-days", :daily => 1)
|
72
71
|
```
|
73
|
-
|
72
|
+
|
74
73
|
Enjoy!
|
75
74
|
|
76
75
|
## Roadmap
|
77
76
|
|
78
77
|
* Improve the tests
|
79
|
-
|
78
|
+
|
80
79
|
## Author
|
81
|
-
* Peterson Ferreira ([
|
80
|
+
* Peterson Ferreira ([petersonfs.me](petersonfs.me))
|
82
81
|
|
83
82
|
## Collaborators
|
84
|
-
* Bobby Uhlenbrock ([github.com/uhlenbrock](github.com/uhlenbrock))
|
83
|
+
* Bobby Uhlenbrock ([github.com/uhlenbrock](github.com/uhlenbrock))
|
data/getclicky.gemspec
CHANGED
@@ -1,24 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "getclicky"
|
2
|
+
require File.expand_path("../lib/getclicky/version", __FILE__)
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
5
|
s.name = "getclicky"
|
7
6
|
s.version = Getclicky::Version::STRING
|
8
7
|
s.authors = ["Peterson Ferreira"]
|
9
8
|
s.email = ["petersonferreiras@gmail.com"]
|
10
|
-
s.homepage = "http://github.com/
|
11
|
-
s.summary = %q{Ruby Wrapper for
|
9
|
+
s.homepage = "http://github.com/petersonfs/getclicky"
|
10
|
+
s.summary = %q{Ruby Wrapper for Clicky Analytics API}
|
12
11
|
s.description = s.summary
|
13
12
|
|
14
|
-
s.add_dependency "hashie"
|
15
|
-
s.add_development_dependency "rspec"
|
16
|
-
s.add_development_dependency "
|
17
|
-
s.add_development_dependency "fakeweb" , "~> 1.3.0"
|
18
|
-
s.add_development_dependency "ruby-debug19" , "~> 0.11"
|
13
|
+
s.add_dependency "hashie" , "~> 3.3.1"
|
14
|
+
s.add_development_dependency "rspec" , "~> 3.0.0"
|
15
|
+
s.add_development_dependency "fakeweb" , "~> 1.3.0"
|
19
16
|
|
20
17
|
s.files = `git ls-files`.split("\n")
|
21
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
20
|
s.require_paths = ["lib"]
|
24
|
-
end
|
21
|
+
end
|
data/lib/getclicky.rb
CHANGED
@@ -1,45 +1,44 @@
|
|
1
1
|
# A Ruby class to call the Getclicky API Analytics.
|
2
2
|
# You might use this if you want to see data of Getclicky in your application.
|
3
3
|
|
4
|
-
require "httparty"
|
5
|
-
|
6
4
|
module Getclicky
|
7
5
|
autoload :Client , "getclicky/client"
|
6
|
+
autoload :Encode , "getclicky/encode"
|
8
7
|
autoload :Request , "getclicky/request"
|
9
8
|
autoload :Response, "getclicky/response"
|
10
9
|
autoload :Types , "getclicky/types"
|
11
10
|
autoload :Version , "getclicky/version"
|
12
|
-
|
11
|
+
|
13
12
|
# Class implemented to abstract 404 errors.
|
14
13
|
#
|
15
14
|
class Getclicky::NotFoundError < StandardError; end
|
16
|
-
|
15
|
+
|
17
16
|
class << self
|
18
17
|
# Set the site_id that will do requests to the API.
|
19
18
|
# Will be required in every request.
|
20
19
|
#
|
21
20
|
attr_accessor :site_id
|
22
|
-
|
21
|
+
|
23
22
|
# Set the sitekey that will do request to the API.
|
24
23
|
# Will be required in every request.
|
25
24
|
#
|
26
25
|
attr_accessor :sitekey
|
27
|
-
|
26
|
+
|
28
27
|
# Set the admin sitekey.
|
29
28
|
# Only used for certain requests.
|
30
29
|
#
|
31
30
|
attr_accessor :admin_sitekey
|
32
31
|
end
|
33
|
-
|
32
|
+
|
34
33
|
# API endpoint of Getclicky
|
35
34
|
#
|
36
35
|
def self.endpoint
|
37
|
-
ENV.fetch("GETCLICKY_ENDPOINT", "http://api.
|
36
|
+
ENV.fetch("GETCLICKY_ENDPOINT", "http://api.clicky.com/api/stats/4")
|
38
37
|
end
|
39
|
-
|
38
|
+
|
40
39
|
# Yield Getclicky module so you can easily configure options
|
41
40
|
#
|
42
41
|
def self.configure(&block)
|
43
42
|
yield Getclicky
|
44
43
|
end
|
45
|
-
end
|
44
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "cgi"
|
2
|
+
|
3
|
+
module Getclicky
|
4
|
+
class Encode
|
5
|
+
|
6
|
+
def self.encode(value, key = nil)
|
7
|
+
case value
|
8
|
+
when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&')
|
9
|
+
when Array then value.map { |v| encode(v, "#{key}[]") }.join('&')
|
10
|
+
when nil then ''
|
11
|
+
else "#{key}=#{CGI.escape(value.to_s)}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def self.append_key(root_key, key)
|
18
|
+
root_key.nil? ? key : "#{root_key}[#{key.to_s}]"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
data/lib/getclicky/request.rb
CHANGED
data/lib/getclicky/response.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "hashie"
|
2
|
+
require "json"
|
2
3
|
|
3
4
|
module Getclicky
|
4
5
|
class Response
|
@@ -20,11 +21,12 @@ module Getclicky
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def mashify_data
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
json = @item.is_a?(String) ? JSON.parse(@item) : @item
|
25
|
+
if json.size.eql?(1)
|
26
|
+
parse(json.first['dates'])
|
27
|
+
elsif json.size > 1
|
26
28
|
{}.tap do |results|
|
27
|
-
|
29
|
+
json.collect { |r| results[r['type'].gsub('-','_').intern] = parse(r['dates']) }
|
28
30
|
end
|
29
31
|
else
|
30
32
|
@item
|
data/lib/getclicky/types.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Getclicky
|
2
|
-
module Types
|
2
|
+
module Types
|
3
3
|
# Request types that the API accepts.
|
4
4
|
#
|
5
5
|
ALL = [
|
@@ -8,6 +8,8 @@ module Getclicky
|
|
8
8
|
:pages_exit,
|
9
9
|
:downloads,
|
10
10
|
:events,
|
11
|
+
:video,
|
12
|
+
:site_domains,
|
11
13
|
:links,
|
12
14
|
:links_domains,
|
13
15
|
:links_outbound,
|
@@ -15,6 +17,7 @@ module Getclicky
|
|
15
17
|
:searches_keywords,
|
16
18
|
:searches_engines,
|
17
19
|
:searches_rankings,
|
20
|
+
:searches_local,
|
18
21
|
:goals,
|
19
22
|
:split_tests,
|
20
23
|
:campaigns,
|
@@ -25,6 +28,7 @@ module Getclicky
|
|
25
28
|
:web_browsers,
|
26
29
|
:operating_systems,
|
27
30
|
:screen_resolutions,
|
31
|
+
:hardware,
|
28
32
|
:hostnames,
|
29
33
|
:organizations,
|
30
34
|
:engagement_actions,
|
@@ -33,24 +37,30 @@ module Getclicky
|
|
33
37
|
:visitors_most_active,
|
34
38
|
:traffic_sources,
|
35
39
|
:tweets,
|
36
|
-
:shorturls,
|
40
|
+
:shorturls,
|
37
41
|
:visitors_list,
|
38
42
|
:actions_list,
|
39
43
|
:searches_recent,
|
40
44
|
:searches_unique,
|
41
45
|
:links_recent,
|
42
|
-
:links_unique,
|
46
|
+
:links_unique,
|
47
|
+
:uptime,
|
48
|
+
:uptime_list,
|
43
49
|
:visitors,
|
44
50
|
:visitors_online,
|
45
51
|
:visitors_unique,
|
46
52
|
:visitors_new,
|
47
53
|
:actions,
|
54
|
+
:actions_pageviews,
|
55
|
+
:actions_downloads,
|
56
|
+
:actions_outbounds,
|
57
|
+
:actions_clicks,
|
48
58
|
:actions_average,
|
49
59
|
:time_average,
|
50
60
|
:time_average_pretty,
|
51
61
|
:time_total,
|
52
62
|
:time_total_pretty,
|
53
63
|
:bounce_rate
|
54
|
-
]
|
64
|
+
]
|
55
65
|
end
|
56
|
-
end
|
66
|
+
end
|
data/lib/getclicky/version.rb
CHANGED
@@ -3,15 +3,15 @@ require "spec_helper"
|
|
3
3
|
describe Getclicky::Client do
|
4
4
|
context "should be create methods to make request to API" do
|
5
5
|
Getclicky::Types::ALL.each do |type|
|
6
|
-
class_eval <<-RUBY, __FILE__, __LINE__
|
6
|
+
class_eval <<-RUBY, __FILE__, __LINE__
|
7
7
|
it "should be implement #{type.to_s} method" do
|
8
|
-
subject.
|
8
|
+
expect(subject).to respond_to(type)
|
9
9
|
end
|
10
10
|
RUBY
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
it "should be implement multiple method" do
|
14
|
-
subject.
|
14
|
+
expect(subject).to respond_to("multiple")
|
15
15
|
end
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Getclicky::Encode do
|
4
|
+
it "should properly encode nested query attributes" do
|
5
|
+
hash = { custom: { email: "test@test.com" }, date: "last-7-days", output: :json }
|
6
|
+
params = Getclicky::Encode.encode(hash)
|
7
|
+
|
8
|
+
expect(params).to eq("custom[email]=test%40test.com&date=last-7-days&output=json")
|
9
|
+
end
|
10
|
+
end
|
@@ -4,41 +4,73 @@ describe Getclicky::Request do
|
|
4
4
|
subject {
|
5
5
|
Getclicky::Request.new(:pages, :limit => 10, :hourly => 1)
|
6
6
|
}
|
7
|
-
|
8
|
-
its(:type) { should eql (:pages) }
|
9
|
-
its(:params) { should eql ({:limit => 10, :hourly => 1})}
|
10
|
-
|
7
|
+
|
8
|
+
# its(:type) { should eql (:pages) }
|
9
|
+
# its(:params) { should eql ({:limit => 10, :hourly => 1})}
|
10
|
+
|
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
|
-
|
14
|
+
|
15
|
+
expect(params).to eq({
|
16
|
+
:site_id => Getclicky.site_id,
|
17
|
+
:sitekey => Getclicky.sitekey,
|
18
|
+
:type => "pages",
|
19
|
+
:limit => 10,
|
20
|
+
:hourly => 1,
|
21
|
+
:output => :json
|
22
|
+
})
|
15
23
|
end
|
16
|
-
|
24
|
+
|
17
25
|
it "should be leave hash parameters blank" do
|
18
26
|
params = subject.build_params(:pages)
|
19
|
-
|
27
|
+
|
28
|
+
expect(params).to eq({
|
29
|
+
:site_id => Getclicky.site_id,
|
30
|
+
:sitekey => Getclicky.sitekey,
|
31
|
+
:type => "pages",
|
32
|
+
:output => :json
|
33
|
+
})
|
20
34
|
end
|
21
|
-
|
35
|
+
|
22
36
|
it "should default to an output format of json" do
|
23
37
|
params = subject.build_params(:pages)
|
24
|
-
|
38
|
+
|
39
|
+
expect(params).to eq({
|
40
|
+
:site_id => Getclicky.site_id,
|
41
|
+
:sitekey => Getclicky.sitekey,
|
42
|
+
:type => "pages",
|
43
|
+
:output => :json
|
44
|
+
})
|
25
45
|
end
|
26
|
-
|
46
|
+
|
27
47
|
it "should allow overriding the output format" do
|
28
48
|
params = subject.build_params(:pages, :output => :xml)
|
29
|
-
|
49
|
+
|
50
|
+
expect(params).to eq({
|
51
|
+
:site_id => Getclicky.site_id,
|
52
|
+
:sitekey => Getclicky.sitekey,
|
53
|
+
:type => "pages",
|
54
|
+
:output => :xml
|
55
|
+
})
|
30
56
|
end
|
31
|
-
|
57
|
+
|
32
58
|
it "should be able to set type with underscore" do
|
33
59
|
params = subject.build_params(:bounce_rate)
|
34
|
-
|
60
|
+
|
61
|
+
expect(params).to eq({
|
62
|
+
:site_id => Getclicky.site_id,
|
63
|
+
:sitekey => Getclicky.sitekey,
|
64
|
+
:type => "bounce-rate",
|
65
|
+
:output => :json
|
66
|
+
})
|
35
67
|
end
|
36
68
|
end
|
37
|
-
|
69
|
+
|
38
70
|
describe "request" do
|
39
71
|
before do
|
40
72
|
ENV["GETCLICKY_ENDPOINT"] = "http://example.com"
|
41
73
|
FakeWeb.register_uri :any, "http://example.com", :status => 200
|
42
74
|
end
|
43
75
|
end
|
44
|
-
end
|
76
|
+
end
|
@@ -1,36 +1,59 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Getclicky::Response do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
"
|
10
|
-
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
context "when initialized with an Array" do
|
5
|
+
subject {
|
6
|
+
Getclicky::Response.new([{
|
7
|
+
"type"=>"pages",
|
8
|
+
"dates"=>
|
9
|
+
[{"date"=>"2011-09-27",
|
10
|
+
"items"=>
|
11
|
+
[{"value"=>"6",
|
12
|
+
"value_percent"=>"66.7",
|
13
|
+
"title"=>"Test Page",
|
14
|
+
"stats_url"=>"http://getclicky.com/stats/visitors",
|
15
|
+
"url"=>"http://blackbookemg.dev/posts"},
|
16
|
+
{"value"=>"1",
|
17
|
+
"value_percent"=>"11.1",
|
18
|
+
"title"=>"Test Page 2",
|
19
|
+
"stats_url"=>
|
20
|
+
"http://getclicky.com/stats/visitors",
|
21
|
+
"url"=>"http://blackbookemg.dev/requests/1"}
|
22
|
+
]}
|
23
|
+
]
|
24
|
+
}])
|
25
|
+
}
|
26
|
+
|
27
|
+
# its(:item) { should be_an_instance_of Array }
|
28
|
+
# its(:data) { should be_an_instance_of Array }
|
29
|
+
|
30
|
+
it "should return an array of Hashie objects" do
|
31
|
+
subject.data.each do |d|
|
32
|
+
expect(d).to be_an_instance_of Hashie::Mash
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context "when initialized with a String" do
|
38
|
+
subject {
|
39
|
+
Getclicky::Response.new("[{\"type\":\"pages\",
|
40
|
+
\"dates\":[
|
41
|
+
{\"date\":\"2011-09-27\",
|
42
|
+
\"items\":[
|
43
|
+
{\"value\":\"6\",\"value_percent\":\"66.7\",\"title\":\"Test Page\",\"stats_url\":\"http://getclicky.com/stats/visitors\",\"url\":\"http://blackbookemg.dev/posts\"},
|
44
|
+
{\"value\":\"1\",\"value_percent\":\"11.1\",\"title\":\"Test Page 2\",\"stats_url\":\"http://getclicky.com/stats/visitors\",\"url\":\"http://blackbookemg.dev/requests/1\"}
|
45
|
+
]}
|
21
46
|
]}
|
22
|
-
]
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
context "when using" do
|
47
|
+
]")
|
48
|
+
}
|
49
|
+
|
50
|
+
# its(:item) { should be_an_instance_of String }
|
51
|
+
# its(:data) { should be_an_instance_of Array }
|
52
|
+
|
30
53
|
it "should return an array of Hashie objects" do
|
31
54
|
subject.data.each do |d|
|
32
|
-
d.
|
55
|
+
expect(d).to be_an_instance_of Hashie::Mash
|
33
56
|
end
|
34
57
|
end
|
35
58
|
end
|
36
|
-
end
|
59
|
+
end
|
data/spec/getclicky_spec.rb
CHANGED
@@ -4,29 +4,29 @@ describe Getclicky do
|
|
4
4
|
describe "configure" do
|
5
5
|
it "should be set site_id" do
|
6
6
|
Getclicky.configure { |c| c.site_id = "123" }
|
7
|
-
Getclicky.site_id.
|
7
|
+
expect(Getclicky.site_id).to eq("123")
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it "should be set site_key" do
|
11
11
|
Getclicky.configure { |c| c.sitekey = "123" }
|
12
|
-
Getclicky.sitekey.
|
12
|
+
expect(Getclicky.sitekey).to eq("123")
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should be set admin_sitekey" do
|
16
16
|
Getclicky.configure { |c| c.admin_sitekey = "123" }
|
17
|
-
Getclicky.admin_sitekey.
|
17
|
+
expect(Getclicky.admin_sitekey).to eq("123")
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
describe "endpoint" do
|
22
22
|
it "should be returns the real url" do
|
23
23
|
ENV.delete("GETCLICKY_ENDPOINT")
|
24
|
-
Getclicky.endpoint.
|
24
|
+
expect(Getclicky.endpoint).to eq("http://api.clicky.com/api/stats/4")
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
it "should be changes the url" do
|
28
|
-
ENV["GETCLICKY_ENDPOINT"] = "http://api.
|
29
|
-
Getclicky.endpoint.
|
28
|
+
ENV["GETCLICKY_ENDPOINT"] = "http://api.clicky.com/api/stats/4"
|
29
|
+
expect(Getclicky.endpoint).to eq("http://api.clicky.com/api/stats/4")
|
30
30
|
end
|
31
31
|
end
|
32
|
-
end
|
32
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
require "
|
2
|
-
|
3
|
-
Bundler.require(:default, :development)
|
1
|
+
require "coveralls"
|
2
|
+
Coveralls.wear!
|
4
3
|
|
5
4
|
require "getclicky"
|
6
5
|
require "rspec"
|
7
|
-
require "
|
6
|
+
require "fakeweb"
|
8
7
|
|
9
8
|
FakeWeb.allow_net_connect = false
|
10
9
|
|
@@ -12,14 +11,14 @@ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|file| require file}
|
|
12
11
|
|
13
12
|
RSpec.configure do |config|
|
14
13
|
config.include Helpers
|
15
|
-
|
14
|
+
|
16
15
|
config.before do
|
17
16
|
ENV.delete("GETCLICKY_ENDPOINT")
|
18
17
|
end
|
19
|
-
|
18
|
+
|
20
19
|
Getclicky.configure do |config|
|
21
20
|
config.site_id = nil
|
22
21
|
config.sitekey = nil
|
23
22
|
config.admin_sitekey = nil
|
24
23
|
end
|
25
|
-
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,79 +1,66 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getclicky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Peterson Ferreira
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: hashie
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 3.3.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.3.1
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rspec
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- - ~>
|
31
|
+
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
+
version: 3.0.0
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: test_notifier
|
38
|
-
requirement: &70288102270360 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - ~>
|
38
|
+
- - "~>"
|
42
39
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70288102270360
|
40
|
+
version: 3.0.0
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: fakeweb
|
49
|
-
requirement:
|
50
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
51
44
|
requirements:
|
52
|
-
- - ~>
|
45
|
+
- - "~>"
|
53
46
|
- !ruby/object:Gem::Version
|
54
47
|
version: 1.3.0
|
55
48
|
type: :development
|
56
49
|
prerelease: false
|
57
|
-
version_requirements:
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: ruby-debug19
|
60
|
-
requirement: &70288102269320 !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
51
|
requirements:
|
63
|
-
- - ~>
|
52
|
+
- - "~>"
|
64
53
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
66
|
-
|
67
|
-
prerelease: false
|
68
|
-
version_requirements: *70288102269320
|
69
|
-
description: Ruby Wrapper for GetClicky API Analytics
|
54
|
+
version: 1.3.0
|
55
|
+
description: Ruby Wrapper for Clicky Analytics API
|
70
56
|
email:
|
71
57
|
- petersonferreiras@gmail.com
|
72
58
|
executables: []
|
73
59
|
extensions: []
|
74
60
|
extra_rdoc_files: []
|
75
61
|
files:
|
76
|
-
- .gitignore
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
77
64
|
- Gemfile
|
78
65
|
- LICENSE
|
79
66
|
- README.md
|
@@ -81,42 +68,44 @@ files:
|
|
81
68
|
- getclicky.gemspec
|
82
69
|
- lib/getclicky.rb
|
83
70
|
- lib/getclicky/client.rb
|
71
|
+
- lib/getclicky/encode.rb
|
84
72
|
- lib/getclicky/request.rb
|
85
73
|
- lib/getclicky/response.rb
|
86
74
|
- lib/getclicky/types.rb
|
87
75
|
- lib/getclicky/version.rb
|
88
76
|
- spec/getclicky/client_spec.rb
|
77
|
+
- spec/getclicky/encode_spec.rb
|
89
78
|
- spec/getclicky/request_spec.rb
|
90
79
|
- spec/getclicky/response_spec.rb
|
91
80
|
- spec/getclicky_spec.rb
|
92
81
|
- spec/spec_helper.rb
|
93
82
|
- spec/support/helpers.rb
|
94
|
-
homepage: http://github.com/
|
83
|
+
homepage: http://github.com/petersonfs/getclicky
|
95
84
|
licenses: []
|
85
|
+
metadata: {}
|
96
86
|
post_install_message:
|
97
87
|
rdoc_options: []
|
98
88
|
require_paths:
|
99
89
|
- lib
|
100
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
91
|
requirements:
|
103
|
-
- -
|
92
|
+
- - ">="
|
104
93
|
- !ruby/object:Gem::Version
|
105
94
|
version: '0'
|
106
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
96
|
requirements:
|
109
|
-
- -
|
97
|
+
- - ">="
|
110
98
|
- !ruby/object:Gem::Version
|
111
99
|
version: '0'
|
112
100
|
requirements: []
|
113
101
|
rubyforge_project:
|
114
|
-
rubygems_version:
|
102
|
+
rubygems_version: 2.4.1
|
115
103
|
signing_key:
|
116
|
-
specification_version:
|
117
|
-
summary: Ruby Wrapper for
|
104
|
+
specification_version: 4
|
105
|
+
summary: Ruby Wrapper for Clicky Analytics API
|
118
106
|
test_files:
|
119
107
|
- spec/getclicky/client_spec.rb
|
108
|
+
- spec/getclicky/encode_spec.rb
|
120
109
|
- spec/getclicky/request_spec.rb
|
121
110
|
- spec/getclicky/response_spec.rb
|
122
111
|
- spec/getclicky_spec.rb
|