freight_kit 0.1.6 → 0.1.10

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: 5bb1051ac995d28473b5fcb35cb85bf3181a6d2874c0e0b01f41c1e423bfdc86
4
- data.tar.gz: '03092ee7aba7b6d583005fd654d1e082c7195cf8214af214a790e41bd0d00946'
3
+ metadata.gz: 0ba121940e4aee8d935c8271965ae2e664b689e6bbd77b1384734dec700418b8
4
+ data.tar.gz: 4d16dff72f36cc1a0bbb0439c54924669afa5d58df9b13bc532d6bad7ca54c02
5
5
  SHA512:
6
- metadata.gz: a4858ab40037dba5c0eb149dab152739497ec3fdb371bd92cdde086e42bc2ba36431b64105977b13167a6d1e0bdc22c576c20d4d3549a26d580a7e05dd88534b
7
- data.tar.gz: 936f22a331fc9626be65d40fe369588d7c3621292ce3727d8c97ac2f2f9c37a8dc8c9ec55709441ffdb5ea3e833e0110cd58e7f08f692bcf2b15ad2949c163ca
6
+ metadata.gz: 06b93550859d6e45c09d836a11f030f91844573aaafdc0407d4fee98664ec8807ced4752275780eda52cb926235e1ab3eeecd075eeeb766cb7a6bb254d67fb41
7
+ data.tar.gz: de761d4e2b158d605e864f42e35c374c1c3b4bfda369eb55994d47ea71f5a1cb65b3007dd85be5b5584fdc006dd03a48d1dfc4fea1ab983d8488aba1acce9c42
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- freight_kit (0.1.5)
4
+ freight_kit (0.1.9)
5
5
  active_utils (>= 3.3.1, < 3.5.0)
6
- activemodel (>= 4.2, < 7.1.4)
7
- activesupport (>= 4.2, < 7.1.4)
6
+ activemodel (>= 4.2, < 8.0.1)
7
+ activesupport (>= 4.2, < 7.2.3)
8
8
  business_time (~> 0.13.0)
9
9
  httparty (~> 0.10)
10
- measured (>= 2.0, < 2.8.3)
10
+ measured (>= 2.0, < 3.1.1)
11
11
  mimemagic (~> 0.4.3)
12
12
  nokogiri (>= 1.6, < 1.17)
13
13
  place_kit (~> 0.0.2)
14
14
  savon (>= 2.0, < 2.16)
15
15
  tzinfo-data (~> 1.2023, >= 1.2023.3)
16
16
  watir (>= 7.0, < 7.4)
17
- zeitwerk (>= 2.6.0, < 2.6.14)
17
+ zeitwerk (>= 2.6.0, < 2.7.2)
18
18
 
19
19
  GEM
20
20
  remote: https://rubygems.org/
@@ -35,14 +35,14 @@ GEM
35
35
  gyoku (>= 0.4.0)
36
36
  nokogiri
37
37
  ast (2.4.2)
38
- base64 (0.1.1)
38
+ bigdecimal (3.1.8)
39
39
  builder (3.2.4)
40
40
  business_time (0.13.0)
41
41
  activesupport (>= 3.2.0)
42
42
  tzinfo
43
43
  concurrent-ruby (1.2.2)
44
44
  diff-lcs (1.5.0)
45
- faker (3.2.1)
45
+ faker (3.5.1)
46
46
  i18n (>= 1.8.11, < 2)
47
47
  fastcsv (0.0.7)
48
48
  gyoku (1.4.0)
@@ -56,7 +56,7 @@ GEM
56
56
  socksify
57
57
  i18n (1.14.1)
58
58
  concurrent-ruby (~> 1.0)
59
- json (2.6.3)
59
+ json (2.7.2)
60
60
  language_server-protocol (3.17.0.3)
61
61
  measured (2.8.2)
62
62
  activesupport (>= 5.2)
@@ -66,13 +66,14 @@ GEM
66
66
  mini_mime (1.1.5)
67
67
  mini_portile2 (2.8.4)
68
68
  minitest (5.20.0)
69
- multi_xml (0.6.0)
69
+ multi_xml (0.7.1)
70
+ bigdecimal (~> 3.1)
70
71
  nokogiri (1.13.10)
71
72
  mini_portile2 (~> 2.8.0)
72
73
  racc (~> 1.4)
73
74
  nori (2.6.0)
74
- parallel (1.23.0)
75
- parser (3.2.2.3)
75
+ parallel (1.25.1)
76
+ parser (3.3.2.0)
76
77
  ast (~> 2.4.1)
77
78
  racc
78
79
  place_kit (0.0.2)
@@ -82,7 +83,7 @@ GEM
82
83
  racc (1.7.1)
83
84
  rack (3.0.8)
84
85
  rainbow (3.1.1)
85
- rake (13.1.0)
86
+ rake (13.2.1)
86
87
  redcarpet (3.6.0)
87
88
  regexp_parser (2.9.0)
88
89
  rexml (3.2.6)
@@ -99,44 +100,38 @@ GEM
99
100
  diff-lcs (>= 1.2.0, < 2.0)
100
101
  rspec-support (~> 3.12.0)
101
102
  rspec-support (3.12.1)
102
- rubocop (1.56.2)
103
- base64 (~> 0.1.1)
103
+ rubocop (1.64.1)
104
104
  json (~> 2.3)
105
105
  language_server-protocol (>= 3.17.0)
106
106
  parallel (~> 1.10)
107
- parser (>= 3.2.2.3)
107
+ parser (>= 3.3.0.2)
108
108
  rainbow (>= 2.2.2, < 4.0)
109
109
  regexp_parser (>= 1.8, < 3.0)
110
110
  rexml (>= 3.2.5, < 4.0)
111
- rubocop-ast (>= 1.28.1, < 2.0)
111
+ rubocop-ast (>= 1.31.1, < 2.0)
112
112
  ruby-progressbar (~> 1.7)
113
113
  unicode-display_width (>= 2.4.0, < 3.0)
114
- rubocop-ast (1.29.0)
115
- parser (>= 3.2.1.0)
116
- rubocop-capybara (2.18.0)
117
- rubocop (~> 1.41)
118
- rubocop-factory_bot (2.23.1)
119
- rubocop (~> 1.33)
120
- rubocop-graphql (1.4.0)
114
+ rubocop-ast (1.31.3)
115
+ parser (>= 3.3.1.0)
116
+ rubocop-graphql (1.5.2)
121
117
  rubocop (>= 0.90, < 2)
122
- rubocop-next (1.0.6)
123
- rubocop (~> 1.56.0)
124
- rubocop-graphql (~> 1.4.0)
125
- rubocop-rails (~> 2.20.2)
118
+ rubocop-next (1.0.7)
119
+ rubocop (>= 1.56, < 1.65)
120
+ rubocop-graphql (>= 1.4, < 1.6)
121
+ rubocop-rails (>= 2.20.2, < 2.26.0)
126
122
  rubocop-rake (~> 0.6.0)
127
- rubocop-rspec (~> 2.23.2)
128
- rubocop-shopify (~> 2.14.0)
129
- rubocop-rails (2.20.2)
123
+ rubocop-rspec (>= 2.23.2, < 3.1.0)
124
+ rubocop-shopify (>= 2.14, < 2.16)
125
+ rubocop-rails (2.25.0)
130
126
  activesupport (>= 4.2.0)
131
127
  rack (>= 1.1)
132
128
  rubocop (>= 1.33.0, < 2.0)
129
+ rubocop-ast (>= 1.31.1, < 2.0)
133
130
  rubocop-rake (0.6.0)
134
131
  rubocop (~> 1.0)
135
- rubocop-rspec (2.23.2)
136
- rubocop (~> 1.33)
137
- rubocop-capybara (~> 2.17)
138
- rubocop-factory_bot (~> 2.22)
139
- rubocop-shopify (2.14.0)
132
+ rubocop-rspec (3.0.1)
133
+ rubocop (~> 1.61)
134
+ rubocop-shopify (2.15.1)
140
135
  rubocop (~> 1.51)
141
136
  ruby-progressbar (1.13.0)
142
137
  rubyzip (2.3.2)
@@ -157,7 +152,7 @@ GEM
157
152
  concurrent-ruby (~> 1.0)
158
153
  tzinfo-data (1.2023.3)
159
154
  tzinfo (>= 1.0.0)
160
- unicode-display_width (2.4.2)
155
+ unicode-display_width (2.5.0)
161
156
  wasabi (3.7.0)
162
157
  addressable
163
158
  httpi (~> 2.0)
@@ -172,14 +167,15 @@ GEM
172
167
  PLATFORMS
173
168
  arm64-darwin-22
174
169
  arm64-darwin-23
170
+ arm64-darwin-24
175
171
 
176
172
  DEPENDENCIES
177
- faker (~> 3.2.1)
173
+ faker (~> 3.5.1)
178
174
  freight_kit!
179
- rake (~> 13.1.0)
175
+ rake (~> 13.2.1)
180
176
  redcarpet (~> 3.6.0)
181
177
  rspec (~> 3.12)
182
- rubocop-next (~> 1.0.3)
178
+ rubocop-next (~> 1.0.7)
183
179
  yard (~> 0.9.28)
184
180
 
185
181
  BUNDLED WITH
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.10
data/freight_kit.gemspec CHANGED
@@ -28,26 +28,26 @@ Gem::Specification.new do |spec|
28
28
  Dir['test/**/*']
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_development_dependency('faker', '~> 3.2.1')
32
- spec.add_development_dependency('rake', '~> 13.1.0')
31
+ spec.add_development_dependency('faker', '~> 3.5.1')
32
+ spec.add_development_dependency('rake', '~> 13.2.1')
33
33
  spec.add_development_dependency('redcarpet', '~> 3.6.0') # for yard
34
34
  spec.add_development_dependency('rspec', '~> 3.12')
35
- spec.add_development_dependency('rubocop-next', '~> 1.0.3')
35
+ spec.add_development_dependency('rubocop-next', '~> 1.0.7')
36
36
  spec.add_development_dependency('yard', '~> 0.9.28')
37
37
 
38
- spec.add_dependency('activemodel', '>= 4.2', '< 7.1.4')
39
- spec.add_dependency('activesupport', '>= 4.2', '< 7.1.4')
38
+ spec.add_dependency('activemodel', '>= 4.2', '< 8.0.1')
39
+ spec.add_dependency('activesupport', '>= 4.2', '< 7.2.3')
40
40
  spec.add_dependency('active_utils', '>= 3.3.1', '< 3.5.0')
41
41
  spec.add_dependency('business_time', '~> 0.13.0')
42
42
  spec.add_dependency('httparty', '~> 0.10')
43
- spec.add_dependency('measured', '>= 2.0', '< 2.8.3')
43
+ spec.add_dependency('measured', '>= 2.0', '< 3.1.1')
44
44
  spec.add_dependency('mimemagic', '~> 0.4.3')
45
45
  spec.add_dependency('nokogiri', '>= 1.6', '< 1.17')
46
46
  spec.add_dependency('place_kit', '~> 0.0.2')
47
47
  spec.add_dependency('savon', '>= 2.0', '< 2.16')
48
48
  spec.add_dependency('tzinfo-data', '~> 1.2023', '>= 1.2023.3')
49
49
  spec.add_dependency('watir', '>= 7.0', '< 7.4')
50
- spec.add_dependency('zeitwerk', '>= 2.6.0', '< 2.6.14')
50
+ spec.add_dependency('zeitwerk', '>= 2.6.0', '< 2.7.2')
51
51
 
52
52
  spec.required_ruby_version = '>= 3.2.0'
53
53
  end
@@ -192,7 +192,7 @@ module FreightKit
192
192
  ),
193
193
  "#{self.class.to_s.split("::")[1].underscore}.yml",
194
194
  )
195
- @conf = YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol])
195
+ @conf = YAML.safe_load_file(conf_path, permitted_classes: [Symbol])
196
196
 
197
197
  @rates_with_excessive_length_fees = @conf.dig(:attributes, :rates, :with_excessive_length_fees)
198
198
  end
@@ -100,7 +100,7 @@ module FreightKit
100
100
  def type=(value)
101
101
  return @type = nil if value.blank?
102
102
 
103
- raise ArgumentError, "type must be one of :#{TYPES.join(", :")}" unless TYPES.include?(value)
103
+ raise ArgumentError, "type must be one of :#{TYPES.join(", :")}" if TYPES.exclude?(value)
104
104
 
105
105
  @type = value
106
106
  end
@@ -39,13 +39,18 @@ module FreightKit # :nodoc:
39
39
  raise ArgumentError, 'Package#new: packaging_type is required' unless packaging_type
40
40
  raise ArgumentError, 'Package#new: quantity is required' unless options[:quantity]
41
41
 
42
- # For backward compatibility
43
- if dimensions.is_a?(Array)
44
- @dimensions = [dimensions].flatten.reject(&:nil?)
45
- else
46
- @dimensions = [dimensions.dig(:height), dimensions.dig(:width), dimensions.dig(:length)]
47
- @dimensions = [@dimensions].flatten.reject(&:nil?)
48
- end
42
+ @dimensions = case dimensions
43
+ when Array
44
+ dimensions.map(&:presence)
45
+ when Hash
46
+ [
47
+ dimensions[:height].presence,
48
+ dimensions[:width].presence,
49
+ dimensions[:length].presence,
50
+ ]
51
+ else
52
+ [nil, nil, nil]
53
+ end
49
54
 
50
55
  @description = options[:description]
51
56
  @hazmat = options[:hazmat] == true
@@ -137,7 +142,7 @@ module FreightKit # :nodoc:
137
142
  end
138
143
 
139
144
  def freight_class
140
- (declared_freight_class.presence || calculated_freight_class)
145
+ declared_freight_class.presence || calculated_freight_class
141
146
  end
142
147
 
143
148
  def length(unit)
@@ -28,7 +28,7 @@ module FreightKit
28
28
  options.symbolize_keys!
29
29
  @options = options
30
30
 
31
- unless VALID_TYPES.include?(type)
31
+ if VALID_TYPES.exclude?(type)
32
32
  raise ArgumentError, "Package#new: `type` should be one of #{VALID_TYPES.join(", ")}"
33
33
  end
34
34
 
@@ -18,7 +18,7 @@ module FreightKit
18
18
  ),
19
19
  "#{parent_class_name}.yml",
20
20
  )
21
- @conf = YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol])
21
+ @conf = YAML.safe_load_file(conf_path, permitted_classes: [Symbol])
22
22
 
23
23
  conf_path = File
24
24
  .join(
@@ -28,7 +28,7 @@ module FreightKit
28
28
  ),
29
29
  "#{self.class.to_s.demodulize.underscore}.yml",
30
30
  )
31
- @conf = @conf.deep_merge(YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol]))
31
+ @conf = @conf.deep_merge(YAML.safe_load_file(conf_path, permitted_classes: [Symbol]))
32
32
 
33
33
  @rates_with_excessive_length_fees = @conf.dig(:attributes, :rates, :with_excessive_length_fees)
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freight_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Third Party Transportation Systems LLC
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-05-25 00:00:00.000000000 Z
14
+ date: 2024-11-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faker
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 3.2.1
22
+ version: 3.5.1
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.1
29
+ version: 3.5.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: 13.1.0
36
+ version: 13.2.1
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 13.1.0
43
+ version: 13.2.1
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: redcarpet
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: 1.0.3
78
+ version: 1.0.7
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: 1.0.3
85
+ version: 1.0.7
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: yard
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  version: '4.2'
107
107
  - - "<"
108
108
  - !ruby/object:Gem::Version
109
- version: 7.1.4
109
+ version: 8.0.1
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ dependencies:
116
116
  version: '4.2'
117
117
  - - "<"
118
118
  - !ruby/object:Gem::Version
119
- version: 7.1.4
119
+ version: 8.0.1
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: activesupport
122
122
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ dependencies:
126
126
  version: '4.2'
127
127
  - - "<"
128
128
  - !ruby/object:Gem::Version
129
- version: 7.1.4
129
+ version: 7.2.3
130
130
  type: :runtime
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ dependencies:
136
136
  version: '4.2'
137
137
  - - "<"
138
138
  - !ruby/object:Gem::Version
139
- version: 7.1.4
139
+ version: 7.2.3
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: active_utils
142
142
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +194,7 @@ dependencies:
194
194
  version: '2.0'
195
195
  - - "<"
196
196
  - !ruby/object:Gem::Version
197
- version: 2.8.3
197
+ version: 3.1.1
198
198
  type: :runtime
199
199
  prerelease: false
200
200
  version_requirements: !ruby/object:Gem::Requirement
@@ -204,7 +204,7 @@ dependencies:
204
204
  version: '2.0'
205
205
  - - "<"
206
206
  - !ruby/object:Gem::Version
207
- version: 2.8.3
207
+ version: 3.1.1
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: mimemagic
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -322,7 +322,7 @@ dependencies:
322
322
  version: 2.6.0
323
323
  - - "<"
324
324
  - !ruby/object:Gem::Version
325
- version: 2.6.14
325
+ version: 2.7.2
326
326
  type: :runtime
327
327
  prerelease: false
328
328
  version_requirements: !ruby/object:Gem::Requirement
@@ -332,7 +332,7 @@ dependencies:
332
332
  version: 2.6.0
333
333
  - - "<"
334
334
  - !ruby/object:Gem::Version
335
- version: 2.6.14
335
+ version: 2.7.2
336
336
  description: Freight carrier API and website abstraction library for transportation
337
337
  management systems (TMS)
338
338
  email:
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
404
  - !ruby/object:Gem::Version
405
405
  version: '0'
406
406
  requirements: []
407
- rubygems_version: 3.4.19
407
+ rubygems_version: 3.5.22
408
408
  signing_key:
409
409
  specification_version: 4
410
410
  summary: Freight carrier API and website abstraction library for transportation management