hitfox_coupon_api 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +18 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +75 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/hitfox_coupon_api.gemspec +88 -0
- data/lib/hitfox_coupon_api/application.rb +13 -0
- data/lib/hitfox_coupon_api/configuration.rb +13 -0
- data/lib/hitfox_coupon_api/coupon.rb +30 -0
- data/lib/hitfox_coupon_api.rb +23 -0
- data/test/.login.yml.sample +5 -0
- data/test/helper.rb +22 -0
- data/test/test_hitfox_coupon_api.rb +61 -0
- data/test_shell +49 -0
- metadata +254 -0
data/.document
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use --create ree-1.8.7-2011.03@hfcapi
|
data/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
source "http://rubygems.org"
|
3
|
+
|
4
|
+
gem 'rest-client'
|
5
|
+
gem 'json'
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem 'rake', "= 0.8.7"
|
9
|
+
gem 'pry'
|
10
|
+
gem 'pry-doc'
|
11
|
+
gem 'gist'
|
12
|
+
gem "thoughtbot-shoulda", ">= 0"
|
13
|
+
gem "bundler", "~> 1.0.0"
|
14
|
+
gem "jeweler", "~> 1.6.4"
|
15
|
+
gem "rcov", ">= 0"
|
16
|
+
gem 'rr'
|
17
|
+
gem "cheat"
|
18
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Gerrit Riessen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
= hitfox_coupon_api
|
2
|
+
|
3
|
+
Simple interface to the HitFox.com coupon API. Audience of this gem are publisher who have
|
4
|
+
integrated HitFox and wish to interface with HitFox to obtain and send information to deal
|
5
|
+
coupons being sold.
|
6
|
+
|
7
|
+
== Installation
|
8
|
+
|
9
|
+
Installation is either
|
10
|
+
|
11
|
+
gem install hitfox_coupon_api
|
12
|
+
|
13
|
+
Or if using bundler, in the Gemfile
|
14
|
+
|
15
|
+
gem 'hitfox_coupon_api'
|
16
|
+
|
17
|
+
The latest version can be used via github but including git option in the Gemfile:
|
18
|
+
|
19
|
+
gem 'hitfox_coupon_api', :git => 'git://github.com/gorenje/hitfox_coupon_api.git'
|
20
|
+
|
21
|
+
|
22
|
+
== Configuration
|
23
|
+
|
24
|
+
To configure the gem, you'll need API authentication details from HitFox. Once you have
|
25
|
+
these, then configuration is a matter of doing:
|
26
|
+
|
27
|
+
HitfoxCouponApi.configure do |config|
|
28
|
+
config.api_token = 'your api token'
|
29
|
+
config.api_secret = 'your api secret'
|
30
|
+
config.api_version = 'the api version as provided by HitFox.com'
|
31
|
+
config.api_endpoint = 'the api endpoint as provided by HitFox.com'
|
32
|
+
end
|
33
|
+
|
34
|
+
If using Rails, then this is best done in a config/initializer and perhaps storing the
|
35
|
+
configuration data in a separate yaml file.
|
36
|
+
|
37
|
+
== Usage
|
38
|
+
|
39
|
+
At the moment, this gem can do one thing but that really well: provide feedback to HitFox
|
40
|
+
when a coupon has been used.
|
41
|
+
|
42
|
+
This is done by providing the application id (also generated by HitFox) and the coupon id
|
43
|
+
that goes from you:
|
44
|
+
|
45
|
+
HitfoxCouponApi.application('app id from hitfox').coupon('coupon code').used
|
46
|
+
|
47
|
+
that's it. But you can also keep the application object around and use it for subsequent
|
48
|
+
calls:
|
49
|
+
|
50
|
+
# best done in Rails in an initializer
|
51
|
+
MyGlobalApplication = HitfoxCouponApi.application('app id from hitfox')
|
52
|
+
|
53
|
+
... some time later ...
|
54
|
+
|
55
|
+
MyGlobalApplication.coupon("fubar").used
|
56
|
+
MyGlobalApplication.coupon("snafu also").used
|
57
|
+
|
58
|
+
Other than that, there is not much else to see here! More features will appear as we develop
|
59
|
+
them.
|
60
|
+
|
61
|
+
== Contributing to hitfox_coupon_api
|
62
|
+
|
63
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
64
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
65
|
+
* Fork the project
|
66
|
+
* Start a feature/bugfix branch
|
67
|
+
* Commit and push until you are happy with your contribution
|
68
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
69
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
70
|
+
|
71
|
+
== Copyright
|
72
|
+
|
73
|
+
Copyright (c) 2011 Gerrit Riessen. See LICENSE.txt for
|
74
|
+
further details.
|
75
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "hitfox_coupon_api"
|
18
|
+
gem.homepage = "https://github.com/gorenje/hitfox_coupon_api"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Simple JSON interface to the HitFox coupon API}
|
21
|
+
gem.description = %Q{Simple JSON interface to the HitFox coupon API}
|
22
|
+
gem.email = "gerrit.riessen@gmail.com"
|
23
|
+
gem.authors = ["Gerrit Riessen"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/test_*.rb'
|
39
|
+
test.verbose = true
|
40
|
+
test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "hitfox_coupon_api #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "hitfox_coupon_api"
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Gerrit Riessen"]
|
12
|
+
s.date = "2011-09-01"
|
13
|
+
s.description = "Simple JSON interface to the HitFox coupon API"
|
14
|
+
s.email = "gerrit.riessen@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"hitfox_coupon_api.gemspec",
|
28
|
+
"lib/hitfox_coupon_api.rb",
|
29
|
+
"lib/hitfox_coupon_api/application.rb",
|
30
|
+
"lib/hitfox_coupon_api/configuration.rb",
|
31
|
+
"lib/hitfox_coupon_api/coupon.rb",
|
32
|
+
"test/.login.yml.sample",
|
33
|
+
"test/helper.rb",
|
34
|
+
"test/test_hitfox_coupon_api.rb",
|
35
|
+
"test_shell"
|
36
|
+
]
|
37
|
+
s.homepage = "https://github.com/gorenje/hitfox_coupon_api"
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = "1.8.10"
|
41
|
+
s.summary = "Simple JSON interface to the HitFox coupon API"
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<rake>, ["= 0.8.7"])
|
50
|
+
s.add_development_dependency(%q<pry>, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<pry-doc>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<gist>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
56
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<rr>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<cheat>, [">= 0"])
|
59
|
+
else
|
60
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
61
|
+
s.add_dependency(%q<json>, [">= 0"])
|
62
|
+
s.add_dependency(%q<rake>, ["= 0.8.7"])
|
63
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
64
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
65
|
+
s.add_dependency(%q<gist>, [">= 0"])
|
66
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
67
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
68
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
69
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
70
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
71
|
+
s.add_dependency(%q<cheat>, [">= 0"])
|
72
|
+
end
|
73
|
+
else
|
74
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
75
|
+
s.add_dependency(%q<json>, [">= 0"])
|
76
|
+
s.add_dependency(%q<rake>, ["= 0.8.7"])
|
77
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
78
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
79
|
+
s.add_dependency(%q<gist>, [">= 0"])
|
80
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
81
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
82
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
83
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
84
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
85
|
+
s.add_dependency(%q<cheat>, [">= 0"])
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
require 'digest/sha1'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module HitfoxCouponApi
|
6
|
+
class Coupon
|
7
|
+
def initialize(product, code)
|
8
|
+
@application, @code = product, code
|
9
|
+
end
|
10
|
+
|
11
|
+
def used
|
12
|
+
config = HitfoxCouponApi.configuration
|
13
|
+
timestamp = config.generate_timestamp
|
14
|
+
headers = {
|
15
|
+
"X-API-TOKEN" => config.api_token,
|
16
|
+
"X-API-APP-ID" => @application.identifier,
|
17
|
+
"X-API-TIMESTAMP" => timestamp,
|
18
|
+
}
|
19
|
+
|
20
|
+
str = [ @code, config.api_token, timestamp, @application.identifier,
|
21
|
+
config.api_secret ].join(",")
|
22
|
+
|
23
|
+
path = "/%s/coupon/%s/used.json?hash=%s" % [CGI.escape(config.api_version.to_s),
|
24
|
+
CGI.escape(@code),
|
25
|
+
CGI.escape(Digest::SHA1.hexdigest(str))]
|
26
|
+
|
27
|
+
JSON.parse(RestClient.get("%s%s" % [config.api_endpoint, path], headers))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
|
3
|
+
require 'hitfox_coupon_api/configuration'
|
4
|
+
require 'hitfox_coupon_api/application'
|
5
|
+
require 'hitfox_coupon_api/coupon'
|
6
|
+
|
7
|
+
module HitfoxCouponApi
|
8
|
+
extend self
|
9
|
+
|
10
|
+
def configuration
|
11
|
+
@configuration ||= Configuration.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def configure
|
15
|
+
config = configuration
|
16
|
+
block_given? ? yield(config) : config
|
17
|
+
config
|
18
|
+
end
|
19
|
+
|
20
|
+
def application(identifier)
|
21
|
+
Application.new(identifier)
|
22
|
+
end
|
23
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'test/unit'
|
12
|
+
require 'shoulda'
|
13
|
+
require 'rr'
|
14
|
+
|
15
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
16
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
17
|
+
|
18
|
+
require 'hitfox_coupon_api'
|
19
|
+
|
20
|
+
class Test::Unit::TestCase
|
21
|
+
include RR::Adapters::TestUnit
|
22
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/helper'
|
2
|
+
|
3
|
+
class TestHitfoxCouponApi < Test::Unit::TestCase
|
4
|
+
context "coupon used" do
|
5
|
+
setup do
|
6
|
+
HitfoxCouponApi.configure do |c|
|
7
|
+
c.api_token = "1234"
|
8
|
+
c.api_secret = "2143abce"
|
9
|
+
c.api_version = "one"
|
10
|
+
c.api_endpoint = "http://banana.com"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
should "generate the correct hash value" do
|
15
|
+
url = ("http://banana.com/one/coupon/abcdedfg-1234-jakl/used.json?"+
|
16
|
+
"hash=97c68554af339f1017155b1c4eb4cf3d14039bea")
|
17
|
+
header = {
|
18
|
+
"X-API-APP-ID" => "productidentiefer",
|
19
|
+
"X-API-TIMESTAMP" => "1314792296",
|
20
|
+
"X-API-TOKEN" => "1234"
|
21
|
+
}
|
22
|
+
|
23
|
+
mock.instance_of(HitfoxCouponApi::Configuration).generate_timestamp { '1314792296' }
|
24
|
+
mock(RestClient).get(url,header) { '{ "status" : "banana" }'}
|
25
|
+
|
26
|
+
product = HitfoxCouponApi::Application.new("productidentiefer")
|
27
|
+
hsh = product.coupon("abcdedfg-1234-jakl").used
|
28
|
+
|
29
|
+
assert_equal "banana", hsh["status"]
|
30
|
+
end
|
31
|
+
|
32
|
+
should "provide a shortcut application instanciation method" do
|
33
|
+
url = ("http://banana.com/one/coupon/abcdedfg-1234-jakl/used.json?"+
|
34
|
+
"hash=97c68554af339f1017155b1c4eb4cf3d14039bea")
|
35
|
+
header = {
|
36
|
+
"X-API-APP-ID" => "productidentiefer",
|
37
|
+
"X-API-TIMESTAMP" => "1314792296",
|
38
|
+
"X-API-TOKEN" => "1234"
|
39
|
+
}
|
40
|
+
|
41
|
+
mock.instance_of(HitfoxCouponApi::Configuration).generate_timestamp { '1314792296' }
|
42
|
+
mock(RestClient).get(url,header) { '{ "status" : "banana" }' }
|
43
|
+
|
44
|
+
hsh = HitfoxCouponApi.application("productidentiefer").
|
45
|
+
coupon("abcdedfg-1234-jakl").used
|
46
|
+
|
47
|
+
assert_equal "banana", hsh["status"]
|
48
|
+
end
|
49
|
+
|
50
|
+
should "propagate exceptions" do
|
51
|
+
product = HitfoxCouponApi::Application.new("productidentiefer")
|
52
|
+
mock(RestClient).get.with_any_args do
|
53
|
+
raise RuntimeError, "no good"
|
54
|
+
end
|
55
|
+
|
56
|
+
assert_raise RuntimeError do
|
57
|
+
product.coupon("asdsad").used
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/test_shell
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# -*- ruby -*-
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'bundler'
|
7
|
+
begin
|
8
|
+
Bundler.setup(:default, :development)
|
9
|
+
rescue Bundler::BundlerError => e
|
10
|
+
$stderr.puts e.message
|
11
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
12
|
+
exit e.status_code
|
13
|
+
end
|
14
|
+
|
15
|
+
original_load_path = $LOAD_PATH
|
16
|
+
dirs = ['ext', 'lib'].select { |dir| File.directory?(dir) }
|
17
|
+
$LOAD_PATH.unshift(*dirs)
|
18
|
+
|
19
|
+
require 'pry'
|
20
|
+
require 'hitfox_coupon_api'
|
21
|
+
|
22
|
+
test_login_details = File.join(File.dirname(__FILE__), 'test', '.login.yml')
|
23
|
+
|
24
|
+
if File.exists?(test_login_details)
|
25
|
+
puts "✓ Found test configuration, setting up HitFox Coupon API configuration"
|
26
|
+
settings = YAML::load_file(test_login_details)
|
27
|
+
HitfoxCouponApi.configure do |config|
|
28
|
+
config.api_token = settings["api_token"]
|
29
|
+
config.api_secret = settings["api_secret"]
|
30
|
+
config.api_version = settings["api_version"]
|
31
|
+
config.api_endpoint = settings["api_endpoint"]
|
32
|
+
end
|
33
|
+
else
|
34
|
+
puts "✘ #{test_login_details} not found, unable to setup login details"
|
35
|
+
puts "✘ to do this yourself, do something like:"
|
36
|
+
puts(<<-EOF)
|
37
|
+
HitfoxCouponApi.configure do |config|
|
38
|
+
config.api_token = 'your api token'
|
39
|
+
config.api_secret = 'your api secret'
|
40
|
+
config.api_version = 'the api version as provided by HitFox.com'
|
41
|
+
config.api_endpoint = 'the api endpoint as provided by HitFox.com'
|
42
|
+
end
|
43
|
+
EOF
|
44
|
+
end
|
45
|
+
|
46
|
+
Pry.editor = "emacs"
|
47
|
+
Pry.start
|
48
|
+
|
49
|
+
$LOAD_PATH.reject! { |path| !(original_load_path.include?(path)) }
|
metadata
ADDED
@@ -0,0 +1,254 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hitfox_coupon_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Gerrit Riessen
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-01 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
name: rest-client
|
31
|
+
prerelease: false
|
32
|
+
type: :runtime
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
name: json
|
45
|
+
prerelease: false
|
46
|
+
type: :runtime
|
47
|
+
requirement: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - "="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 49
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 8
|
58
|
+
- 7
|
59
|
+
version: 0.8.7
|
60
|
+
name: rake
|
61
|
+
prerelease: false
|
62
|
+
type: :development
|
63
|
+
requirement: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
name: pry
|
75
|
+
prerelease: false
|
76
|
+
type: :development
|
77
|
+
requirement: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
name: pry-doc
|
89
|
+
prerelease: false
|
90
|
+
type: :development
|
91
|
+
requirement: *id005
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
name: gist
|
103
|
+
prerelease: false
|
104
|
+
type: :development
|
105
|
+
requirement: *id006
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
name: thoughtbot-shoulda
|
117
|
+
prerelease: false
|
118
|
+
type: :development
|
119
|
+
requirement: *id007
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ~>
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 23
|
127
|
+
segments:
|
128
|
+
- 1
|
129
|
+
- 0
|
130
|
+
- 0
|
131
|
+
version: 1.0.0
|
132
|
+
name: bundler
|
133
|
+
prerelease: false
|
134
|
+
type: :development
|
135
|
+
requirement: *id008
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ~>
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
hash: 7
|
143
|
+
segments:
|
144
|
+
- 1
|
145
|
+
- 6
|
146
|
+
- 4
|
147
|
+
version: 1.6.4
|
148
|
+
name: jeweler
|
149
|
+
prerelease: false
|
150
|
+
type: :development
|
151
|
+
requirement: *id009
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
162
|
+
name: rcov
|
163
|
+
prerelease: false
|
164
|
+
type: :development
|
165
|
+
requirement: *id010
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
hash: 3
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
version: "0"
|
176
|
+
name: rr
|
177
|
+
prerelease: false
|
178
|
+
type: :development
|
179
|
+
requirement: *id011
|
180
|
+
- !ruby/object:Gem::Dependency
|
181
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
hash: 3
|
187
|
+
segments:
|
188
|
+
- 0
|
189
|
+
version: "0"
|
190
|
+
name: cheat
|
191
|
+
prerelease: false
|
192
|
+
type: :development
|
193
|
+
requirement: *id012
|
194
|
+
description: Simple JSON interface to the HitFox coupon API
|
195
|
+
email: gerrit.riessen@gmail.com
|
196
|
+
executables: []
|
197
|
+
|
198
|
+
extensions: []
|
199
|
+
|
200
|
+
extra_rdoc_files:
|
201
|
+
- LICENSE.txt
|
202
|
+
- README.rdoc
|
203
|
+
files:
|
204
|
+
- .document
|
205
|
+
- .rvmrc
|
206
|
+
- Gemfile
|
207
|
+
- LICENSE.txt
|
208
|
+
- README.rdoc
|
209
|
+
- Rakefile
|
210
|
+
- VERSION
|
211
|
+
- hitfox_coupon_api.gemspec
|
212
|
+
- lib/hitfox_coupon_api.rb
|
213
|
+
- lib/hitfox_coupon_api/application.rb
|
214
|
+
- lib/hitfox_coupon_api/configuration.rb
|
215
|
+
- lib/hitfox_coupon_api/coupon.rb
|
216
|
+
- test/.login.yml.sample
|
217
|
+
- test/helper.rb
|
218
|
+
- test/test_hitfox_coupon_api.rb
|
219
|
+
- test_shell
|
220
|
+
homepage: https://github.com/gorenje/hitfox_coupon_api
|
221
|
+
licenses:
|
222
|
+
- MIT
|
223
|
+
post_install_message:
|
224
|
+
rdoc_options: []
|
225
|
+
|
226
|
+
require_paths:
|
227
|
+
- lib
|
228
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
229
|
+
none: false
|
230
|
+
requirements:
|
231
|
+
- - ">="
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
hash: 3
|
234
|
+
segments:
|
235
|
+
- 0
|
236
|
+
version: "0"
|
237
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
|
+
none: false
|
239
|
+
requirements:
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
hash: 3
|
243
|
+
segments:
|
244
|
+
- 0
|
245
|
+
version: "0"
|
246
|
+
requirements: []
|
247
|
+
|
248
|
+
rubyforge_project:
|
249
|
+
rubygems_version: 1.8.10
|
250
|
+
signing_key:
|
251
|
+
specification_version: 3
|
252
|
+
summary: Simple JSON interface to the HitFox coupon API
|
253
|
+
test_files: []
|
254
|
+
|