just_giving 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -6
- data/Rakefile +7 -11
- data/just_giving.gemspec +29 -29
- data/lib/faraday/raise_http_4xx.rb +2 -0
- data/lib/faraday/raise_http_5xx.rb +2 -1
- data/lib/just_giving/account.rb +1 -1
- data/lib/just_giving/configuration.rb +9 -1
- data/lib/just_giving/connection.rb +8 -5
- data/lib/just_giving/response.rb +12 -0
- data/lib/just_giving/simple_donation_integration.rb +3 -3
- data/lib/just_giving/version.rb +1 -1
- data/test/fixtures/account_list_all_pages.json +2 -2
- data/test/test_account.rb +35 -10
- data/test/test_configuration.rb +8 -1
- data/test/test_fundraising.rb +10 -3
- data/test/test_simple_donation_integration.rb +12 -12
- metadata +145 -146
data/Gemfile
CHANGED
@@ -3,10 +3,10 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
gem "faraday"
|
7
|
-
gem "faraday_middleware",
|
6
|
+
gem "faraday", "~> 0.8.9"
|
7
|
+
gem "faraday_middleware", "~> 0.9.0"
|
8
8
|
gem "hashie"
|
9
|
-
gem "multi_json", "~> 1.
|
9
|
+
gem "multi_json", "~> 1.8.4"
|
10
10
|
gem "yajl-ruby"
|
11
11
|
|
12
12
|
|
@@ -14,8 +14,8 @@ gem "yajl-ruby"
|
|
14
14
|
# Include everything needed to run rake, tests, features, etc.
|
15
15
|
group :development do
|
16
16
|
gem "shoulda", ">= 0"
|
17
|
-
gem "bundler", "
|
18
|
-
gem "jeweler", "~>
|
19
|
-
gem "
|
17
|
+
gem "bundler", ">= 1.0.0"
|
18
|
+
gem "jeweler", "~> 2.0.1"
|
19
|
+
gem "simplecov", ">= 0"
|
20
20
|
gem "webmock"
|
21
21
|
end
|
data/Rakefile
CHANGED
@@ -11,8 +11,12 @@ rescue Bundler::BundlerError => e
|
|
11
11
|
end
|
12
12
|
require 'rake'
|
13
13
|
|
14
|
+
lib = File.expand_path('../lib', __FILE__)
|
15
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
16
|
+
|
14
17
|
require 'jeweler'
|
15
|
-
require '
|
18
|
+
require 'just_giving/version'
|
19
|
+
|
16
20
|
Jeweler::Tasks.new do |gem|
|
17
21
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
18
22
|
gem.name = "just_giving"
|
@@ -30,21 +34,13 @@ Jeweler::RubygemsDotOrgTasks.new
|
|
30
34
|
require 'rake/testtask'
|
31
35
|
Rake::TestTask.new(:test) do |test|
|
32
36
|
test.libs << 'lib' << 'test'
|
33
|
-
test.
|
34
|
-
test.verbose = true
|
35
|
-
end
|
36
|
-
|
37
|
-
require 'rcov/rcovtask'
|
38
|
-
Rcov::RcovTask.new do |test|
|
39
|
-
test.libs << 'test'
|
40
|
-
test.pattern = 'test/**/test_*.rb'
|
37
|
+
test.test_files = FileList['test/**/test_*.rb']
|
41
38
|
test.verbose = true
|
42
|
-
test.rcov_opts << '--exclude "gems/*"'
|
43
39
|
end
|
44
40
|
|
45
41
|
task :default => :test
|
46
42
|
|
47
|
-
require '
|
43
|
+
require 'rdoc/task'
|
48
44
|
Rake::RDocTask.new do |rdoc|
|
49
45
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
50
46
|
|
data/just_giving.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
7
|
+
s.name = "just_giving"
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
11
|
+
s.authors = ["Thomas Pomfret"]
|
12
|
+
s.date = "2014-02-20"
|
13
|
+
s.description = "A ruby wrapper for the justgiving.com API"
|
14
|
+
s.email = "thomas@mintdigital.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.md"
|
@@ -65,48 +65,48 @@ Gem::Specification.new do |s|
|
|
65
65
|
"test/test_search.rb",
|
66
66
|
"test/test_simple_donation_integration.rb"
|
67
67
|
]
|
68
|
-
s.homepage =
|
69
|
-
s.licenses = [
|
70
|
-
s.require_paths = [
|
71
|
-
s.rubygems_version =
|
72
|
-
s.summary =
|
68
|
+
s.homepage = "http://github.com/mintdigital/just_giving"
|
69
|
+
s.licenses = ["MIT"]
|
70
|
+
s.require_paths = ["lib"]
|
71
|
+
s.rubygems_version = "1.8.25"
|
72
|
+
s.summary = "A ruby wrapper for the justgiving.com API"
|
73
73
|
|
74
74
|
if s.respond_to? :specification_version then
|
75
75
|
s.specification_version = 3
|
76
76
|
|
77
77
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
78
|
-
s.add_runtime_dependency(%q<faraday>, ["
|
79
|
-
s.add_runtime_dependency(%q<faraday_middleware>, ["~> 0.
|
78
|
+
s.add_runtime_dependency(%q<faraday>, ["~> 0.8.9"])
|
79
|
+
s.add_runtime_dependency(%q<faraday_middleware>, ["~> 0.9.0"])
|
80
80
|
s.add_runtime_dependency(%q<hashie>, [">= 0"])
|
81
|
-
s.add_runtime_dependency(%q<multi_json>, ["~> 1.
|
81
|
+
s.add_runtime_dependency(%q<multi_json>, ["~> 1.8.4"])
|
82
82
|
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
|
83
83
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
84
|
-
s.add_development_dependency(%q<bundler>, ["
|
85
|
-
s.add_development_dependency(%q<jeweler>, ["~>
|
86
|
-
s.add_development_dependency(%q<
|
84
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
85
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
86
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
87
87
|
s.add_development_dependency(%q<webmock>, [">= 0"])
|
88
88
|
else
|
89
|
-
s.add_dependency(%q<faraday>, ["
|
90
|
-
s.add_dependency(%q<faraday_middleware>, ["~> 0.
|
89
|
+
s.add_dependency(%q<faraday>, ["~> 0.8.9"])
|
90
|
+
s.add_dependency(%q<faraday_middleware>, ["~> 0.9.0"])
|
91
91
|
s.add_dependency(%q<hashie>, [">= 0"])
|
92
|
-
s.add_dependency(%q<multi_json>, ["~> 1.
|
92
|
+
s.add_dependency(%q<multi_json>, ["~> 1.8.4"])
|
93
93
|
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
94
94
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
95
|
-
s.add_dependency(%q<bundler>, ["
|
96
|
-
s.add_dependency(%q<jeweler>, ["~>
|
97
|
-
s.add_dependency(%q<
|
95
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
96
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
97
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
98
98
|
s.add_dependency(%q<webmock>, [">= 0"])
|
99
99
|
end
|
100
100
|
else
|
101
|
-
s.add_dependency(%q<faraday>, ["
|
102
|
-
s.add_dependency(%q<faraday_middleware>, ["~> 0.
|
101
|
+
s.add_dependency(%q<faraday>, ["~> 0.8.9"])
|
102
|
+
s.add_dependency(%q<faraday_middleware>, ["~> 0.9.0"])
|
103
103
|
s.add_dependency(%q<hashie>, [">= 0"])
|
104
|
-
s.add_dependency(%q<multi_json>, ["~> 1.
|
104
|
+
s.add_dependency(%q<multi_json>, ["~> 1.8.4"])
|
105
105
|
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
106
106
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
107
|
-
s.add_dependency(%q<bundler>, ["
|
108
|
-
s.add_dependency(%q<jeweler>, ["~>
|
109
|
-
s.add_dependency(%q<
|
107
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
108
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
109
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
110
110
|
s.add_dependency(%q<webmock>, [">= 0"])
|
111
111
|
end
|
112
112
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'faraday'
|
2
|
+
require 'multi_json'
|
2
3
|
|
3
4
|
module Faraday
|
4
5
|
class Response::RaiseHttp4xx < Response::Middleware
|
@@ -18,6 +19,7 @@ module Faraday
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def error_body(body)
|
22
|
+
return nil if body.nil?
|
21
23
|
body = MultiJson.decode(body)
|
22
24
|
if body.nil?
|
23
25
|
nil
|
data/lib/just_giving/account.rb
CHANGED
@@ -37,7 +37,7 @@ module JustGiving
|
|
37
37
|
# Send password reminder
|
38
38
|
def password_reminder
|
39
39
|
response = get("v1/account/#{@email}/requestpasswordreminder")
|
40
|
-
(response && response
|
40
|
+
(response && response[:errors]) ? response : true
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module JustGiving
|
2
2
|
class Configuration
|
3
|
-
|
3
|
+
BASE_URI_MAP = {
|
4
|
+
:production => "http://www.justgiving.com",
|
5
|
+
:staging => "http://v3-staging.justgiving.com",
|
6
|
+
:sandbox => "http://v3-sandbox.justgiving.com"
|
7
|
+
}
|
4
8
|
|
5
9
|
@@application_id = nil
|
6
10
|
@@environment = :staging
|
@@ -15,6 +19,10 @@ module JustGiving
|
|
15
19
|
@@application_id = id
|
16
20
|
end
|
17
21
|
|
22
|
+
def self.base_uri
|
23
|
+
BASE_URI_MAP[self.environment]
|
24
|
+
end
|
25
|
+
|
18
26
|
## This can be :sandbox, :staging or :production and sets what endpoint to use
|
19
27
|
def self.environment=(env)
|
20
28
|
@@environment = env
|
@@ -14,15 +14,18 @@ module JustGiving
|
|
14
14
|
}
|
15
15
|
|
16
16
|
connection = Faraday::Connection.new(options) do |connection|
|
17
|
-
connection.
|
18
|
-
|
19
|
-
connection.
|
17
|
+
connection.request :json
|
18
|
+
|
19
|
+
connection.response :json
|
20
|
+
connection.response :mashify
|
21
|
+
|
20
22
|
connection.use Faraday::Response::RaiseHttp4xx
|
21
23
|
connection.use Faraday::Response::RaiseHttp5xx
|
22
|
-
|
24
|
+
|
25
|
+
connection.adapter :net_http
|
23
26
|
end
|
24
27
|
connection.basic_auth(JustGiving::Configuration.username, JustGiving::Configuration.password) if basic_auth
|
25
28
|
connection
|
26
29
|
end
|
27
30
|
end
|
28
|
-
end
|
31
|
+
end
|
data/lib/just_giving/response.rb
CHANGED
@@ -4,13 +4,13 @@ module JustGiving
|
|
4
4
|
class SimpleDonationIntegration
|
5
5
|
# Returns url to link to a charity page
|
6
6
|
def self.charity_page_url(short_name)
|
7
|
-
"#{JustGiving::Configuration
|
7
|
+
"#{JustGiving::Configuration.base_uri}/#{short_name}/donate"
|
8
8
|
end
|
9
9
|
|
10
10
|
# Returns url for the donation page of a charity
|
11
11
|
def self.charity_donation_url(charity_id, options={})
|
12
12
|
options = self.parse_options(options)
|
13
|
-
url = "#{JustGiving::Configuration
|
13
|
+
url = "#{JustGiving::Configuration.base_uri}/donation/direct/charity/#{charity_id}"
|
14
14
|
url << self.options_to_query(options) if options.any?
|
15
15
|
url
|
16
16
|
end
|
@@ -22,7 +22,7 @@ module JustGiving
|
|
22
22
|
# Returns url for the donation page of a fundraising
|
23
23
|
def self.fundraising_donation_url(page_id, options={})
|
24
24
|
options = self.parse_options(options)
|
25
|
-
url = "#{JustGiving::Configuration
|
25
|
+
url = "#{JustGiving::Configuration.base_uri}/donation/sponsor/page/#{page_id}"
|
26
26
|
url << self.options_to_query(options) if options.any?
|
27
27
|
url
|
28
28
|
end
|
data/lib/just_giving/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
3
|
"pageId": 1457423,
|
4
|
-
"pageTitle": "Alwyn
|
4
|
+
"pageTitle": "Alwyn's page",
|
5
5
|
"pageStatus": "Active",
|
6
6
|
"pageShortName": "myJustGivingShortName",
|
7
7
|
"raisedAmount": 20.0,
|
@@ -18,4 +18,4 @@
|
|
18
18
|
"smsCode": "PEJN76",
|
19
19
|
"charityId": 1
|
20
20
|
}
|
21
|
-
]
|
21
|
+
]
|
data/test/test_account.rb
CHANGED
@@ -12,7 +12,7 @@ class TestAccount < Test::Unit::TestCase
|
|
12
12
|
:headers => {:content_type => 'application/json; charset=utf-8'})
|
13
13
|
account = JustGiving::Account.new('test@example.com')
|
14
14
|
pages = account.pages
|
15
|
-
assert_equal 'Alwyn
|
15
|
+
assert_equal 'Alwyn\'s page', pages.first['pageTitle']
|
16
16
|
assert_equal 'Active', pages.first['pageStatus']
|
17
17
|
assert_equal 1, pages.first['designId']
|
18
18
|
end
|
@@ -62,14 +62,28 @@ class TestAccount < Test::Unit::TestCase
|
|
62
62
|
|
63
63
|
context 'Checking if an email is available' do
|
64
64
|
should 'return email is not available' do
|
65
|
-
stub_head('/v1/account/test@example.com').with({
|
66
|
-
|
65
|
+
stub_head('/v1/account/test@example.com').with({
|
66
|
+
'Accept'=>'application/json'
|
67
|
+
}).to_return({
|
68
|
+
:status => 200,
|
69
|
+
:headers => {
|
70
|
+
:content_type => 'application/json; charset=utf-8'
|
71
|
+
},
|
72
|
+
:body => "{}"
|
73
|
+
})
|
67
74
|
assert !JustGiving::Account.new('test@example.com').available?
|
68
75
|
end
|
69
76
|
|
70
77
|
should 'return email is available' do
|
71
|
-
stub_head(
|
72
|
-
|
78
|
+
stub_head("/v1/account/test@example.com").with({
|
79
|
+
'Accept'=>'application/json'
|
80
|
+
}).to_return({
|
81
|
+
:status => 404,
|
82
|
+
:headers => {
|
83
|
+
:content_type => 'application/json; charset=utf-8'
|
84
|
+
},
|
85
|
+
:body => "{}"
|
86
|
+
})
|
73
87
|
assert JustGiving::Account.new('test@example.com').available?
|
74
88
|
end
|
75
89
|
end
|
@@ -94,15 +108,26 @@ class TestAccount < Test::Unit::TestCase
|
|
94
108
|
|
95
109
|
context 'Password reminder' do
|
96
110
|
should 'send password reminder' do
|
97
|
-
stub_get('/v1/account/test@example.com/requestpasswordreminder').with({
|
98
|
-
|
111
|
+
stub_get('/v1/account/test@example.com/requestpasswordreminder').with({
|
112
|
+
'Accept'=>'application/json'
|
113
|
+
}).to_return({
|
114
|
+
:status => 200,
|
115
|
+
:headers => {
|
116
|
+
:content_type => 'application/json; charset=utf-8'
|
117
|
+
},
|
118
|
+
:body => "{}"
|
119
|
+
})
|
99
120
|
assert JustGiving::Account.new('test@example.com').password_reminder
|
100
121
|
end
|
101
122
|
|
102
123
|
should 'not sent password reminder' do
|
103
|
-
stub_get('/v1/account/test@example.com/requestpasswordreminder').with({
|
104
|
-
|
105
|
-
|
124
|
+
stub_get('/v1/account/test@example.com/requestpasswordreminder').with({
|
125
|
+
'Accept'=>'application/json'
|
126
|
+
}).to_return({
|
127
|
+
:status => 400,
|
128
|
+
:body => "[{\"id\":\"AccountNotFound\",\"desc\":\"An account with that email address could not be found\"}]",
|
129
|
+
:headers => {:content_type => 'application/json; charset=utf-8'}
|
130
|
+
})
|
106
131
|
response = JustGiving::Account.new('test@example.com').password_reminder
|
107
132
|
assert response.errors
|
108
133
|
end
|
data/test/test_configuration.rb
CHANGED
@@ -15,6 +15,13 @@ class TestConfiguration < Test::Unit::TestCase
|
|
15
15
|
JustGiving::Configuration.environment = :production
|
16
16
|
assert_equal :production, JustGiving::Configuration.environment
|
17
17
|
end
|
18
|
+
|
19
|
+
should 'return the base_uri based on environment' do
|
20
|
+
JustGiving::Configuration::BASE_URI_MAP.each do |k,v|
|
21
|
+
JustGiving::Configuration.environment = k
|
22
|
+
assert_equal v, JustGiving::Configuration.base_uri
|
23
|
+
end
|
24
|
+
end
|
18
25
|
|
19
26
|
should 'return the api endpoint' do
|
20
27
|
JustGiving::Configuration.application_id = '5678'
|
@@ -38,4 +45,4 @@ class TestConfiguration < Test::Unit::TestCase
|
|
38
45
|
JustGiving::Configuration.ca_path = '/System/Library/OpenSSL/certs'
|
39
46
|
assert_equal '/System/Library/OpenSSL/certs', JustGiving::Configuration.ca_path
|
40
47
|
end
|
41
|
-
end
|
48
|
+
end
|
data/test/test_fundraising.rb
CHANGED
@@ -52,8 +52,15 @@ class TestFundraising < Test::Unit::TestCase
|
|
52
52
|
|
53
53
|
context 'with no basic auth' do
|
54
54
|
should 'check if short name is registered' do
|
55
|
-
stub_head('/v1/fundraising/pages/test').with(
|
56
|
-
:
|
55
|
+
stub_head('/v1/fundraising/pages/test').with({
|
56
|
+
:headers => {'Accept'=>'application/json'}
|
57
|
+
}).to_return({
|
58
|
+
:status => 200,
|
59
|
+
:headers => {
|
60
|
+
:content_type => 'application/json; charset=utf-8'
|
61
|
+
},
|
62
|
+
:body => "{}"
|
63
|
+
})
|
57
64
|
assert JustGiving::Fundraising.new('test').short_name_registered?
|
58
65
|
end
|
59
66
|
|
@@ -72,4 +79,4 @@ class TestFundraising < Test::Unit::TestCase
|
|
72
79
|
assert_equal "261017", page["charity"]["registrationNumber"]
|
73
80
|
end
|
74
81
|
end
|
75
|
-
end
|
82
|
+
end
|
@@ -2,43 +2,43 @@ require 'helper'
|
|
2
2
|
|
3
3
|
class TestSimpleDonationIntegration < Test::Unit::TestCase
|
4
4
|
should "return charity url" do
|
5
|
-
assert_equal "
|
5
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/short_name/donate", JustGiving::SimpleDonationIntegration.charity_page_url('short_name')
|
6
6
|
end
|
7
7
|
|
8
8
|
context "charity donation url" do
|
9
9
|
should "return charity donation url" do
|
10
|
-
assert_equal "
|
10
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050", JustGiving::SimpleDonationIntegration.charity_donation_url(2050)
|
11
11
|
end
|
12
12
|
|
13
13
|
should "accept valid options" do
|
14
|
-
assert_equal "
|
15
|
-
assert_equal "
|
14
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050?amount=2", JustGiving::SimpleDonationIntegration.charity_donation_url(2050, :amount => 2)
|
15
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050?frequency=single",
|
16
16
|
JustGiving::SimpleDonationIntegration.charity_donation_url(2050, :frequency => 'single')
|
17
|
-
assert_equal "
|
17
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050?exitUrl=http%3A%2F%2Fwww.myredirecturl.com%2Fpath",
|
18
18
|
JustGiving::SimpleDonationIntegration.charity_donation_url(2050, :exit_url => 'http://www.myredirecturl.com/path')
|
19
|
-
assert_equal "
|
19
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050?donationId=JUSTGIVING-DONATION-ID",
|
20
20
|
JustGiving::SimpleDonationIntegration.charity_donation_url(2050, :donation_id => 'JUSTGIVING-DONATION-ID')
|
21
21
|
end
|
22
22
|
|
23
23
|
should "reject unknown options" do
|
24
|
-
assert_equal "
|
24
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/direct/charity/2050", JustGiving::SimpleDonationIntegration.charity_donation_url(2050, :bogus => 1)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
should "return fundraising url" do
|
29
|
-
assert_equal "
|
29
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/test/donate", JustGiving::SimpleDonationIntegration.fundraising_page_url('test')
|
30
30
|
end
|
31
31
|
|
32
32
|
context "fundraising donation url" do
|
33
33
|
should "return fundraising donation url" do
|
34
|
-
assert_equal "
|
34
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/sponsor/page/12345", JustGiving::SimpleDonationIntegration.fundraising_donation_url(12345)
|
35
35
|
end
|
36
36
|
|
37
37
|
should "accept valid options" do
|
38
|
-
assert_equal "
|
39
|
-
assert_equal "
|
38
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/sponsor/page/12345?amount=2", JustGiving::SimpleDonationIntegration.fundraising_donation_url(12345, :amount => 2)
|
39
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/sponsor/page/12345?exitUrl=http%3A%2F%2Fwww.myredirecturl.com%2Fpath",
|
40
40
|
JustGiving::SimpleDonationIntegration.fundraising_donation_url(12345, :exit_url => 'http://www.myredirecturl.com/path')
|
41
|
-
assert_equal "
|
41
|
+
assert_equal "#{JustGiving::Configuration.base_uri}/donation/sponsor/page/12345?donationId=JUSTGIVING-DONATION-ID",
|
42
42
|
JustGiving::SimpleDonationIntegration.fundraising_donation_url(12345, :donation_id => 'JUSTGIVING-DONATION-ID')
|
43
43
|
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,179 +1,184 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: just_giving
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
version: 0.3.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Thomas Pomfret
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
prerelease: false
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
version_requirements: *id001
|
12
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
32
15
|
name: faraday
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.8.9
|
33
22
|
type: :runtime
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
23
|
prerelease: false
|
36
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
25
|
none: false
|
38
|
-
requirements:
|
26
|
+
requirements:
|
39
27
|
- - ~>
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
|
43
|
-
- 0
|
44
|
-
- 7
|
45
|
-
version: "0.7"
|
46
|
-
version_requirements: *id002
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.8.9
|
30
|
+
- !ruby/object:Gem::Dependency
|
47
31
|
name: faraday_middleware
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.9.0
|
48
38
|
type: :runtime
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
39
|
prerelease: false
|
51
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
41
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
|
58
|
-
- 0
|
59
|
-
version: "0"
|
60
|
-
version_requirements: *id003
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
61
47
|
name: hashie
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
62
54
|
type: :runtime
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
55
|
prerelease: false
|
65
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
57
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
|
72
|
-
- 1
|
73
|
-
- 0
|
74
|
-
- 1
|
75
|
-
version: 1.0.1
|
76
|
-
version_requirements: *id004
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
77
63
|
name: multi_json
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.8.4
|
78
70
|
type: :runtime
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
71
|
prerelease: false
|
81
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
73
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
|
88
|
-
- 0
|
89
|
-
version: "0"
|
90
|
-
version_requirements: *id005
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.8.4
|
78
|
+
- !ruby/object:Gem::Dependency
|
91
79
|
name: yajl-ruby
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
92
86
|
type: :runtime
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
87
|
prerelease: false
|
95
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
89
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
- 0
|
103
|
-
version: "0"
|
104
|
-
version_requirements: *id006
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
105
95
|
name: shoulda
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
106
102
|
type: :development
|
107
|
-
- !ruby/object:Gem::Dependency
|
108
103
|
prerelease: false
|
109
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
105
|
none: false
|
111
|
-
requirements:
|
112
|
-
- -
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
|
115
|
-
|
116
|
-
- 1
|
117
|
-
- 0
|
118
|
-
- 0
|
119
|
-
version: 1.0.0
|
120
|
-
version_requirements: *id007
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
121
111
|
name: bundler
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.0.0
|
122
118
|
type: :development
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
119
|
prerelease: false
|
125
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
126
121
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
|
132
|
-
- 1
|
133
|
-
- 6
|
134
|
-
- 4
|
135
|
-
version: 1.6.4
|
136
|
-
version_requirements: *id008
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.0.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
137
127
|
name: jeweler
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 2.0.1
|
138
134
|
type: :development
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
135
|
prerelease: false
|
141
|
-
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 2.0.1
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: simplecov
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
142
145
|
none: false
|
143
|
-
requirements:
|
144
|
-
- -
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
|
147
|
-
segments:
|
148
|
-
- 0
|
149
|
-
version: "0"
|
150
|
-
version_requirements: *id009
|
151
|
-
name: rcov
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
152
150
|
type: :development
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
151
|
prerelease: false
|
155
|
-
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
153
|
none: false
|
157
|
-
requirements:
|
158
|
-
- -
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
|
161
|
-
|
162
|
-
- 0
|
163
|
-
version: "0"
|
164
|
-
version_requirements: *id010
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
- !ruby/object:Gem::Dependency
|
165
159
|
name: webmock
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
166
|
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
167
174
|
description: A ruby wrapper for the justgiving.com API
|
168
175
|
email: thomas@mintdigital.com
|
169
176
|
executables: []
|
170
|
-
|
171
177
|
extensions: []
|
172
|
-
|
173
|
-
extra_rdoc_files:
|
178
|
+
extra_rdoc_files:
|
174
179
|
- LICENSE.txt
|
175
180
|
- README.md
|
176
|
-
files:
|
181
|
+
files:
|
177
182
|
- .document
|
178
183
|
- Gemfile
|
179
184
|
- LICENSE.txt
|
@@ -222,37 +227,31 @@ files:
|
|
222
227
|
- test/test_search.rb
|
223
228
|
- test/test_simple_donation_integration.rb
|
224
229
|
homepage: http://github.com/mintdigital/just_giving
|
225
|
-
licenses:
|
230
|
+
licenses:
|
226
231
|
- MIT
|
227
232
|
post_install_message:
|
228
233
|
rdoc_options: []
|
229
|
-
|
230
|
-
require_paths:
|
234
|
+
require_paths:
|
231
235
|
- lib
|
232
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
236
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
233
237
|
none: false
|
234
|
-
requirements:
|
235
|
-
- -
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
|
238
|
-
segments:
|
238
|
+
requirements:
|
239
|
+
- - ! '>='
|
240
|
+
- !ruby/object:Gem::Version
|
241
|
+
version: '0'
|
242
|
+
segments:
|
239
243
|
- 0
|
240
|
-
|
241
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
|
+
hash: -2371052421660941692
|
245
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
246
|
none: false
|
243
|
-
requirements:
|
244
|
-
- -
|
245
|
-
- !ruby/object:Gem::Version
|
246
|
-
|
247
|
-
segments:
|
248
|
-
- 0
|
249
|
-
version: "0"
|
247
|
+
requirements:
|
248
|
+
- - ! '>='
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
250
251
|
requirements: []
|
251
|
-
|
252
252
|
rubyforge_project:
|
253
|
-
rubygems_version: 1.8.
|
253
|
+
rubygems_version: 1.8.25
|
254
254
|
signing_key:
|
255
255
|
specification_version: 3
|
256
256
|
summary: A ruby wrapper for the justgiving.com API
|
257
257
|
test_files: []
|
258
|
-
|