ethikdo 0.0.1 → 1.0.0

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
  SHA256:
3
- metadata.gz: 69e3c079fa419a6f528b987b6fd27532bbe32c13fc2edf835a2935b00d57e306
4
- data.tar.gz: 36ba7a4fff07e5be5122067fda892a6dd2075c992f1f42e05ebb441e63773cb2
3
+ metadata.gz: 0b1428fa2790b6662c67e9f40d1d08241ad0a6173747195d669f2a60647a0bba
4
+ data.tar.gz: e64d03328504ab4ca4941ff0870a96ee6b96e6958df314aaff3b6897b6233f6e
5
5
  SHA512:
6
- metadata.gz: 81e308089d0537a5bf6f9ee25ac3820beb314b5b9ab1b64bde9b9aa11352008ed48439c526f40216b298a5ce9616e46bb8d0d149ce176e770e24e8b2eca078cc
7
- data.tar.gz: f3b88b0ebe7307840a433e584557f28962c6e38b7392d25542cbbdd3c8b942f06ca5515d4a985dea0a50e50658cfc4ae406900a6e0df3c8ca3d75789cab74a0a
6
+ metadata.gz: b9c955351c11551287f6fff29abf68d60215ab102540fc693edfdd022faf30e8722c77895a2c304ccaafbb859b63ea1454ee31c3fc43fb7c0d974540b57ee7fc
7
+ data.tar.gz: 89db27ebb33f4148924192ec63acb7babafddf9ddbf9451d01985a68267407b985fd3ba1185ed3ff8206185a499c8d180a8beb4e49572613d7534d8bdbc59b0d
data/Gemfile.lock CHANGED
@@ -2,102 +2,101 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  ethikdo (0.0.1)
5
- httparty (~> 0.16.2)
5
+ httparty
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionpack (6.0.2.2)
11
- actionview (= 6.0.2.2)
12
- activesupport (= 6.0.2.2)
13
- rack (~> 2.0, >= 2.0.8)
10
+ actionpack (7.0.4)
11
+ actionview (= 7.0.4)
12
+ activesupport (= 7.0.4)
13
+ rack (~> 2.0, >= 2.2.0)
14
14
  rack-test (>= 0.6.3)
15
15
  rails-dom-testing (~> 2.0)
16
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.2.2)
18
- activesupport (= 6.0.2.2)
17
+ actionview (7.0.4)
18
+ activesupport (= 7.0.4)
19
19
  builder (~> 3.1)
20
20
  erubi (~> 1.4)
21
21
  rails-dom-testing (~> 2.0)
22
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activesupport (6.0.2.2)
23
+ activesupport (7.0.4)
24
24
  concurrent-ruby (~> 1.0, >= 1.0.2)
25
- i18n (>= 0.7, < 2)
26
- minitest (~> 5.1)
27
- tzinfo (~> 1.1)
28
- zeitwerk (~> 2.2)
29
- addressable (2.7.0)
30
- public_suffix (>= 2.0.2, < 5.0)
25
+ i18n (>= 1.6, < 2)
26
+ minitest (>= 5.1)
27
+ tzinfo (~> 2.0)
28
+ addressable (2.8.1)
29
+ public_suffix (>= 2.0.2, < 6.0)
31
30
  builder (3.2.4)
32
- concurrent-ruby (1.1.6)
33
- crack (0.4.3)
34
- safe_yaml (~> 1.0.0)
31
+ concurrent-ruby (1.1.10)
32
+ crack (0.4.5)
33
+ rexml
35
34
  crass (1.0.6)
36
- diff-lcs (1.3)
37
- erubi (1.9.0)
35
+ diff-lcs (1.5.0)
36
+ erubi (1.11.0)
38
37
  generator_spec (0.9.4)
39
38
  activesupport (>= 3.0.0)
40
39
  railties (>= 3.0.0)
41
- hashdiff (1.0.0)
42
- httparty (0.16.4)
40
+ hashdiff (1.0.1)
41
+ httparty (0.20.0)
43
42
  mime-types (~> 3.0)
44
43
  multi_xml (>= 0.5.2)
45
- i18n (1.8.2)
44
+ i18n (1.12.0)
46
45
  concurrent-ruby (~> 1.0)
47
- loofah (2.5.0)
46
+ loofah (2.19.0)
48
47
  crass (~> 1.0.2)
49
48
  nokogiri (>= 1.5.9)
50
49
  method_source (1.0.0)
51
- mime-types (3.3.1)
50
+ mime-types (3.4.1)
52
51
  mime-types-data (~> 3.2015)
53
- mime-types-data (3.2019.1009)
54
- mini_portile2 (2.4.0)
55
- minitest (5.14.0)
52
+ mime-types-data (3.2022.0105)
53
+ minitest (5.16.3)
56
54
  multi_xml (0.6.0)
57
- nokogiri (1.10.9)
58
- mini_portile2 (~> 2.4.0)
59
- public_suffix (4.0.3)
60
- rack (2.2.2)
61
- rack-test (1.1.0)
62
- rack (>= 1.0, < 3)
55
+ nokogiri (1.13.9-arm64-darwin)
56
+ racc (~> 1.4)
57
+ public_suffix (5.0.0)
58
+ racc (1.6.0)
59
+ rack (2.2.4)
60
+ rack-test (2.0.2)
61
+ rack (>= 1.3)
63
62
  rails-dom-testing (2.0.3)
64
63
  activesupport (>= 4.2.0)
65
64
  nokogiri (>= 1.6)
66
- rails-html-sanitizer (1.3.0)
65
+ rails-html-sanitizer (1.4.3)
67
66
  loofah (~> 2.3)
68
- railties (6.0.2.2)
69
- actionpack (= 6.0.2.2)
70
- activesupport (= 6.0.2.2)
67
+ railties (7.0.4)
68
+ actionpack (= 7.0.4)
69
+ activesupport (= 7.0.4)
71
70
  method_source
72
- rake (>= 0.8.7)
73
- thor (>= 0.20.3, < 2.0)
71
+ rake (>= 12.2)
72
+ thor (~> 1.0)
73
+ zeitwerk (~> 2.5)
74
74
  rake (12.3.3)
75
- rspec (3.9.0)
76
- rspec-core (~> 3.9.0)
77
- rspec-expectations (~> 3.9.0)
78
- rspec-mocks (~> 3.9.0)
79
- rspec-core (3.9.1)
80
- rspec-support (~> 3.9.1)
81
- rspec-expectations (3.9.0)
75
+ rexml (3.2.5)
76
+ rspec (3.12.0)
77
+ rspec-core (~> 3.12.0)
78
+ rspec-expectations (~> 3.12.0)
79
+ rspec-mocks (~> 3.12.0)
80
+ rspec-core (3.12.0)
81
+ rspec-support (~> 3.12.0)
82
+ rspec-expectations (3.12.0)
82
83
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-mocks (3.9.1)
84
+ rspec-support (~> 3.12.0)
85
+ rspec-mocks (3.12.0)
85
86
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.9.0)
87
- rspec-support (3.9.2)
88
- safe_yaml (1.0.5)
89
- thor (1.0.1)
90
- thread_safe (0.3.6)
91
- tzinfo (1.2.7)
92
- thread_safe (~> 0.1)
93
- webmock (3.8.2)
94
- addressable (>= 2.3.6)
87
+ rspec-support (~> 3.12.0)
88
+ rspec-support (3.12.0)
89
+ thor (1.2.1)
90
+ tzinfo (2.0.5)
91
+ concurrent-ruby (~> 1.0)
92
+ webmock (3.18.1)
93
+ addressable (>= 2.8.0)
95
94
  crack (>= 0.3.2)
96
95
  hashdiff (>= 0.4.0, < 2.0.0)
97
- zeitwerk (2.3.0)
96
+ zeitwerk (2.6.6)
98
97
 
99
98
  PLATFORMS
100
- ruby
99
+ arm64-darwin-20
101
100
 
102
101
  DEPENDENCIES
103
102
  ethikdo!
@@ -107,4 +106,4 @@ DEPENDENCIES
107
106
  webmock (~> 3)
108
107
 
109
108
  BUNDLED WITH
110
- 2.1.4
109
+ 2.3.6
data/ethikdo.gemspec CHANGED
@@ -1,31 +1,31 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
- require 'ethikdo/version'
4
+ require "ethikdo/version"
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "ethikdo"
8
- s.version = Ethikdo::VERSION
9
- s.authors = ["Benoit Baumann", "Kevin Chavanne"]
10
- s.email = ["baumann.benoit@gmail.com", "kevin.chavanne@gmail.com"]
7
+ s.name = "ethikdo"
8
+ s.version = Ethikdo::VERSION
9
+ s.authors = ["Benoit Baumann", "Kevin Chavanne"]
10
+ s.email = ["baumann.benoit@gmail.com", "kevin.chavanne@gmail.com"]
11
11
 
12
- s.summary = "A ruby wrapper for Ethikdo REST API "
13
- s.description = "This gem provides an easy way to manage transactions for Ethi'kdo card holders through the Ethi'kdo REST API"
14
- s.homepage = "https://github.com/wedressfair/ethikdo"
15
- s.license = "MIT"
12
+ s.summary = "A ruby wrapper for Ethikdo REST API "
13
+ s.description = "This gem provides an easy way to manage transactions for Ethi'kdo card holders through the Ethi'kdo REST API"
14
+ s.homepage = "https://github.com/wedressfair/ethikdo"
15
+ s.license = "MIT"
16
16
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
17
17
 
18
18
  s.metadata["homepage_uri"] = s.homepage
19
19
  s.metadata["source_code_uri"] = "https://github.com/wedressfair/ethikdo"
20
20
 
21
- s.files = `git ls-files`.split("\n")
22
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
24
24
  s.require_paths = ["lib"]
25
25
 
26
26
  s.add_development_dependency "rspec", "~> 3.2"
27
- s.add_development_dependency 'rake', '~> 12'
28
- s.add_development_dependency 'webmock', '~> 3'
29
- s.add_development_dependency 'generator_spec', '~> 0.9'
30
- s.add_runtime_dependency 'httparty', '~> 0.16.2'
27
+ s.add_development_dependency "rake", "~> 12"
28
+ s.add_development_dependency "webmock", "~> 3"
29
+ s.add_development_dependency "generator_spec", "~> 0.9"
30
+ s.add_runtime_dependency "httparty"
31
31
  end
data/lib/ethikdo/error.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'net/http'
1
+ require "net/http"
2
2
 
3
3
  module Ethikdo
4
4
  class Error < StandardError
@@ -17,7 +17,7 @@ module Ethikdo
17
17
  Net::ReadTimeout,
18
18
  SocketError,
19
19
  Zlib::GzipFile::Error,
20
- OpenSSL::SSL::SSLError
20
+ OpenSSL::SSL::SSLError,
21
21
  ]
22
22
 
23
23
  attr_reader :http_response
@@ -34,7 +34,7 @@ module Ethikdo
34
34
  private
35
35
 
36
36
  def build_error_message
37
- return nil if http_response.nil?
37
+ return nil if http_response.body.nil?
38
38
 
39
39
  message = "#{http_request_method} "
40
40
  message << "#{http_request.path} : "
@@ -44,13 +44,13 @@ module Ethikdo
44
44
  end
45
45
 
46
46
  def http_request_method
47
- http_request.http_method.name.split('::').last.upcase
47
+ http_request.http_method.name.split("::").last.upcase
48
48
  end
49
49
 
50
50
  def response_message
51
- content_type = http_response.headers['Content-Type']
52
- if content_type && content_type.start_with?('application/json')
53
- http_response.parsed_response['message'] || http_response.parsed_response['detail']
51
+ content_type = http_response.headers["Content-Type"]
52
+ if content_type && content_type.start_with?("application/json")
53
+ http_response.parsed_response["message"] || http_response.parsed_response["detail"]
54
54
  else
55
55
  net_http_response = http_response.response
56
56
  "#{net_http_response.code} #{net_http_response.message}"
@@ -1,3 +1,3 @@
1
1
  module Ethikdo
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethikdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Baumann
8
8
  - Kevin Chavanne
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-17 00:00:00.000000000 Z
12
+ date: 2022-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -71,16 +71,16 @@ dependencies:
71
71
  name: httparty
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 0.16.2
76
+ version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 0.16.2
83
+ version: '0'
84
84
  description: This gem provides an easy way to manage transactions for Ethi'kdo card
85
85
  holders through the Ethi'kdo REST API
86
86
  email:
@@ -133,7 +133,7 @@ licenses:
133
133
  metadata:
134
134
  homepage_uri: https://github.com/wedressfair/ethikdo
135
135
  source_code_uri: https://github.com/wedressfair/ethikdo
136
- post_install_message:
136
+ post_install_message:
137
137
  rdoc_options: []
138
138
  require_paths:
139
139
  - lib
@@ -148,8 +148,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
- rubygems_version: 3.1.2
152
- signing_key:
151
+ rubygems_version: 3.3.3
152
+ signing_key:
153
153
  specification_version: 4
154
154
  summary: A ruby wrapper for Ethikdo REST API
155
- test_files: []
155
+ test_files:
156
+ - spec/base_model_spec.rb
157
+ - spec/ethikdo_spec.rb
158
+ - spec/http_fixtures/forbidden/no_token.http
159
+ - spec/http_fixtures/forbidden/wrong_token.http
160
+ - spec/http_fixtures/provisions/create_success.http
161
+ - spec/http_fixtures/provisions/get_provisions_success.http
162
+ - spec/http_fixtures/transactions/cancel_success.http
163
+ - spec/http_fixtures/transactions/create_success.http
164
+ - spec/http_fixtures/transactions/get_transactions_success.http
165
+ - spec/install_generator_spec.rb
166
+ - spec/provision_spec.rb
167
+ - spec/spec_helper.rb
168
+ - spec/support/helpers.rb
169
+ - spec/support/webmock.rb
170
+ - spec/transaction_spec.rb