sqoot 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Guardfile +11 -0
- data/LICENSE +22 -0
- data/README.md +71 -0
- data/Rakefile +7 -0
- data/lib/sqoot.rb +23 -0
- data/lib/sqoot/category.rb +11 -0
- data/lib/sqoot/click.rb +14 -0
- data/lib/sqoot/client.rb +58 -0
- data/lib/sqoot/commission.rb +15 -0
- data/lib/sqoot/offer.rb +16 -0
- data/lib/sqoot/provider.rb +11 -0
- data/lib/sqoot/request.rb +36 -0
- data/lib/sqoot/response/parse_gzip.rb +27 -0
- data/lib/sqoot/version.rb +3 -0
- data/spec/cassettes/Sqoot_Category/should_return_an_array_of_categories.yml +79 -0
- data/spec/cassettes/Sqoot_Category/should_return_mash_list_of_categories_without_passing_any_parameters.yml +80 -0
- data/spec/cassettes/Sqoot_Click/should_return_an_array_of_clicks.yml +61 -0
- data/spec/cassettes/Sqoot_Click/should_return_mash_list_of_clicks_without_passing_any_parameters.yml +61 -0
- data/spec/cassettes/Sqoot_Commission/should_return_an_array_of_commissions.yml +51 -0
- data/spec/cassettes/Sqoot_Commission/should_return_mash_list_of_commissions_without_passing_any_parameters.yml +51 -0
- data/spec/cassettes/Sqoot_Offer/should_return_a_list_of_offers_given_a_location_parameter.yml +75 -0
- data/spec/cassettes/Sqoot_Offer/should_return_an_array_of_offers.yml +141 -0
- data/spec/cassettes/Sqoot_Offer/should_return_mash_list_of_offers_without_passing_any_parameters.yml +142 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/sqoot/category_spec.rb +15 -0
- data/spec/sqoot/click_spec.rb +15 -0
- data/spec/sqoot/client_spec.rb +12 -0
- data/spec/sqoot/commission_spec.rb +15 -0
- data/spec/sqoot/offer_spec.rb +21 -0
- data/spec/sqoot/provider_spec.rb +15 -0
- data/spec/sqoot_spec.rb +20 -0
- data/sqoot.gemspec +33 -0
- metadata +254 -0
data/spec/cassettes/Sqoot_Offer/should_return_mash_list_of_offers_without_passing_any_parameters.yml
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: AFFILIATE_TOKEN
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
authorization: AUTHENTICATION_TOKEN
|
9
|
+
accept:
|
10
|
+
- ! '*/*'
|
11
|
+
accept-encoding:
|
12
|
+
- gzip
|
13
|
+
user-agent:
|
14
|
+
- Ruby gem
|
15
|
+
connection:
|
16
|
+
- close
|
17
|
+
response:
|
18
|
+
status:
|
19
|
+
code: 200
|
20
|
+
message: OK
|
21
|
+
headers:
|
22
|
+
server:
|
23
|
+
- nginx
|
24
|
+
date:
|
25
|
+
- Fri, 24 Feb 2012 15:06:03 GMT
|
26
|
+
content-type:
|
27
|
+
- text/javascript; charset=utf-8
|
28
|
+
transfer-encoding:
|
29
|
+
- chunked
|
30
|
+
connection:
|
31
|
+
- close
|
32
|
+
etag:
|
33
|
+
- ! '"393630d47f82768e987f54c1bb404aa6"'
|
34
|
+
cache-control:
|
35
|
+
- max-age=0, private, must-revalidate
|
36
|
+
x-ua-compatible:
|
37
|
+
- IE=Edge,chrome=1
|
38
|
+
set-cookie:
|
39
|
+
- _sqoot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlYjg5M2EyZjY3OTg5N2JhZWViZjdmNzQ0NWQyOTQ3ZWFJIg1sb2NhdGlvbgY7AEZvOg1Mb2NhdGlvbg06EEBhdHRyaWJ1dGVzexRJIhFwaG9uZV9udW1iZXIGOwBUMEkiCHVybAY7AFQwSSIVc3RyZWV0X2FkZHJlc3NfMQY7AFQwSSIVc3RyZWV0X2FkZHJlc3NfMgY7AFQwSSIJY2l0eQY7AFRJIgtNYW5pbGEGOwBUSSIIemlwBjsAVDBJIgpzdGF0ZQY7AFRJIgdEOQY7AFRJIgxjb3VudHJ5BjsAVEkiB1BIBjsAVEkiEW5laWdoYm9yaG9vZAY7AFQwSSINbGF0aXR1ZGUGOwBUZhoxNC42MDQyMDAwMDAwMDAwMDEAfIVJIg5sb25naXR1ZGUGOwBUZg8xMjAuOTgyACsCSSIPY3JlYXRlZF9hdAY7AFQwSSIPdXBkYXRlZF9hdAY7AFQwSSINb2ZmZXJfaWQGOwBUMEkiD2ZhY3R1YWxfaWQGOwBUMDoWQGF0dHJpYnV0ZXNfY2FjaGV7ADoPQHBlcnNpc3RlZEY6DkByZWFkb25seUY6D0BkZXN0cm95ZWRGOhxAbWFya2VkX2Zvcl9kZXN0cnVjdGlvbkY6GEBwcmV2aW91c2x5X2NoYW5nZWR7ADoYQGNoYW5nZWRfYXR0cmlidXRlc3sKSSINbGF0aXR1ZGUGOwBGMEkiDmxvbmdpdHVkZQY7AEYwSSIJY2l0eQY7AEYwSSIKc3RhdGUGOwBGMEkiDGNvdW50cnkGOwBGMEkiHmdlb2NvZGVkX2lwX2Zvcl9sb2NhdGlvbj8GOwBGVA%3D%3D--925603ab828eb1a521b55719a24d3bf12895c481;
|
40
|
+
domain=.sqoot.com; path=/; HttpOnly
|
41
|
+
x-runtime:
|
42
|
+
- '0.886131'
|
43
|
+
x-varnish:
|
44
|
+
- '1804554804'
|
45
|
+
age:
|
46
|
+
- '0'
|
47
|
+
via:
|
48
|
+
- 1.1 varnish
|
49
|
+
content-encoding:
|
50
|
+
- gzip
|
51
|
+
body: !binary |-
|
52
|
+
H4sIAAAAAAAAA5RW224bNxB971dMjRSxAVmR5EtiJwjgOgkatL6g8VsNCBR3
|
53
|
+
VmLMJTckV7KQn+8ZUjenSdEKtlbkDudy5szZ/foT0V7ySdm9czoZHPVk3aop
|
54
|
+
YzksCw7j1Ua56+uaQ8TyL6yIvubv9T621xvYMhXWL09PX5686m13k0lW3O0N
|
55
|
+
h3RrWDNdclCN0XTp/cNCBaZPnIgWJs3oHVsz57Dc23EQZz6k8cbN6dEvhOCk
|
56
|
+
0sbR7ybpGTt6HyO7ZJSNu+crjjqYNh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S99vyZ12y+8mNBTYYZG1Qa+Pc6
|
135
|
+
nxNJo/9fdRhP3WSehQnC76IIA8WnANOlXx5MbNmBE85lbeqGr0k0Obt45Pzi
|
136
|
+
5Nbz9pxftHaq0KflInTjuL5zbPFwqLAeW9iTzD+nFrvPZeuhxYb9Ktj1yaPZ
|
137
|
+
NahyqySoO2VQr3lWb5x57YNlUB6gK5BBxczheqGYOVwGFTMVyKDGTkVuVSCD
|
138
|
+
2mQdLoPafB0uEtqUHS6DFlmrQAYtMleBDFpkrwIZlLYqlUFlcXuya/z98eT3
|
139
|
+
HwAAAP//AwAg0w+tVC0AAA==
|
140
|
+
http_version: '1.1'
|
141
|
+
recorded_at: Fri, 24 Feb 2012 15:06:03 GMT
|
142
|
+
recorded_with: VCR 2.0.0.rc1
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require "sqoot"
|
2
|
+
require "vcr"
|
3
|
+
require "simplecov"
|
4
|
+
require "simplecov-rcov"
|
5
|
+
|
6
|
+
class SimpleCov::Formatter::MergedFormatter
|
7
|
+
def format(result)
|
8
|
+
SimpleCov::Formatter::HTMLFormatter.new.format(result)
|
9
|
+
SimpleCov::Formatter::RcovFormatter.new.format(result)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
|
14
|
+
SimpleCov.start do
|
15
|
+
add_filter '/vendor'
|
16
|
+
end
|
17
|
+
|
18
|
+
VCR.configure do |c|
|
19
|
+
c.allow_http_connections_when_no_cassette = true
|
20
|
+
c.cassette_library_dir = 'spec/cassettes'
|
21
|
+
c.hook_into :fakeweb
|
22
|
+
c.configure_rspec_metadata!
|
23
|
+
c.default_cassette_options = { :record => :new_episodes }
|
24
|
+
c.filter_sensitive_data('AFFILIATE_TOKEN') do |interaction|
|
25
|
+
interaction.request.uri = '?affiliate_token='
|
26
|
+
end
|
27
|
+
c.filter_sensitive_data('AUTHENTICATION_TOKEN') do |interaction|
|
28
|
+
interaction.request.headers['authorization'] = 'blah'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
RSpec.configure do |c|
|
33
|
+
c.extend VCR::RSpec::Macros
|
34
|
+
c.treat_symbols_as_metadata_keys_with_true_values = true
|
35
|
+
|
36
|
+
c.before(:each) do
|
37
|
+
Sqoot.configure do |config|
|
38
|
+
config.affiliate_token = "YOUR AFFILIATE TOKEN"
|
39
|
+
config.authentication_token = "YOUR AUTHENTICATION TOKEN"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Category do
|
5
|
+
let(:client) { Sqoot::Client.new }
|
6
|
+
|
7
|
+
it "should return mash list of categories without passing any parameters", :vcr do
|
8
|
+
client.categories.equal? Hashie::Mash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return an array of categories", :vcr do
|
12
|
+
client.categories.categories.equal? Array
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Click do
|
5
|
+
let(:client) { Sqoot::Client.new }
|
6
|
+
|
7
|
+
it "should return mash list of clicks without passing any parameters", :vcr do
|
8
|
+
client.clicks.equal? Hashie::Mash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return an array of clicks", :vcr do
|
12
|
+
client.clicks.categories.equal? Array
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Client do
|
5
|
+
|
6
|
+
it "should return Faraday::Connection" do
|
7
|
+
params = {}
|
8
|
+
client_with_faraday_connection = Sqoot::Client.new
|
9
|
+
client_with_faraday_connection.connection.equal? Faraday::Connection
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Commission do
|
5
|
+
let(:client) { Sqoot::Client.new }
|
6
|
+
|
7
|
+
it "should return mash list of commissions without passing any parameters", :vcr do
|
8
|
+
client.commissions.equal? Hashie::Mash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return an array of commissions", :vcr do
|
12
|
+
client.commissions.categories.equal? Array
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Offer do
|
5
|
+
let(:client) { Sqoot::Client.new }
|
6
|
+
|
7
|
+
it "should return mash list of offers without passing any parameters", :vcr do
|
8
|
+
client.offers.equal? Hashie::Mash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return an array of offers", :vcr do
|
12
|
+
client.offers.offers.equal? Array
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return a list of offers given a location parameter", :vcr do
|
16
|
+
offers_on_location = client.offers(:location => '12345')
|
17
|
+
offers_on_location.equal? Hashie::Mash
|
18
|
+
offers_on_location.offers.equal? Array
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot::Provider do
|
5
|
+
let(:client) { Sqoot::Client.new }
|
6
|
+
|
7
|
+
it "should return a mash list of providers" do
|
8
|
+
client.providers.equal? Hashie::Mash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return an array of providers" do
|
12
|
+
client.providers.providers.equal? Array
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/spec/sqoot_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Sqoot do
|
5
|
+
|
6
|
+
let(:client) { Sqoot::Client.new }
|
7
|
+
|
8
|
+
it "should configure with affiliate_token or authentication_token" do
|
9
|
+
client.affiliate_token == 'affiliate_token'
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should configure with authentication_token" do
|
13
|
+
client.authentication_token == 'authentication_token'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should use HTTP API endpoint" do
|
17
|
+
client.api_url.should == "http://api.sqoot.com"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/sqoot.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/sqoot/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Julius F", "Wynn Netherland"]
|
6
|
+
gem.email = ["baldrailers@gmail.com", "wynn.netherland@gmail.com"]
|
7
|
+
gem.description = %q{Wrapper for Sqoot API. Using FaradayMiddleware}
|
8
|
+
gem.summary = %q{Wrapper for Sqoot API}
|
9
|
+
gem.homepage = "https://github.com/causemetric/sqoot"
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "sqoot"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Sqoot::VERSION
|
17
|
+
|
18
|
+
gem.add_runtime_dependency "faraday", "~> 0.7.5"
|
19
|
+
gem.add_runtime_dependency "faraday_middleware", "~> 0.8.4"
|
20
|
+
gem.add_runtime_dependency "hashie", "~> 1.2.0"
|
21
|
+
gem.add_runtime_dependency "multi_json", "~> 1.0.4"
|
22
|
+
|
23
|
+
gem.add_development_dependency "rspec", "~> 2.8.0"
|
24
|
+
gem.add_development_dependency "guard-rspec", "~> 0.6.0"
|
25
|
+
gem.add_development_dependency "fakeweb", "~> 1.3.0"
|
26
|
+
gem.add_development_dependency "jnunemaker-matchy", "~> 0.4.0"
|
27
|
+
gem.add_development_dependency "json_pure", "~> 1.6.5"
|
28
|
+
gem.add_development_dependency "rake", "~> 0.9.2.2"
|
29
|
+
gem.add_development_dependency "shoulda", "~> 2.11.3"
|
30
|
+
gem.add_development_dependency "vcr", "~> 2.0.0.rc1"
|
31
|
+
gem.add_development_dependency "simplecov", "~> 0.5.4"
|
32
|
+
gem.add_development_dependency "simplecov-rcov", "~> 0.2.3"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,254 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sqoot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Julius F
|
9
|
+
- Wynn Netherland
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-03-21 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: faraday
|
17
|
+
requirement: &70256631967720 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.7.5
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70256631967720
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: faraday_middleware
|
28
|
+
requirement: &70256631967000 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70256631967000
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: hashie
|
39
|
+
requirement: &70256631966280 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.2.0
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70256631966280
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: multi_json
|
50
|
+
requirement: &70256631965620 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.0.4
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70256631965620
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rspec
|
61
|
+
requirement: &70256631964940 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 2.8.0
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70256631964940
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: guard-rspec
|
72
|
+
requirement: &70256631964220 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.6.0
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70256631964220
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: fakeweb
|
83
|
+
requirement: &70256631963500 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.3.0
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70256631963500
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: jnunemaker-matchy
|
94
|
+
requirement: &70256631963040 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.4.0
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *70256631963040
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: json_pure
|
105
|
+
requirement: &70256631962580 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.6.5
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *70256631962580
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: rake
|
116
|
+
requirement: &70256631962120 !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ~>
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: 0.9.2.2
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: *70256631962120
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: shoulda
|
127
|
+
requirement: &70256631991580 !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.11.3
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: *70256631991580
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
name: vcr
|
138
|
+
requirement: &70256631991020 !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ~>
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: 2.0.0.rc1
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: *70256631991020
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: simplecov
|
149
|
+
requirement: &70256631990480 !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ~>
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 0.5.4
|
155
|
+
type: :development
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: *70256631990480
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: simplecov-rcov
|
160
|
+
requirement: &70256631989780 !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ~>
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.2.3
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: *70256631989780
|
169
|
+
description: Wrapper for Sqoot API. Using FaradayMiddleware
|
170
|
+
email:
|
171
|
+
- baldrailers@gmail.com
|
172
|
+
- wynn.netherland@gmail.com
|
173
|
+
executables: []
|
174
|
+
extensions: []
|
175
|
+
extra_rdoc_files: []
|
176
|
+
files:
|
177
|
+
- .gitignore
|
178
|
+
- .rspec
|
179
|
+
- .rvmrc
|
180
|
+
- Gemfile
|
181
|
+
- Guardfile
|
182
|
+
- LICENSE
|
183
|
+
- README.md
|
184
|
+
- Rakefile
|
185
|
+
- lib/sqoot.rb
|
186
|
+
- lib/sqoot/category.rb
|
187
|
+
- lib/sqoot/click.rb
|
188
|
+
- lib/sqoot/client.rb
|
189
|
+
- lib/sqoot/commission.rb
|
190
|
+
- lib/sqoot/offer.rb
|
191
|
+
- lib/sqoot/provider.rb
|
192
|
+
- lib/sqoot/request.rb
|
193
|
+
- lib/sqoot/response/parse_gzip.rb
|
194
|
+
- lib/sqoot/version.rb
|
195
|
+
- spec/cassettes/Sqoot_Category/should_return_an_array_of_categories.yml
|
196
|
+
- spec/cassettes/Sqoot_Category/should_return_mash_list_of_categories_without_passing_any_parameters.yml
|
197
|
+
- spec/cassettes/Sqoot_Click/should_return_an_array_of_clicks.yml
|
198
|
+
- spec/cassettes/Sqoot_Click/should_return_mash_list_of_clicks_without_passing_any_parameters.yml
|
199
|
+
- spec/cassettes/Sqoot_Commission/should_return_an_array_of_commissions.yml
|
200
|
+
- spec/cassettes/Sqoot_Commission/should_return_mash_list_of_commissions_without_passing_any_parameters.yml
|
201
|
+
- spec/cassettes/Sqoot_Offer/should_return_a_list_of_offers_given_a_location_parameter.yml
|
202
|
+
- spec/cassettes/Sqoot_Offer/should_return_an_array_of_offers.yml
|
203
|
+
- spec/cassettes/Sqoot_Offer/should_return_mash_list_of_offers_without_passing_any_parameters.yml
|
204
|
+
- spec/spec_helper.rb
|
205
|
+
- spec/sqoot/category_spec.rb
|
206
|
+
- spec/sqoot/click_spec.rb
|
207
|
+
- spec/sqoot/client_spec.rb
|
208
|
+
- spec/sqoot/commission_spec.rb
|
209
|
+
- spec/sqoot/offer_spec.rb
|
210
|
+
- spec/sqoot/provider_spec.rb
|
211
|
+
- spec/sqoot_spec.rb
|
212
|
+
- sqoot.gemspec
|
213
|
+
homepage: https://github.com/causemetric/sqoot
|
214
|
+
licenses: []
|
215
|
+
post_install_message:
|
216
|
+
rdoc_options: []
|
217
|
+
require_paths:
|
218
|
+
- lib
|
219
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
220
|
+
none: false
|
221
|
+
requirements:
|
222
|
+
- - ! '>='
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: '0'
|
225
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
226
|
+
none: false
|
227
|
+
requirements:
|
228
|
+
- - ! '>='
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
requirements: []
|
232
|
+
rubyforge_project:
|
233
|
+
rubygems_version: 1.8.10
|
234
|
+
signing_key:
|
235
|
+
specification_version: 3
|
236
|
+
summary: Wrapper for Sqoot API
|
237
|
+
test_files:
|
238
|
+
- spec/cassettes/Sqoot_Category/should_return_an_array_of_categories.yml
|
239
|
+
- spec/cassettes/Sqoot_Category/should_return_mash_list_of_categories_without_passing_any_parameters.yml
|
240
|
+
- spec/cassettes/Sqoot_Click/should_return_an_array_of_clicks.yml
|
241
|
+
- spec/cassettes/Sqoot_Click/should_return_mash_list_of_clicks_without_passing_any_parameters.yml
|
242
|
+
- spec/cassettes/Sqoot_Commission/should_return_an_array_of_commissions.yml
|
243
|
+
- spec/cassettes/Sqoot_Commission/should_return_mash_list_of_commissions_without_passing_any_parameters.yml
|
244
|
+
- spec/cassettes/Sqoot_Offer/should_return_a_list_of_offers_given_a_location_parameter.yml
|
245
|
+
- spec/cassettes/Sqoot_Offer/should_return_an_array_of_offers.yml
|
246
|
+
- spec/cassettes/Sqoot_Offer/should_return_mash_list_of_offers_without_passing_any_parameters.yml
|
247
|
+
- spec/spec_helper.rb
|
248
|
+
- spec/sqoot/category_spec.rb
|
249
|
+
- spec/sqoot/click_spec.rb
|
250
|
+
- spec/sqoot/client_spec.rb
|
251
|
+
- spec/sqoot/commission_spec.rb
|
252
|
+
- spec/sqoot/offer_spec.rb
|
253
|
+
- spec/sqoot/provider_spec.rb
|
254
|
+
- spec/sqoot_spec.rb
|