fixably 0.3.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +32 -32
- data/docs/customer/child.md +1 -1
- data/docs/order/line.md +4 -4
- data/docs/order/note.md +11 -4
- data/docs/order/task.md +4 -4
- data/docs/order.md +1 -1
- data/fixably.gemspec +2 -1
- data/lib/fixably/actions.rb +2 -2
- data/lib/fixably/active_resource/base.rb +2 -2
- data/lib/fixably/encoding.rb +8 -4
- data/lib/fixably/resources/order.rb +11 -0
- data/lib/fixably/version.rb +1 -1
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e8f880a2eb954e1467e74c7dec0c84c2b762b50da015e115319a245c447915d
|
4
|
+
data.tar.gz: de900d1c1b55c4c2f5a45533c835dd961b4bf01374f9c73f7f8d020c6bf90c77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4b1b68a5043f35c6da7ef3b6454886e79883f440fb4a9a07e2b27a4e8d0f4fb8254724885165d84f94e9b4cf05e30575619829e9a7c947d10592e400bdf588
|
7
|
+
data.tar.gz: f01f0d472706283fc568a9e2e04c4e3d44b562b28402c6669291b95d085e950f3956603bd7286166240d5651db103bc06b98ceb5300e5953fa7fb0914b213e4d
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fixably (0.
|
5
|
-
activeresource (
|
4
|
+
fixably (0.6.0)
|
5
|
+
activeresource (>= 5, < 7)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://com:jE6Df8B6dPoghEjlbPTiQzMi34dvbO12@gem.mutant.dev/
|
@@ -12,42 +12,42 @@ GEM
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (
|
16
|
-
activesupport (=
|
15
|
+
activemodel (7.0.1)
|
16
|
+
activesupport (= 7.0.1)
|
17
17
|
activemodel-serializers-xml (1.0.2)
|
18
18
|
activemodel (> 5.x)
|
19
19
|
activesupport (> 5.x)
|
20
20
|
builder (~> 3.1)
|
21
|
-
activeresource (
|
22
|
-
activemodel (>=
|
21
|
+
activeresource (6.0.0)
|
22
|
+
activemodel (>= 6.0)
|
23
23
|
activemodel-serializers-xml (~> 1.0)
|
24
|
-
activesupport (>=
|
25
|
-
activesupport (
|
24
|
+
activesupport (>= 6.0)
|
25
|
+
activesupport (7.0.1)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 1.6, < 2)
|
28
28
|
minitest (>= 5.1)
|
29
29
|
tzinfo (~> 2.0)
|
30
|
-
zeitwerk (~> 2.3)
|
31
30
|
ast (2.4.2)
|
32
31
|
builder (3.2.4)
|
33
32
|
byebug (11.1.3)
|
34
33
|
coderay (1.1.3)
|
35
34
|
concurrent-ruby (1.1.9)
|
36
|
-
diff-lcs (1.
|
37
|
-
i18n (1.8.
|
35
|
+
diff-lcs (1.5.0)
|
36
|
+
i18n (1.8.11)
|
38
37
|
concurrent-ruby (~> 1.0)
|
39
38
|
method_source (1.0.0)
|
40
|
-
minitest (5.
|
41
|
-
mutant (0.
|
39
|
+
minitest (5.15.0)
|
40
|
+
mutant (0.11.2)
|
42
41
|
diff-lcs (~> 1.3)
|
43
42
|
parser (~> 3.0.0)
|
44
43
|
regexp_parser (~> 2.0, >= 2.0.3)
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
sorbet-runtime (~> 0.5.0)
|
45
|
+
unparser (~> 0.6.2)
|
46
|
+
mutant-rspec (0.11.2)
|
47
|
+
mutant (= 0.11.2)
|
48
48
|
rspec-core (>= 3.8.0, < 4.0.0)
|
49
|
-
parallel (1.
|
50
|
-
parser (3.0.2
|
49
|
+
parallel (1.21.0)
|
50
|
+
parser (3.0.3.2)
|
51
51
|
ast (~> 2.4.1)
|
52
52
|
pry (0.13.1)
|
53
53
|
coderay (~> 1.1)
|
@@ -55,9 +55,9 @@ GEM
|
|
55
55
|
pry-byebug (3.9.0)
|
56
56
|
byebug (~> 11.0)
|
57
57
|
pry (~> 0.13.0)
|
58
|
-
rainbow (3.
|
58
|
+
rainbow (3.1.1)
|
59
59
|
rake (13.0.6)
|
60
|
-
regexp_parser (2.
|
60
|
+
regexp_parser (2.2.0)
|
61
61
|
rexml (3.2.5)
|
62
62
|
rspec (3.10.0)
|
63
63
|
rspec-core (~> 3.10.0)
|
@@ -65,42 +65,42 @@ GEM
|
|
65
65
|
rspec-mocks (~> 3.10.0)
|
66
66
|
rspec-core (3.10.1)
|
67
67
|
rspec-support (~> 3.10.0)
|
68
|
-
rspec-expectations (3.10.
|
68
|
+
rspec-expectations (3.10.2)
|
69
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
70
|
rspec-support (~> 3.10.0)
|
71
71
|
rspec-mocks (3.10.2)
|
72
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
73
|
rspec-support (~> 3.10.0)
|
74
|
-
rspec-support (3.10.
|
75
|
-
rubocop (1.
|
74
|
+
rspec-support (3.10.3)
|
75
|
+
rubocop (1.24.1)
|
76
76
|
parallel (~> 1.10)
|
77
77
|
parser (>= 3.0.0.0)
|
78
78
|
rainbow (>= 2.2.2, < 4.0)
|
79
79
|
regexp_parser (>= 1.8, < 3.0)
|
80
80
|
rexml
|
81
|
-
rubocop-ast (>= 1.
|
81
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
82
82
|
ruby-progressbar (~> 1.7)
|
83
83
|
unicode-display_width (>= 1.4.0, < 3.0)
|
84
|
-
rubocop-ast (1.
|
84
|
+
rubocop-ast (1.15.1)
|
85
85
|
parser (>= 3.0.1.1)
|
86
|
-
rubocop-performance (1.
|
86
|
+
rubocop-performance (1.13.2)
|
87
87
|
rubocop (>= 1.7.0, < 2.0)
|
88
88
|
rubocop-ast (>= 0.4.0)
|
89
89
|
rubocop-rake (0.6.0)
|
90
90
|
rubocop (~> 1.0)
|
91
|
-
rubocop-rspec (2.
|
92
|
-
rubocop (~> 1.
|
93
|
-
rubocop-ast (>= 1.1.0)
|
91
|
+
rubocop-rspec (2.7.0)
|
92
|
+
rubocop (~> 1.19)
|
94
93
|
ruby-progressbar (1.11.0)
|
94
|
+
sorbet-runtime (0.5.9531)
|
95
95
|
tzinfo (2.0.4)
|
96
96
|
concurrent-ruby (~> 1.0)
|
97
|
-
unicode-display_width (2.
|
98
|
-
unparser (0.6.
|
97
|
+
unicode-display_width (2.1.0)
|
98
|
+
unparser (0.6.2)
|
99
99
|
diff-lcs (~> 1.3)
|
100
100
|
parser (>= 3.0.0)
|
101
|
-
zeitwerk (2.4.2)
|
102
101
|
|
103
102
|
PLATFORMS
|
103
|
+
arm64-darwin-21
|
104
104
|
x86_64-darwin-20
|
105
105
|
|
106
106
|
DEPENDENCIES
|
data/docs/customer/child.md
CHANGED
data/docs/order/line.md
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
## List order lines
|
4
4
|
|
5
5
|
```ruby
|
6
|
-
Fixably::Order::Line.all(order_id:
|
6
|
+
Fixably::Order::Line.all(order_id: 1_000)
|
7
7
|
```
|
8
8
|
|
9
9
|
## Get an order line
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
Fixably::Order::Line.find(
|
13
|
-
Fixably::Order::Line.first(order_id:
|
14
|
-
Fixably::Order::Line.last(order_id:
|
12
|
+
Fixably::Order::Line.find(1_000, order_id: 1_000)
|
13
|
+
Fixably::Order::Line.first(order_id: 1_000)
|
14
|
+
Fixably::Order::Line.last(order_id: 1_000)
|
15
15
|
```
|
16
16
|
|
17
17
|
## Create an order line
|
data/docs/order/note.md
CHANGED
@@ -3,15 +3,22 @@
|
|
3
3
|
## List order notes
|
4
4
|
|
5
5
|
```ruby
|
6
|
-
Fixably::Order::Note.all(order_id:
|
6
|
+
Fixably::Order::Note.all(order_id: 1_000)
|
7
|
+
```
|
8
|
+
|
9
|
+
### Include associations in a list
|
10
|
+
|
11
|
+
**Created by**
|
12
|
+
```ruby
|
13
|
+
Fixably::Order.includes(:created_by).all(order_id: 1_000)
|
7
14
|
```
|
8
15
|
|
9
16
|
## Get an order note
|
10
17
|
|
11
18
|
```ruby
|
12
|
-
Fixably::Order::Note.find(
|
13
|
-
Fixably::Order::Note.first(order_id:
|
14
|
-
Fixably::Order::Note.last(order_id:
|
19
|
+
Fixably::Order::Note.find(1_000, order_id: 1_000)
|
20
|
+
Fixably::Order::Note.first(order_id: 1_000)
|
21
|
+
Fixably::Order::Note.last(order_id: 1_000)
|
15
22
|
```
|
16
23
|
|
17
24
|
## Create an order note
|
data/docs/order/task.md
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
## List order tasks
|
4
4
|
|
5
5
|
```ruby
|
6
|
-
Fixably::Order::Task.all(order_id:
|
6
|
+
Fixably::Order::Task.all(order_id: 1_000)
|
7
7
|
```
|
8
8
|
|
9
9
|
## Get an order task
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
Fixably::Order::Task.find(
|
13
|
-
Fixably::Order::Task.first(order_id:
|
14
|
-
Fixably::Order::Task.last(order_id:
|
12
|
+
Fixably::Order::Task.find(1_000, order_id: 1_000)
|
13
|
+
Fixably::Order::Task.first(order_id: 1_000)
|
14
|
+
Fixably::Order::Task.last(order_id: 1_000)
|
15
15
|
```
|
16
16
|
|
17
17
|
## Create an order task
|
data/docs/order.md
CHANGED
data/fixably.gemspec
CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.license = "MIT"
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
15
15
|
|
16
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
16
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
18
19
|
|
@@ -25,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
25
26
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
26
27
|
spec.require_paths = ["lib"]
|
27
28
|
|
28
|
-
spec.add_dependency "activeresource", "
|
29
|
+
spec.add_dependency "activeresource", ">= 5", "< 7"
|
29
30
|
|
30
31
|
spec.add_development_dependency "mutant-rspec", "~> 0.10"
|
31
32
|
spec.add_development_dependency "pry-byebug"
|
data/lib/fixably/actions.rb
CHANGED
@@ -103,8 +103,8 @@ module Fixably
|
|
103
103
|
)
|
104
104
|
end
|
105
105
|
|
106
|
-
Array.wrap(values).map do
|
107
|
-
action =
|
106
|
+
Array.wrap(values).map do |value|
|
107
|
+
action = value.to_sym
|
108
108
|
|
109
109
|
unless allowed_actions.include?(action)
|
110
110
|
raise ArgumentError, "Unsupported action, #{action}, supplied"
|
@@ -20,8 +20,8 @@ module ActiveResource
|
|
20
20
|
def query_string(options)
|
21
21
|
opts = {}
|
22
22
|
|
23
|
-
non_query_parameters.each do
|
24
|
-
opts[
|
23
|
+
non_query_parameters.each do |parameter|
|
24
|
+
opts[parameter] = options.fetch(parameter) if options[parameter]
|
25
25
|
end
|
26
26
|
|
27
27
|
f = filters(options)
|
data/lib/fixably/encoding.rb
CHANGED
@@ -17,14 +17,18 @@ module Fixably
|
|
17
17
|
|
18
18
|
def remove_on_encode = %w[created_at href id]
|
19
19
|
|
20
|
-
private
|
21
|
-
|
22
20
|
def remove_has_many_associations(attrs)
|
23
|
-
reflections.select
|
24
|
-
|
21
|
+
has_many_reflections = reflections.select do |_name, reflection|
|
22
|
+
reflection.macro.equal?(:has_many)
|
23
|
+
end
|
24
|
+
|
25
|
+
has_many_reflections.each_key do |reflection_name|
|
26
|
+
attrs.delete(reflection_name)
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
30
|
+
private
|
31
|
+
|
28
32
|
def remove_unallowed_parameters(attrs)
|
29
33
|
remove_on_encode.each { attrs.delete(_1) }
|
30
34
|
end
|
@@ -39,6 +39,15 @@ module Fixably
|
|
39
39
|
allow_nil: true
|
40
40
|
)
|
41
41
|
|
42
|
+
protected
|
43
|
+
|
44
|
+
def remove_has_many_associations(attrs)
|
45
|
+
reflections.select { |_, reflection| reflection.macro.equal?(:has_many) }.
|
46
|
+
keys.
|
47
|
+
reject { _1.equal?(:notes) }.
|
48
|
+
each { attrs.delete(_1) }
|
49
|
+
end
|
50
|
+
|
42
51
|
class Contact < ApplicationResource
|
43
52
|
schema do
|
44
53
|
string :full_name
|
@@ -71,6 +80,8 @@ module Fixably
|
|
71
80
|
string :text
|
72
81
|
string :type
|
73
82
|
end
|
83
|
+
|
84
|
+
has_one :created_by, class_name: "fixably/user"
|
74
85
|
end
|
75
86
|
|
76
87
|
class Task < ApplicationResource
|
data/lib/fixably/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixably
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Rice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 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
19
|
version: '5'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: mutant-rspec
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -195,6 +201,7 @@ homepage: https://github.com/HashNotAdam/fixably-ruby
|
|
195
201
|
licenses:
|
196
202
|
- MIT
|
197
203
|
metadata:
|
204
|
+
rubygems_mfa_required: 'true'
|
198
205
|
homepage_uri: https://github.com/HashNotAdam/fixably-ruby
|
199
206
|
source_code_uri: https://github.com/HashNotAdam/fixably-ruby
|
200
207
|
post_install_message:
|
@@ -212,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
219
|
- !ruby/object:Gem::Version
|
213
220
|
version: '0'
|
214
221
|
requirements: []
|
215
|
-
rubygems_version: 3.
|
222
|
+
rubygems_version: 3.3.3
|
216
223
|
signing_key:
|
217
224
|
specification_version: 4
|
218
225
|
summary: Ruby client for the Fixably API
|