lightspeed_pos 0.5.0 → 0.6.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: 1e2ccc9d7b837af97952f9a141a039cd51a33738afd4a73b84c6fc5fcdea3785
4
- data.tar.gz: 6d83e4ae0b235fce32b917ba87991551323d268ade82e3141ba322160cf3a463
3
+ metadata.gz: 698710d57a5ef3c30c022c2f050b9df04976227b2482a3075c851b27db3642fe
4
+ data.tar.gz: 6abdc460a2cd345883c2cb853c9c6c16051273606914d7ba5fcaa72089402dae
5
5
  SHA512:
6
- metadata.gz: 85166fc067120f76b26cfb2234bfdda912118a301e547cd81de0d6f18c04dbabec4ee7c69388bb80761c3be0225426b341e08124b2c6330cc6153d0934f18ef1
7
- data.tar.gz: fd605b19b54e1bd31486b1a144ababadef69834666cc6cfa50c28b91bf92290ca6df738f67bc39d2bf80d81978fce114c0c2a80d1e2c53252dc1d75392e1842c
6
+ metadata.gz: 03f3b9db98a4145a9751b2990beabccf96d79a78fece26a40a3163ffe0d8604ea41ad0316b52ce9a3e27f77fea1e6cb0ce708438bc37c22cacef0a0401ef9245
7
+ data.tar.gz: 3c8f3710b4f8e76bda81e5e02265115c0252c38b8c177ff707c9dab53026da1d8598504d77ae9d31c3a17a0cfa2796d5cd293355b25b7c8aeca4e44762e26830
data/.rubocop.yml CHANGED
@@ -2,6 +2,9 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  NewCops: enable
5
+ SuggestExtensions:
6
+ rubocop-rake: false
7
+ rubocop-rspec: false
5
8
 
6
9
  Layout/HashAlignment:
7
10
  EnforcedLastArgumentHashStyle: always_ignore
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.5
4
4
  - 2.6
5
5
  - 2.7
6
+ - 3.0
6
7
  script:
7
8
  - 'bundle exec rubocop'
8
9
  - 'bundle exec rspec spec'
@@ -13,7 +13,7 @@ module Lightspeed
13
13
  first_loaded || first
14
14
  end
15
15
 
16
- def page(n, *args)
16
+ def page(n, **args)
17
17
  # turns out lightspeed doesn't respect pagination for accounts.
18
18
  # so page(1) is identical to page(0).
19
19
  # they should be different, thus.
@@ -176,7 +176,7 @@ module Lightspeed
176
176
  params = { load_relations: load_relations_default }
177
177
  .merge(context_params)
178
178
  .merge(params)
179
- .reject { |_, v| v.nil? }
179
+ .compact
180
180
  client.get(
181
181
  path: collection_path,
182
182
  params: params
@@ -3,10 +3,15 @@
3
3
  module Lightspeed
4
4
  class Error < Exception
5
5
  class BadRequest < Lightspeed::Error; end # 400
6
+
6
7
  class Unauthorized < Lightspeed::Error; end # 401
8
+
7
9
  class NotAuthorized < Lightspeed::Error; end # 403
10
+
8
11
  class NotFound < Lightspeed::Error; end # 404
12
+
9
13
  class InternalServerError < Lightspeed::Error; end # 500
14
+
10
15
  class Throttled < Lightspeed::Error; end # 503
11
16
  end
12
17
  end
@@ -108,7 +108,7 @@ module Lightspeed
108
108
 
109
109
  def uri
110
110
  uri = self.class.base_path + @path
111
- uri += "?" + URI.encode_www_form(@params) if @params && @method == :get
111
+ uri += "?#{URI.encode_www_form(@params)}" if @params && @method == :get
112
112
  uri
113
113
  end
114
114
 
@@ -8,7 +8,7 @@ require_relative 'collection'
8
8
 
9
9
  module Lightspeed
10
10
  class ID < Integer; end
11
- class Link; end
11
+ class Link; end # rubocop:disable Lint/EmptyClass
12
12
  class Resource
13
13
  attr_accessor :id, :attributes, :client, :context, :account
14
14
 
@@ -48,8 +48,7 @@ module Lightspeed
48
48
  if value.is_a?(String)
49
49
  case kind
50
50
  when :string then value
51
- when :integer then value.to_i
52
- when :id then value.to_i
51
+ when :id, :integer then value.to_i
53
52
  when :datetime then DateTime.parse(value)
54
53
  when :boolean then value == 'true'
55
54
  when :decimal then BigDecimal(value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lightspeed
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
  spec.license = "MIT"
22
22
 
23
+ spec.required_ruby_version = '>= 2.5'
24
+
23
25
  spec.add_dependency "activesupport"
24
26
  spec.add_dependency "yajl-ruby"
25
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightspeed_pos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-21 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -225,14 +225,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: '0'
228
+ version: '2.5'
229
229
  required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  requirements:
231
231
  - - ">="
232
232
  - !ruby/object:Gem::Version
233
233
  version: '0'
234
234
  requirements: []
235
- rubygems_version: 3.1.2
235
+ rubygems_version: 3.2.3
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: A gem for interacting with Lightspeed's Point of Sale system