lightspeed_pos 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -21
- data/.rubocop_todo.yml +2 -16
- data/.travis.yml +2 -2
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/lightspeed/account.rb +2 -0
- data/lib/lightspeed/accounts.rb +2 -0
- data/lib/lightspeed/categories.rb +2 -0
- data/lib/lightspeed/category.rb +2 -0
- data/lib/lightspeed/client.rb +6 -4
- data/lib/lightspeed/collection.rb +2 -0
- data/lib/lightspeed/customer.rb +2 -0
- data/lib/lightspeed/customers.rb +2 -0
- data/lib/lightspeed/employee.rb +2 -0
- data/lib/lightspeed/employees.rb +2 -0
- data/lib/lightspeed/error.rb +2 -0
- data/lib/lightspeed/image.rb +2 -0
- data/lib/lightspeed/images.rb +2 -0
- data/lib/lightspeed/inventories.rb +2 -0
- data/lib/lightspeed/inventory.rb +2 -0
- data/lib/lightspeed/item.rb +1 -0
- data/lib/lightspeed/item_attribute_set.rb +2 -0
- data/lib/lightspeed/item_attribute_sets.rb +2 -0
- data/lib/lightspeed/item_matrices.rb +2 -0
- data/lib/lightspeed/item_matrix.rb +2 -0
- data/lib/lightspeed/items.rb +2 -0
- data/lib/lightspeed/order.rb +2 -0
- data/lib/lightspeed/orders.rb +2 -0
- data/lib/lightspeed/price_level.rb +2 -0
- data/lib/lightspeed/price_levels.rb +2 -0
- data/lib/lightspeed/prices.rb +3 -1
- data/lib/lightspeed/request.rb +2 -0
- data/lib/lightspeed/request_throttler.rb +2 -0
- data/lib/lightspeed/resource.rb +4 -1
- data/lib/lightspeed/sale.rb +2 -0
- data/lib/lightspeed/sale_line.rb +2 -0
- data/lib/lightspeed/sale_lines.rb +2 -0
- data/lib/lightspeed/sales.rb +2 -0
- data/lib/lightspeed/shop.rb +2 -0
- data/lib/lightspeed/shops.rb +2 -0
- data/lib/lightspeed/special_order.rb +2 -0
- data/lib/lightspeed/special_orders.rb +2 -0
- data/lib/lightspeed/vendor.rb +2 -0
- data/lib/lightspeed/vendors.rb +2 -0
- data/lib/lightspeed/version.rb +3 -1
- data/lib/lightspeed_pos.rb +2 -0
- data/lightspeed_pos.gemspec +1 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e2ccc9d7b837af97952f9a141a039cd51a33738afd4a73b84c6fc5fcdea3785
|
4
|
+
data.tar.gz: 6d83e4ae0b235fce32b917ba87991551323d268ade82e3141ba322160cf3a463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85166fc067120f76b26cfb2234bfdda912118a301e547cd81de0d6f18c04dbabec4ee7c69388bb80761c3be0225426b341e08124b2c6330cc6153d0934f18ef1
|
7
|
+
data.tar.gz: fd605b19b54e1bd31486b1a144ababadef69834666cc6cfa50c28b91bf92290ca6df738f67bc39d2bf80d81978fce114c0c2a80d1e2c53252dc1d75392e1842c
|
data/.rubocop.yml
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
-
|
3
|
+
AllCops:
|
4
|
+
NewCops: enable
|
5
|
+
|
6
|
+
Layout/HashAlignment:
|
4
7
|
EnforcedLastArgumentHashStyle: always_ignore
|
5
8
|
|
6
|
-
|
9
|
+
Layout/ParameterAlignment:
|
7
10
|
Enabled: false
|
8
11
|
|
9
|
-
LineLength:
|
12
|
+
Layout/LineLength:
|
10
13
|
Max: 180
|
11
14
|
|
12
|
-
ClassLength:
|
15
|
+
Metrics/ClassLength:
|
13
16
|
Enabled: true
|
14
17
|
Severity: refactor
|
15
18
|
Max: 300
|
16
19
|
|
17
|
-
MethodLength:
|
20
|
+
Metrics/MethodLength:
|
18
21
|
Enabled: true
|
19
22
|
Max: 30
|
20
23
|
Severity: refactor
|
21
24
|
|
22
|
-
CyclomaticComplexity:
|
25
|
+
Metrics/CyclomaticComplexity:
|
23
26
|
Max: 10
|
24
27
|
Severity: refactor
|
25
28
|
|
26
|
-
EndAlignment:
|
29
|
+
Layout/EndAlignment:
|
27
30
|
Enabled: false
|
28
31
|
|
29
|
-
StringLiterals:
|
32
|
+
Style/StringLiterals:
|
30
33
|
Enabled: false
|
31
34
|
|
32
|
-
Documentation:
|
35
|
+
Style/Documentation:
|
33
36
|
Enabled: false
|
34
37
|
|
35
|
-
PercentLiteralDelimiters:
|
38
|
+
Style/PercentLiteralDelimiters:
|
36
39
|
PreferredDelimiters:
|
37
40
|
'%w': '{}'
|
38
41
|
|
39
|
-
MethodDefParentheses:
|
42
|
+
Style/MethodDefParentheses:
|
40
43
|
Enabled: false
|
41
44
|
|
42
|
-
PredicateName:
|
43
|
-
|
45
|
+
Naming/PredicateName:
|
46
|
+
ForbiddenPrefixes:
|
44
47
|
- is_
|
45
48
|
- have_
|
46
49
|
|
47
|
-
|
50
|
+
Layout/FirstHashElementIndentation:
|
48
51
|
EnforcedStyle: consistent
|
49
52
|
|
50
53
|
# breaks using if blocks with assignments
|
51
|
-
IndentationWidth:
|
54
|
+
Layout/IndentationWidth:
|
52
55
|
Enabled: false
|
53
56
|
|
54
57
|
Layout/CaseIndentation:
|
55
58
|
EnforcedStyle: end
|
56
59
|
|
57
|
-
FormatString:
|
58
|
-
Enabled: false
|
59
|
-
|
60
|
-
ActionFilter:
|
60
|
+
Style/FormatString:
|
61
61
|
Enabled: false
|
62
62
|
|
63
63
|
# different methods calls that do exactly the same thing are a smell, regardless of semantics
|
64
|
-
SignalException:
|
64
|
+
Style/SignalException:
|
65
65
|
EnforcedStyle: only_raise
|
66
66
|
|
67
|
-
DoubleNegation:
|
67
|
+
Style/DoubleNegation:
|
68
68
|
Enabled: false
|
69
69
|
|
70
70
|
Style/TrailingCommaInArrayLiteral:
|
data/.rubocop_todo.yml
CHANGED
@@ -68,12 +68,6 @@ Layout/EmptyLinesAroundClassBody:
|
|
68
68
|
- 'lib/lightspeed/sale_line.rb'
|
69
69
|
- 'lib/lightspeed/vendor.rb'
|
70
70
|
|
71
|
-
# Offense count: 1
|
72
|
-
# Cop supports --auto-correct.
|
73
|
-
Layout/LeadingBlankLines:
|
74
|
-
Exclude:
|
75
|
-
- 'lib/lightspeed/item.rb'
|
76
|
-
|
77
71
|
# Offense count: 3
|
78
72
|
# Cop supports --auto-correct.
|
79
73
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
@@ -108,7 +102,7 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
108
102
|
# Cop supports --auto-correct.
|
109
103
|
# Configuration parameters: EnforcedStyle.
|
110
104
|
# SupportedStyles: final_newline, final_blank_line
|
111
|
-
Layout/
|
105
|
+
Layout/TrailingEmptyLines:
|
112
106
|
Exclude:
|
113
107
|
- 'lib/lightspeed/customer.rb'
|
114
108
|
- 'lib/lightspeed/customers.rb'
|
@@ -174,7 +168,7 @@ Metrics/BlockLength:
|
|
174
168
|
# Offense count: 2
|
175
169
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
176
170
|
# AllowedNames: io, id, to, by, on, in, at, ip, db
|
177
|
-
Naming/
|
171
|
+
Naming/MethodParameterName:
|
178
172
|
Exclude:
|
179
173
|
- 'lib/lightspeed/accounts.rb'
|
180
174
|
- 'lib/lightspeed/collection.rb'
|
@@ -199,14 +193,6 @@ Style/Alias:
|
|
199
193
|
- 'lib/lightspeed/vendor.rb'
|
200
194
|
- 'lib/lightspeed/vendors.rb'
|
201
195
|
|
202
|
-
# Offense count: 1
|
203
|
-
# Cop supports --auto-correct.
|
204
|
-
# Configuration parameters: EnforcedStyle.
|
205
|
-
# SupportedStyles: braces, no_braces, context_dependent
|
206
|
-
Style/BracesAroundHashParameters:
|
207
|
-
Exclude:
|
208
|
-
- 'spec/lightspeed/sales_spec.rb'
|
209
|
-
|
210
196
|
# Offense count: 1
|
211
197
|
# Cop supports --auto-correct.
|
212
198
|
# Configuration parameters: Keywords.
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/lib/lightspeed/account.rb
CHANGED
data/lib/lightspeed/accounts.rb
CHANGED
data/lib/lightspeed/category.rb
CHANGED
data/lib/lightspeed/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/core_ext/array/wrap'
|
2
4
|
|
3
5
|
require_relative 'accounts'
|
@@ -21,19 +23,19 @@ module Lightspeed
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def get(**args)
|
24
|
-
perform_request(args
|
26
|
+
perform_request(**args, method: :get)
|
25
27
|
end
|
26
28
|
|
27
29
|
def post(**args)
|
28
|
-
perform_request(args
|
30
|
+
perform_request(**args, method: :post)
|
29
31
|
end
|
30
32
|
|
31
33
|
def put(**args)
|
32
|
-
perform_request(args
|
34
|
+
perform_request(**args, method: :put)
|
33
35
|
end
|
34
36
|
|
35
37
|
def delete(**args)
|
36
|
-
perform_request(args
|
38
|
+
perform_request(**args, method: :delete)
|
37
39
|
end
|
38
40
|
|
39
41
|
def oauth_token
|
data/lib/lightspeed/customer.rb
CHANGED
data/lib/lightspeed/customers.rb
CHANGED
data/lib/lightspeed/employee.rb
CHANGED
data/lib/lightspeed/employees.rb
CHANGED
data/lib/lightspeed/error.rb
CHANGED
data/lib/lightspeed/image.rb
CHANGED
data/lib/lightspeed/images.rb
CHANGED
data/lib/lightspeed/inventory.rb
CHANGED
data/lib/lightspeed/item.rb
CHANGED
data/lib/lightspeed/items.rb
CHANGED
data/lib/lightspeed/order.rb
CHANGED
data/lib/lightspeed/orders.rb
CHANGED
data/lib/lightspeed/prices.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/core_ext/string'
|
2
4
|
require 'bigdecimal'
|
3
5
|
|
@@ -8,7 +10,7 @@ module Lightspeed
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def prices
|
11
|
-
@prices ||= @attributes["ItemPrice"].map { |v| [v["useType"].parameterize.underscore.to_sym, BigDecimal
|
13
|
+
@prices ||= @attributes["ItemPrice"].map { |v| [v["useType"].parameterize.underscore.to_sym, BigDecimal(v["amount"])] }.to_h
|
12
14
|
end
|
13
15
|
|
14
16
|
def as_json
|
data/lib/lightspeed/request.rb
CHANGED
data/lib/lightspeed/resource.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bigdecimal'
|
2
4
|
require 'active_support/core_ext/string'
|
3
5
|
require 'active_support/core_ext/hash/slice'
|
@@ -32,6 +34,7 @@ module Lightspeed
|
|
32
34
|
def self.fields(fields = {})
|
33
35
|
@fields ||= []
|
34
36
|
attr_writer(*fields.keys)
|
37
|
+
|
35
38
|
fields.each do |name, klass|
|
36
39
|
@fields << define_method(name) do
|
37
40
|
get_transformed_value(name, klass)
|
@@ -49,7 +52,7 @@ module Lightspeed
|
|
49
52
|
when :id then value.to_i
|
50
53
|
when :datetime then DateTime.parse(value)
|
51
54
|
when :boolean then value == 'true'
|
52
|
-
when :decimal then BigDecimal
|
55
|
+
when :decimal then BigDecimal(value)
|
53
56
|
when :hash then Hash.new(value)
|
54
57
|
else
|
55
58
|
raise ArgumentError, "Could not transform value #{value} to a #{kind}"
|
data/lib/lightspeed/sale.rb
CHANGED
data/lib/lightspeed/sale_line.rb
CHANGED
data/lib/lightspeed/sales.rb
CHANGED
data/lib/lightspeed/shop.rb
CHANGED
data/lib/lightspeed/shops.rb
CHANGED
data/lib/lightspeed/vendor.rb
CHANGED
data/lib/lightspeed/vendors.rb
CHANGED
data/lib/lightspeed/version.rb
CHANGED
data/lib/lightspeed_pos.rb
CHANGED
data/lightspeed_pos.gemspec
CHANGED
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.
|
4
|
+
version: 0.5.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:
|
11
|
+
date: 2020-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -232,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
- !ruby/object:Gem::Version
|
233
233
|
version: '0'
|
234
234
|
requirements: []
|
235
|
-
|
236
|
-
rubygems_version: 2.7.6
|
235
|
+
rubygems_version: 3.1.2
|
237
236
|
signing_key:
|
238
237
|
specification_version: 4
|
239
238
|
summary: A gem for interacting with Lightspeed's Point of Sale system
|