janio_api 0.3.9 → 0.3.11

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: 2a01c1c92ad1aa9f4b1b72fd6991aa51d14bd8802587edfb213b911ee7d98821
4
- data.tar.gz: 4fcb1948a614241a02c1c5f2051f7b235fe6745a0e58bccdbb4e4790a6e393af
3
+ metadata.gz: 65d944111d02172422320f061f19faf62123c4dec6fc2608f6b98da9c9235224
4
+ data.tar.gz: '08df2ffcbcbb9dec2f926cfe9db5ca4d18beb2fa0eaa2bbd8451a0f73e1466f5'
5
5
  SHA512:
6
- metadata.gz: 721d00f159ad57d14a48989f09554099cdf7308c6d983e15914a1c0263d4f98284506d3b832982caa49f205ab08457dee11f6969e92fd64c770a7528f6ab6d52
7
- data.tar.gz: 717bc65c6f9048e8e732aba4374ec5e5c3594552a48562a69d79772ff363168d92470dbf47a627712220bc79bd41b6842658e942be7f116fde10f0a9d8bcb273
6
+ metadata.gz: c544ee6bbe02b2f109507d1107d1ba0292b89c1112946aec0662c54842f03cefe9fbb3c7b6ff9949da45783735471b4c9cec9662c54c446f9d0685a6195854cb
7
+ data.tar.gz: f2f8f78a58c12b2011ef462ad75d4e0fbc69897725990b6e3298d2600a712146a4a6c8677b22c519a703000391f3506beb0d47527152a7539c65f584e0d59ece
data/janio_api.gemspec CHANGED
@@ -26,10 +26,11 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "activeresource", "~> 5.0"
29
+ spec.add_dependency "activeresource", ">= 4.1.0"
30
30
  spec.add_dependency "countries", "~> 3.0"
31
31
  spec.add_dependency "phonelib", "~> 0.6"
32
32
 
33
+ spec.add_development_dependency "zeitwerk", "~> 2.1", ">= 2.1.8"
33
34
  spec.add_development_dependency "rspec", "~> 3.2"
34
35
  spec.add_development_dependency "dotenv"
35
36
  spec.add_development_dependency "pry-byebug"
@@ -62,7 +62,6 @@ module JanioAPI
62
62
  :consignee_name, :consignee_country, :consignee_address, :consignee_state, :consignee_email,
63
63
  :pickup_contact_name, :pickup_country, :pickup_address, :pickup_state, presence: true
64
64
 
65
- validates :pickup_date, presence: true, if: -> { PICKUP_DATE_ACCEPTED_COUNTRIES.include?(pickup_country) }
66
65
  validates :pickup_date, absence: true, if: -> { !PICKUP_DATE_ACCEPTED_COUNTRIES.include?(pickup_country) }
67
66
  validates :pickup_country, inclusion: {
68
67
  in: SUPPORTED_PICKUP_COUNTRIES,
@@ -86,6 +85,21 @@ module JanioAPI
86
85
  validate :route_supported?
87
86
 
88
87
  class << self
88
+ def with_custom_url(host, path, &action)
89
+ old_host = self.site
90
+ old_path = self.prefix
91
+
92
+ self.site = URI.parse(host)
93
+ self.prefix = path
94
+
95
+ result = action.call
96
+
97
+ self.site = old_host
98
+ self.prefix = old_path
99
+
100
+ result
101
+ end
102
+
89
103
  def tracking_path
90
104
  "/api/tracker/query-by-tracking-nos/"
91
105
  end
@@ -1,3 +1,3 @@
1
1
  module JanioAPI
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.11"
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: janio_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2023-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: 4.1.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: '5.0'
26
+ version: 4.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: countries
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,26 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: zeitwerk
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.1'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.1.8
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.1'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.1.8
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: rspec
57
77
  requirement: !ruby/object:Gem::Requirement
@@ -122,7 +142,7 @@ dependencies:
122
142
  - - ">="
123
143
  - !ruby/object:Gem::Version
124
144
  version: '0'
125
- description:
145
+ description:
126
146
  email:
127
147
  - andygg1996personal@gmail.com
128
148
  executables: []
@@ -162,7 +182,7 @@ metadata:
162
182
  homepage_uri: https://github.com/PostCo/janio_api
163
183
  source_code_uri: https://github.com/PostCo/janio_api
164
184
  changelog_uri: https://github.com/PostCo/janio_api/releases
165
- post_install_message:
185
+ post_install_message:
166
186
  rdoc_options: []
167
187
  require_paths:
168
188
  - lib
@@ -177,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
197
  - !ruby/object:Gem::Version
178
198
  version: '0'
179
199
  requirements: []
180
- rubygems_version: 3.0.3
181
- signing_key:
200
+ rubygems_version: 3.2.33
201
+ signing_key:
182
202
  specification_version: 4
183
203
  summary: Ruby object based Janio API wrapper.
184
204
  test_files: []