finix 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzE4YjEyY2UxYzJjMjFlMTI5MjE5ZWFmOWZjMDdmYjYzMmY0ZDM3Mw==
4
+ YjIwZTY2OGE1ZjA0OWNhYWEwOGZmOTFkZWM1MjU5MzE0ZTdlNGQ0Yw==
5
5
  data.tar.gz: !binary |-
6
- MTNmMGE1OGZiYTdiZDJhOWYwOTMxMDQ0YTBmODBmZWExZDY0MDNmOA==
6
+ YzA3ZmQ1ZGZmMDliMzU5ZTU4NmZlYzllYWU5NzQ3MjZlYjRmZTNmNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzBmMTRhYTEyYWQ0OWEyM2E5OWQ0NTAwZTNkNDEyYjA4MmEyNTExNTJhMTk3
10
- ZmYxMDVkNzZkYzA0YWU2MzlmYmE2OThjYWQ4MWY1MzlmMzExMzZmOWJmMTQx
11
- ZDY0ZjVhMGVhNTBlOWUyOWExYjg0YzUxZThiZWUwMjkyNWNmOTQ=
9
+ NTc4NzJjMWE5Y2JkZjhjMjVlZDI3OTM4MjZjZDVjZDNhMzc3NjdhZGJlZTZl
10
+ YzAzOTdjODBiMDdiZmFiZWVmMDc2MGQwYzI3MzlmOGYwMmI4OTBhNDJjMDU2
11
+ ZDRhNzA3MmI1YzA2NTBkZDNlNzcyMDlhOGU5NDI1MGZhZjExZjg=
12
12
  data.tar.gz: !binary |-
13
- NmQ4ZjZiYWVhODk1NzE0NWE0OGRmYmQyMjRlOTMyZTFlODQ2NmViNDhhY2Vm
14
- ZDk5Y2YwNjMyZDcxNmEwYWNkYWQ2ZmZkNTFkN2M4MGEzZTVmOGI5Zjg3ODE4
15
- OGZhODgxZWVjZTFlYmYxYmE5YzFiOTJkMmRjZGNjMDU5NGIyOTQ=
13
+ YzJmZWZiYTExMDg5YTI5OTBhNjA2OGY5MzIzMWRlMGE0YTA5ZGUxYjQ0MjAx
14
+ OTA2ZDk0NWJhY2NlMDBhMWIwNmNhOTNiZDkzMWYwZTVlYWUyMWVmYjY1NTc0
15
+ NTY1MGViMzViODZhMDhkZGE3ZDM4ZTJhYmM5ZWE1MzUxMGVjZDA=
data/circle.yml CHANGED
@@ -3,16 +3,19 @@ machine:
3
3
  version: 1.9.3
4
4
 
5
5
  environment:
6
+ RUBY_VERSIONS: 1.9.3,2.0.0,2.1.10,2.2.5,2.2.6,2.3.1,2.3.3,2.4.0-preview3
6
7
  PROCESSING_URL: https://api-staging.finix.io/
7
8
 
8
9
  dependencies:
9
10
  override:
10
- - gem install bundler
11
- - bundle install
11
+ - rvm get head
12
+ - rvm install $RUBY_VERSIONS
13
+ - rvm $RUBY_VERSIONS --verbose do gem install bundler
14
+ - rvm $RUBY_VERSIONS --verbose do bundle install
12
15
 
13
16
  test:
14
17
  override:
15
- - rake test
18
+ - rvm $RUBY_VERSIONS --verbose do bundle exec rake test
16
19
 
17
20
  post:
18
- - cp -Rf .report $CIRCLE_ARTIFACTS
21
+ - cp -Rf .report/ $CIRCLE_ARTIFACTS
@@ -22,9 +22,15 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency('public_suffix', '~> 1.4.6')
26
- spec.add_dependency('faraday', '~> 0.9.2')
25
+ spec.add_dependency('faraday', '~> 0.10.0')
27
26
  spec.add_dependency('faraday_middleware', '~> 0.10.1')
28
- spec.add_dependency('addressable', '~> 2.3')
29
- spec.add_dependency('json', '~> 1.8')
27
+
28
+ if RUBY_VERSION >= '2.0'
29
+ spec.add_dependency('json', '~> 2.0.2')
30
+ spec.add_dependency('addressable', '~> 2.5.0')
31
+ else
32
+ spec.add_dependency('public_suffix', '~> 1.4.6')
33
+ spec.add_dependency('json', '~> 1.8')
34
+ spec.add_dependency('addressable', '~> 2.3')
35
+ end
30
36
  end
@@ -71,6 +71,7 @@ module Finix
71
71
  resource_name, resources = body.delete('_embedded').first
72
72
  @resource_class = Finix.from_hypermedia_registry resource_name
73
73
  @attributes['items'] = resources.map { |item| @resource_class.construct_from_response item }
74
+ @attributes['page'] = body.delete('page')
74
75
  end
75
76
  end
76
77
 
@@ -6,8 +6,6 @@ module Finix
6
6
  define_hypermedia_types [:disputes]
7
7
 
8
8
  def upload_evidence(evidence_file_path)
9
- # self.evidence.file = Faraday::UploadIO.new(evidence_file_path, 'application/octet-stream')
10
- # self.evidence.file = Faraday::UploadIO.new(evidence_file_path, 'application/octet-stream')
11
9
  self.evidence.create :file => Faraday::UploadIO.new(evidence_file_path, 'application/octet-stream')
12
10
  end
13
11
  end
@@ -22,10 +22,8 @@ module Finix
22
22
 
23
23
  if property == 'self'
24
24
  @hyperlinks[:self] = link[:href]
25
- # @attributes['href'] = link[:href]
26
25
  else
27
26
  @hyperlinks[property] = Finix::Utils.callable(Finix::Pagination.new(link[:href], {}))
28
- # @hyperlinks[property] = Finix.from_hypermedia_registry(property).new 'href' => link[:href]
29
27
  end
30
28
  end
31
29
  end
@@ -114,38 +112,26 @@ module Finix
114
112
  end
115
113
 
116
114
  def fetch(*arguments)
117
- if arguments.nil? or arguments.empty? or arguments[0].nil? or arguments[0].to_s.empty? # no symbol.empty? in 1.8.7
118
- raise Finix::NotFound
115
+ if arguments.nil? or arguments.empty? or arguments[0].nil? or arguments[0].to_s.empty?
116
+ href = Finix.hypermedia_registry.key(self)
117
+ return Finix::Pagination.new href
119
118
  end
120
119
 
121
120
  options = arguments.slice!(0) or {}
122
- if options.is_a? String
121
+ if options.is_a? String and options =~ URI::regexp
123
122
  href = options
124
123
  else
125
124
  href = Finix.hypermedia_registry.key(self) or Finix.hypermedia_registry.key(self.class)
126
- id = options.delete(:id)
125
+ id = options if options.is_a? String
126
+ id = options.delete(:id) if options.is_a? Hash
127
127
  href = "#{href}/#{id}" unless id.nil?
128
128
  end
129
129
 
130
130
  response = Finix.get href
131
131
  construct_from_response response.body
132
-
133
132
  end
134
133
 
135
134
  alias find fetch
136
-
137
- # def paginate(options = {})
138
- # Finix::Pagination.new href, options
139
- # end
140
-
141
- # alias scoped paginate
142
- # alias where paginate
143
-
144
- # def all(options = {})
145
- # pager = paginate(options)
146
- # pager.to_a
147
- # end
148
-
149
135
  end
150
136
 
151
137
  end
@@ -5,7 +5,7 @@ module Finix
5
5
  unless self.verifications.nil?
6
6
  self.verifications.create(attrs)
7
7
  else
8
- raise 'Unsupported Method'
8
+ raise NotImplementedError.new 'not found `verifications` rel'
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Finix
2
- VERSION = '0.6'
2
+ VERSION = '0.7'
3
3
  end
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finix
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - finix-payments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2016-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: public_suffix
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.4.6
19
+ version: 0.10.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.4.6
26
+ version: 0.10.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: faraday
28
+ name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.2
33
+ version: 0.10.1
34
34
  type: :runtime
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.9.2
40
+ version: 0.10.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: faraday_middleware
42
+ name: public_suffix
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.10.1
47
+ version: 1.4.6
48
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.10.1
54
+ version: 1.4.6
55
55
  - !ruby/object:Gem::Dependency
56
- name: addressable
56
+ name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '2.3'
61
+ version: '1.8'
62
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: '2.3'
68
+ version: '1.8'
69
69
  - !ruby/object:Gem::Dependency
70
- name: json
70
+ name: addressable
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '1.8'
75
+ version: '2.3'
76
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: '1.8'
82
+ version: '2.3'
83
83
  description: Finix Ruby Client
84
84
  email:
85
85
  - support@finixpayments.com