justgiving 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f8842a88c0c760de7953dc833b0482abc8c173e
4
- data.tar.gz: ff56ebcaa33d6c3cbb7223705ca9236de6490492
3
+ metadata.gz: 22d99ab0695f314a4a43260447fe0e42fa7e4aaf
4
+ data.tar.gz: cdd72a2674aae6928178111831a145d6f5fa8ded
5
5
  SHA512:
6
- metadata.gz: 44cd1ae155da8b43335127c5e3b7ff36a7f6261c9e5c689abaeb18457005449d485c3bcc0dea7c1fc252a2dd9da4cec009fafaa8f3e6c3824c3816ee5c2ef21b
7
- data.tar.gz: 5c1b1bfe4010a97930931be673818897273e729edd92cd53aa9176765c28a98c2dd92259c85ff1e1a1c773d8c05979defdf2ed247a5c0c049144c5f347261dcd
6
+ metadata.gz: ac021341ac17b4c24b870f3f8879315b48b616cd49cfdeff77f9bb591ff54bd759f071701e5c3b1208ac67bc52913375fadb604ce5f56f67afcc99ab2169d71a
7
+ data.tar.gz: ba7676775d0ae7a59168f3de1c6b6e57b133b5fa963b1434be7a0c11069ab5afb7712ccd5c252f1fbe26b439eeba47abd7ff215a6cf12e886095cfc032d3638f
data/justgiving.gemspec CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "faraday"
24
- spec.add_development_dependency "faraday_middleware"
25
- spec.add_development_dependency "addressable"
22
+ spec.add_development_dependency "rake", "~> 10.3"
23
+
24
+ spec.add_runtime_dependency "faraday", "~> 0.9"
25
+ spec.add_runtime_dependency "faraday_middleware", "~> 0.9"
26
+ spec.add_runtime_dependency "addressable", "~> 2.3"
26
27
  end
@@ -0,0 +1,27 @@
1
+ module JustGiving
2
+ module Error
3
+
4
+ class BadRequest < StandardError; end
5
+ class NoResults < StandardError; end
6
+ class InternalServerError < StandardError; end
7
+
8
+ class RaiseError < Faraday::Response::Middleware
9
+
10
+ def on_complete(env)
11
+ status = env[:status]
12
+ if status >= 400
13
+ case status
14
+ when 400
15
+ raise Error::BadRequest
16
+ when 404
17
+ raise Error::NoResults
18
+ else
19
+ raise Error::InternalServerError # Treat any other errors as 500
20
+ end
21
+ end
22
+ end
23
+
24
+ end
25
+
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module JustGiving
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justgiving
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Dent
@@ -28,58 +28,58 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
47
+ version: '0.9'
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: faraday_middleware
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
61
+ version: '0.9'
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.9'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: addressable
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
75
+ version: '2.3'
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '2.3'
83
83
  description:
84
84
  email:
85
85
  - jack@jackdent.co.uk
@@ -99,6 +99,7 @@ files:
99
99
  - lib/justgiving/country.rb
100
100
  - lib/justgiving/currency.rb
101
101
  - lib/justgiving/donation.rb
102
+ - lib/justgiving/error.rb
102
103
  - lib/justgiving/search.rb
103
104
  - lib/justgiving/version.rb
104
105
  homepage: http://www.github.com/jackdent/justgiving