sendle_api 0.1.0 → 0.1.4

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: 386a566c5290868a2c87a9fa784d326a4414ff460e94cb72df849a90f2b797a3
4
- data.tar.gz: add9b3a6795ba309494b21d0a634870d49a5d9107854b3eacc31b5ed332cef15
3
+ metadata.gz: a80399749f497c0cfb91bbf482a96ad8a41b74c7c759014ea6cfc755b7f2127b
4
+ data.tar.gz: 790d234ef4b3f8dda30f789e8a92f99663df66fd3e2a8693c02502346811494c
5
5
  SHA512:
6
- metadata.gz: 5dbb20a21b4a87bf642f70d930967a5e7bd8d1194921519b8dc8682659506ab300a54d5cb36dbec02cc35b188c580282c3fe796c0d9b76462712c799b0a32a9c
7
- data.tar.gz: 1af00478d6980c7ba3d06f24d53b9fc50ab274e6658daf2a5ccd350cc81e106a074f0133fb3e20bdaee681edd7cc7b3d02ac989ff083fb4f2dd3104595dc6b4b
6
+ metadata.gz: e596d9496665068ac763770b8d99f6bd40e302b1055235fce94372020af86e311adcc200f967da4579dba9f4afd7f8b847feffa239eb5e9d609865e29c32cf58
7
+ data.tar.gz: f4073cfbfe00bb060522da79de8d680ebd68fbc3892678fed7612738369787281902a942c0d345b1e02aa3c1a544ec1d678616f7fd7a1f309598b8d1fa1ed05d
data/.rubocop.yml ADDED
@@ -0,0 +1,43 @@
1
+ inherit_gem:
2
+ rubocop-shopify: rubocop.yml
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+
7
+ Layout/FirstArrayElementLineBreak:
8
+ Enabled: true
9
+
10
+ Layout/FirstMethodArgumentLineBreak:
11
+ Enabled: true
12
+
13
+ Layout/FirstArgumentIndentation:
14
+ Enabled: true
15
+ EnforcedStyle: consistent
16
+
17
+ Layout/FirstParameterIndentation:
18
+ Enabled: true
19
+ EnforcedStyle: consistent
20
+
21
+ Layout/MultilineMethodArgumentLineBreaks:
22
+ Enabled: true
23
+
24
+ Layout/MultilineOperationIndentation:
25
+ Enabled: true
26
+
27
+ Style/MethodCallWithArgsParentheses:
28
+ Enabled: true
29
+ IgnoreMacros: true
30
+ IgnoredMethods:
31
+ - require
32
+ - require_relative
33
+ - require_dependency
34
+ - yield
35
+ - raise
36
+ - puts
37
+ - to
38
+ - not_to
39
+ - to_not
40
+ - describe
41
+ Exclude:
42
+ - "**/Gemfile"
43
+ - "db/**/*"
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source "https://rubygems.org"
2
3
 
3
4
  # Specify your gem's dependencies in sendle_api.gemspec
@@ -1,12 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  module SendleAPI
2
3
  class Base < ::ActiveResource::Base
3
-
4
4
  validate :child_object_validations
5
5
 
6
6
  self.include_root_in_json = false
7
7
  self.include_format_in_path = false
8
8
  self.connection_class = Connection
9
- self.prefix = '/api/'
9
+ self.prefix = "/api/"
10
10
 
11
11
  def initialize(attributes = {}, persisted = false)
12
12
  if defined?(self.class::DEFAULT_ATTRS)
@@ -19,7 +19,7 @@ module SendleAPI
19
19
  self.class.validate_configs
20
20
  super
21
21
  end
22
-
22
+
23
23
  def errors
24
24
  @errors ||= Errors.new(self)
25
25
  end
@@ -29,11 +29,11 @@ module SendleAPI
29
29
  def child_object_validations
30
30
  if defined?(self.class::CHILD_OBJECT_KEYS_FOR_VALIDATION)
31
31
  self.class::CHILD_OBJECT_KEYS_FOR_VALIDATION.each do |obj|
32
- if !attributes[obj].nil? && !send(obj).valid?
33
- send(obj).errors.messages.each do |msg_key, messages|
34
- messages.each do |message|
35
- errors.add("#{obj}_#{msg_key}".to_sym, message)
36
- end
32
+ next unless !attributes[obj].nil? && !send(obj).valid?
33
+
34
+ send(obj).errors.messages.each do |msg_key, messages|
35
+ messages.each do |message|
36
+ errors.add("#{obj}_#{msg_key}".to_sym, message)
37
37
  end
38
38
  end
39
39
  end
@@ -41,10 +41,9 @@ module SendleAPI
41
41
  end
42
42
 
43
43
  class << self
44
-
45
44
  def set_site
46
45
  self.site = if SendleAPI.config.testing?
47
- "https://#{basic_auth_details}@sandbox.sendle.com"
46
+ "https://#{basic_auth_details}@sandbox.sendle.com"
48
47
  else
49
48
  "https://#{basic_auth_details}@api.sendle.com"
50
49
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SendleAPI
4
+ class Product < Base
5
+ include NotSaveable
6
+
7
+ self.prefix = "/api/products"
8
+ self.element_name = ""
9
+ end
10
+ end
@@ -3,4 +3,4 @@ module SendleAPI
3
3
  self.prefix = "/api/tracking"
4
4
  self.element_name = ""
5
5
  end
6
- end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module SendleAPI
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/sendle_api.rb CHANGED
@@ -19,4 +19,5 @@ module SendleAPI
19
19
  require "sendle_api/resources/volume"
20
20
  require "sendle_api/resources/weight"
21
21
  require "sendle_api/resources/order"
22
+ require "sendle_api/resources/product"
22
23
  end
data/sendle_api.gemspec CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative "lib/sendle_api/version"
2
3
 
3
4
  Gem::Specification.new do |spec|
@@ -20,19 +21,22 @@ Gem::Specification.new do |spec|
20
21
  # Specify which files should be added to the gem when it is released.
21
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
23
  spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
23
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ %x(git ls-files -z).split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
25
  end
25
26
  spec.bindir = "exe"
26
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
28
  spec.require_paths = ["lib"]
28
29
 
29
- spec.add_dependency "activeresource", "~> 5.0"
30
- spec.add_dependency "countries", "~> 3.0"
31
- spec.add_dependency "phonelib", "~> 0.6"
30
+ spec.add_dependency("activeresource", ">= 4.1.0")
31
+ spec.add_dependency("countries", "~> 3.0")
32
+ spec.add_dependency("phonelib", "~> 0.6")
32
33
 
33
- spec.add_development_dependency "rspec", "~> 3.2"
34
- spec.add_development_dependency "dotenv"
35
- spec.add_development_dependency "pry-byebug"
36
- spec.add_development_dependency "pry"
37
- spec.add_development_dependency "guard-rspec"
34
+ spec.add_development_dependency("rspec", "~> 3.2")
35
+ spec.add_development_dependency("dotenv")
36
+ spec.add_development_dependency("pry-byebug")
37
+ spec.add_development_dependency("pry")
38
+ spec.add_development_dependency("guard-rspec")
39
+ spec.add_development_dependency("rubocop")
40
+ spec.add_development_dependency("rubocop-shopify")
41
+ spec.metadata["rubygems_mfa_required"] = "true"
38
42
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendle_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
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-06-24 00:00:00.000000000 Z
11
+ date: 2022-04-12 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
@@ -122,7 +122,35 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description:
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-shopify
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ description:
126
154
  email:
127
155
  - andygg1996personal@gmail.com
128
156
  executables: []
@@ -131,6 +159,7 @@ extra_rdoc_files: []
131
159
  files:
132
160
  - ".gitignore"
133
161
  - ".rspec"
162
+ - ".rubocop.yml"
134
163
  - ".travis.yml"
135
164
  - CODE_OF_CONDUCT.md
136
165
  - Gemfile
@@ -150,6 +179,7 @@ files:
150
179
  - lib/sendle_api/resources/base.rb
151
180
  - lib/sendle_api/resources/contact.rb
152
181
  - lib/sendle_api/resources/order.rb
182
+ - lib/sendle_api/resources/product.rb
153
183
  - lib/sendle_api/resources/receiver.rb
154
184
  - lib/sendle_api/resources/sender.rb
155
185
  - lib/sendle_api/resources/tracking.rb
@@ -165,7 +195,8 @@ metadata:
165
195
  homepage_uri: https://github.com/PostCo/sendle_api
166
196
  source_code_uri: https://github.com/PostCo/sendle_api
167
197
  changelog_uri: https://github.com/PostCo/sendle_api/releases
168
- post_install_message:
198
+ rubygems_mfa_required: 'true'
199
+ post_install_message:
169
200
  rdoc_options: []
170
201
  require_paths:
171
202
  - lib
@@ -180,8 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
211
  - !ruby/object:Gem::Version
181
212
  version: '0'
182
213
  requirements: []
183
- rubygems_version: 3.0.3
184
- signing_key:
214
+ rubygems_version: 3.2.32
215
+ signing_key:
185
216
  specification_version: 4
186
217
  summary: Ruby object based Sendle API wrapper.
187
218
  test_files: []