tarpon 0.3.1 → 0.4.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: 26bbc91ee368037baee3d85fa6271832140444241e8569fb43b053aa9051a56a
4
- data.tar.gz: b8d8565264058d8c01df8409264560d44f739f2560a0ecdc39539cea99dfd363
3
+ metadata.gz: 9ca9c5d848e253fa9a464b757e8c8bd6457402233a87ef3c0fad624deb51323d
4
+ data.tar.gz: e4a58e820eafd48096f00aee5954187427fea273374d8abeb550185c6f95784e
5
5
  SHA512:
6
- metadata.gz: 06d81dc83b4a9e21b88a8cd6ccb5740229724d0598cc00a0dd167058a2f14ceb9362ca730c6e0d178d79ac7c19b197da18e6c2406895b9b408c2f0a3368bfbee
7
- data.tar.gz: 210bbeb7e75b62847d3444862a7a64b8cf81d9f3c47145a93fe71f609ebc3581bf37d160a233f64d054f1cbd15a814026492f74bdae787b99ea4a4a90c877fd1
6
+ metadata.gz: 07c5e934acf193a1811f6b2491381e5a6728756a00f46c2f899ecb0a975a39156f3d9df6ee76ba720b91a1a76a0a3eb7a22314af59e2f9d7fd96e33b7d782314
7
+ data.tar.gz: ba78c1e53736671041b5768d44c624747ed598d06745589c2449c0d5c18566669b3bf9d271f050ea737a55d095b1444f43ff06511d2137061c6dfb3813a9a360
@@ -17,8 +17,8 @@ module Tarpon
17
17
  @entitlements.select(&:active?)
18
18
  end
19
19
 
20
- def each
21
- @entitlements.each { |e| yield e }
20
+ def each(&block)
21
+ @entitlements.each(&block)
22
22
  end
23
23
  end
24
24
  end
@@ -12,12 +12,12 @@ module Tarpon
12
12
  def initialize(current_offering_id:, offerings:, **)
13
13
  @current_offering_id = current_offering_id
14
14
  @offerings = offerings.each_with_object({}) do |offering, map|
15
- map[offering[:identifier].to_sym] = Tarpon::Entity::Offering.new(offering)
15
+ map[offering[:identifier].to_sym] = Tarpon::Entity::Offering.new(**offering)
16
16
  end
17
17
  end
18
18
 
19
- def each
20
- @offerings.each { |o| yield o }
19
+ def each(&block)
20
+ @offerings.each(&block)
21
21
  end
22
22
 
23
23
  def [](identifier)
@@ -18,7 +18,7 @@ module Tarpon
18
18
  .auth("Bearer #{api_key(key)}")
19
19
  .headers(headers.merge(DEFAULT_HEADERS))
20
20
  .send(method, "#{Client.base_uri}#{path}", json: body&.compact)
21
- .yield_self { |http_response| handle_response(http_response) }
21
+ .then { |http_response| handle_response(http_response) }
22
22
  rescue HTTP::TimeoutError => e
23
23
  raise Tarpon::TimeoutError, e
24
24
  end
@@ -5,6 +5,7 @@ module Tarpon
5
5
  class Subscriber
6
6
  class Entitlement < Base
7
7
  def initialize(subscriber_path:, entitlement_identifier:)
8
+ super()
8
9
  @subscriber_path = subscriber_path
9
10
  @entitlement_identifier = entitlement_identifier
10
11
  end
@@ -7,6 +7,7 @@ module Tarpon
7
7
  class Subscriber
8
8
  class Offering < Base
9
9
  def initialize(subscriber_path:)
10
+ super()
10
11
  @subscriber_path = subscriber_path
11
12
  end
12
13
 
@@ -14,7 +15,7 @@ module Tarpon
14
15
  response = perform(method: :get, path: path.to_s, headers: { 'x-platform': platform.to_s }, key: :public)
15
16
  return response unless response.success?
16
17
 
17
- Tarpon::Entity::Offerings.new(response.raw)
18
+ Tarpon::Entity::Offerings.new(**response.raw)
18
19
  end
19
20
 
20
21
  private
@@ -5,6 +5,7 @@ module Tarpon
5
5
  class Subscriber
6
6
  class Subscription < Base
7
7
  def initialize(subscriber_path:, product_id:)
8
+ super()
8
9
  @subscriber_path = subscriber_path
9
10
  @product_id = product_id
10
11
  end
@@ -4,14 +4,13 @@ module Tarpon
4
4
  module Request
5
5
  class Subscriber < Base
6
6
  def initialize(app_user_id:)
7
+ super()
7
8
  @app_user_id = app_user_id
8
9
  end
9
10
 
10
- # rubocop:disable Naming/AccessorMethodName
11
- def get_or_create
11
+ def get_or_create # rubocop:disable Naming/AccessorMethodName
12
12
  perform(method: :get, path: path, key: :public)
13
13
  end
14
- # rubocop:enable Naming/AccessorMethodName
15
14
 
16
15
  def delete
17
16
  perform(method: :delete, path: path, key: :secret)
@@ -7,7 +7,7 @@ module Tarpon
7
7
  def initialize(status, attributes)
8
8
  @status = status
9
9
  @raw = attributes
10
- @subscriber = @raw[:subscriber].nil? ? nil : Entity::Subscriber.new(@raw[:subscriber])
10
+ @subscriber = @raw[:subscriber] && Entity::Subscriber.new(@raw[:subscriber])
11
11
  end
12
12
 
13
13
  def message
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tarpon
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarpon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Belo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-08 00:00:00.000000000 Z
11
+ date: 2022-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -16,98 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.3'
19
+ version: '4.4'
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: '4.3'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
26
+ version: '4.4'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: factory_bot
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '5.1'
33
+ version: '6.2'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '5.1'
40
+ version: '6.2'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '12.3'
47
+ version: '13.0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '12.3'
54
+ version: '13.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rspec
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '3.0'
61
+ version: '3.11'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: '3.0'
68
+ version: '3.11'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rubocop
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '0.80'
75
+ version: '1.29'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '0.80'
82
+ version: '1.29'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: webmock
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '3.8'
89
+ version: '3.14'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '3.8'
96
+ version: '3.14'
111
97
  description: A Ruby interface to RevenueCat REST API
112
98
  email:
113
99
  - igor.belo@fishbrain.com
@@ -139,7 +125,8 @@ metadata:
139
125
  homepage_uri: https://github.com/fishbrain/tarpon
140
126
  source_code_uri: https://github.com/fishbrain/tarpon.git
141
127
  changelog_uri: https://github.com/fishbrain/tarpon/blob/master/CHANGELOG.md
142
- post_install_message:
128
+ rubygems_mfa_required: 'true'
129
+ post_install_message:
143
130
  rdoc_options: []
144
131
  require_paths:
145
132
  - lib
@@ -147,15 +134,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
147
134
  requirements:
148
135
  - - ">="
149
136
  - !ruby/object:Gem::Version
150
- version: '0'
137
+ version: '2.7'
151
138
  required_rubygems_version: !ruby/object:Gem::Requirement
152
139
  requirements:
153
140
  - - ">="
154
141
  - !ruby/object:Gem::Version
155
142
  version: '0'
156
143
  requirements: []
157
- rubygems_version: 3.1.6
158
- signing_key:
144
+ rubygems_version: 3.3.12
145
+ signing_key:
159
146
  specification_version: 4
160
147
  summary: A Ruby interface to RevenueCat REST API
161
148
  test_files: []