schemable 0.1.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -1
- data/CHANGELOG.md +8 -3
- data/Gemfile +5 -5
- data/Gemfile.lock +0 -136
- data/README.md +327 -101
- data/lib/generators/schemable/install_generator.rb +3 -13
- data/lib/generators/schemable/model_generator.rb +1 -16
- data/lib/schemable/attribute_schema_generator.rb +146 -0
- data/lib/schemable/configuration.rb +114 -0
- data/lib/schemable/definition.rb +335 -0
- data/lib/schemable/included_schema_generator.rb +107 -0
- data/lib/schemable/relationship_schema_generator.rb +119 -0
- data/lib/schemable/request_schema_generator.rb +88 -0
- data/lib/schemable/response_schema_generator.rb +124 -0
- data/lib/schemable/schema_modifier.rb +248 -0
- data/lib/schemable/version.rb +1 -1
- data/lib/schemable.rb +60 -937
- data/lib/templates/schemable.rb +76 -0
- data/schemable.gemspec +2 -5
- data/sig/schemable/attribute_schema_generator.rbs +13 -0
- data/sig/schemable/configuration.rbs +21 -0
- data/sig/schemable/definition.rbs +33 -0
- data/sig/schemable/included_schema_generator.rbs +11 -0
- data/sig/schemable/relationship_schema_generator.rbs +11 -0
- data/sig/schemable/request_schema_generator.rbs +10 -0
- data/sig/schemable/response_schema_generator.rbs +13 -0
- data/sig/schemable/schema_modifier.rbs +9 -0
- data/sig/schemable.rbs +4 -1
- metadata +23 -36
- data/lib/templates/common_definitions.rb +0 -13
- data/lib/templates/serializers_helper.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75af2b99b8def68455dd086ca7d2b95dfbd5bcec8ccd16cca5a0695ef992c0f4
|
4
|
+
data.tar.gz: '058291928127918abf3d5a7f64f7d6c3c42a1e262c76c7d06b23060f534bda47'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f56ed0334197fd366ca8881d95aed351efe847486be33fac94a122b0b0c19d8fb3c958ae3edc94ec020d38bc3757396aea8d7c8010b8130907b10468b71b392f
|
7
|
+
data.tar.gz: ea1b2cc748f66c9fdbc620a8914450debaddc2f468ce34bf2e11257d7aeb426d6bf52e72944ddfe9203ebfb9a305f3cf7de7510481c984ace3759e0b63b375cd
|
data/.rubocop.yml
CHANGED
@@ -128,4 +128,8 @@ Layout/EmptyLinesAroundClassBody: # Disables empty lines around class body warni
|
|
128
128
|
Layout/HeredocIndentation: # Disables heredoc indentation warning
|
129
129
|
Enabled: false
|
130
130
|
Layout/ClosingHeredocIndentation: # Disables closing heredoc indentation warning
|
131
|
-
Enabled: false
|
131
|
+
Enabled: false
|
132
|
+
Rails/Output: # Disables rails output warning
|
133
|
+
Enabled: false
|
134
|
+
Metrics/ClassLength: # Disables class length warning
|
135
|
+
Max: 150
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
|
+
This file is used to list changes made in each version of the Schemable gem.
|
2
3
|
|
3
|
-
##
|
4
|
+
## Schemable 1.0.1 (2024-01-29)
|
4
5
|
|
5
|
-
|
6
|
+
* Added configuration for changing the default value of enums. By default first key is used, or alternatively default can be set manually by the method `default_value_for_enum_attributes` from the definition.
|
7
|
+
|
8
|
+
## Schemable 1.0.0 (2023-11-17)
|
9
|
+
|
10
|
+
* Initial release
|
data/Gemfile
CHANGED
@@ -4,12 +4,12 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem 'rake', '~> 13.0
|
8
|
-
gem 'rspec', '~> 3.12'
|
9
|
-
gem 'rubocop', '~> 1.
|
10
|
-
gem 'rubocop-rails', '~> 2.
|
7
|
+
gem 'rake', '~> 13.1.0'
|
8
|
+
gem 'rspec', '~> 3.12.0'
|
9
|
+
gem 'rubocop', '~> 1.60.2'
|
10
|
+
gem 'rubocop-rails', '~> 2.23.1'
|
11
11
|
|
12
12
|
group :development, :test do
|
13
|
-
gem 'factory_bot_rails', '~> 6.
|
13
|
+
gem 'factory_bot_rails', '~> 6.4.3'
|
14
14
|
gem 'jsonapi-rails', '~> 0.4.1'
|
15
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,136 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
schemable (0.1.4)
|
5
|
-
factory_bot_rails (~> 6.2.0)
|
6
|
-
jsonapi-rails (~> 0.4.1)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionpack (7.0.4.3)
|
12
|
-
actionview (= 7.0.4.3)
|
13
|
-
activesupport (= 7.0.4.3)
|
14
|
-
rack (~> 2.0, >= 2.2.0)
|
15
|
-
rack-test (>= 0.6.3)
|
16
|
-
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
-
actionview (7.0.4.3)
|
19
|
-
activesupport (= 7.0.4.3)
|
20
|
-
builder (~> 3.1)
|
21
|
-
erubi (~> 1.4)
|
22
|
-
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
-
activesupport (7.0.4.3)
|
25
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
|
-
i18n (>= 1.6, < 2)
|
27
|
-
minitest (>= 5.1)
|
28
|
-
tzinfo (~> 2.0)
|
29
|
-
ast (2.4.2)
|
30
|
-
builder (3.2.4)
|
31
|
-
concurrent-ruby (1.2.2)
|
32
|
-
crass (1.0.6)
|
33
|
-
diff-lcs (1.5.0)
|
34
|
-
erubi (1.12.0)
|
35
|
-
factory_bot (6.2.1)
|
36
|
-
activesupport (>= 5.0.0)
|
37
|
-
factory_bot_rails (6.2.0)
|
38
|
-
factory_bot (~> 6.2.0)
|
39
|
-
railties (>= 5.0.0)
|
40
|
-
i18n (1.13.0)
|
41
|
-
concurrent-ruby (~> 1.0)
|
42
|
-
json (2.6.3)
|
43
|
-
jsonapi-deserializable (0.2.0)
|
44
|
-
jsonapi-parser (0.1.1)
|
45
|
-
jsonapi-rails (0.4.1)
|
46
|
-
jsonapi-parser (~> 0.1.0)
|
47
|
-
jsonapi-rb (~> 0.5.0)
|
48
|
-
jsonapi-rb (0.5.0)
|
49
|
-
jsonapi-deserializable (~> 0.2.0)
|
50
|
-
jsonapi-serializable (~> 0.3.0)
|
51
|
-
jsonapi-renderer (0.2.2)
|
52
|
-
jsonapi-serializable (0.3.1)
|
53
|
-
jsonapi-renderer (~> 0.2.0)
|
54
|
-
language_server-protocol (3.17.0.3)
|
55
|
-
loofah (2.21.2)
|
56
|
-
crass (~> 1.0.2)
|
57
|
-
nokogiri (>= 1.12.0)
|
58
|
-
method_source (1.0.0)
|
59
|
-
minitest (5.18.0)
|
60
|
-
nokogiri (1.14.4-x86_64-linux)
|
61
|
-
racc (~> 1.4)
|
62
|
-
parallel (1.23.0)
|
63
|
-
parser (3.2.2.3)
|
64
|
-
ast (~> 2.4.1)
|
65
|
-
racc
|
66
|
-
racc (1.6.2)
|
67
|
-
rack (2.2.7)
|
68
|
-
rack-test (2.1.0)
|
69
|
-
rack (>= 1.3)
|
70
|
-
rails-dom-testing (2.0.3)
|
71
|
-
activesupport (>= 4.2.0)
|
72
|
-
nokogiri (>= 1.6)
|
73
|
-
rails-html-sanitizer (1.5.0)
|
74
|
-
loofah (~> 2.19, >= 2.19.1)
|
75
|
-
railties (7.0.4.3)
|
76
|
-
actionpack (= 7.0.4.3)
|
77
|
-
activesupport (= 7.0.4.3)
|
78
|
-
method_source
|
79
|
-
rake (>= 12.2)
|
80
|
-
thor (~> 1.0)
|
81
|
-
zeitwerk (~> 2.5)
|
82
|
-
rainbow (3.1.1)
|
83
|
-
rake (13.0.6)
|
84
|
-
regexp_parser (2.8.1)
|
85
|
-
rexml (3.2.6)
|
86
|
-
rspec (3.12.0)
|
87
|
-
rspec-core (~> 3.12.0)
|
88
|
-
rspec-expectations (~> 3.12.0)
|
89
|
-
rspec-mocks (~> 3.12.0)
|
90
|
-
rspec-core (3.12.2)
|
91
|
-
rspec-support (~> 3.12.0)
|
92
|
-
rspec-expectations (3.12.3)
|
93
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
94
|
-
rspec-support (~> 3.12.0)
|
95
|
-
rspec-mocks (3.12.5)
|
96
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
97
|
-
rspec-support (~> 3.12.0)
|
98
|
-
rspec-support (3.12.0)
|
99
|
-
rubocop (1.55.0)
|
100
|
-
json (~> 2.3)
|
101
|
-
language_server-protocol (>= 3.17.0)
|
102
|
-
parallel (~> 1.10)
|
103
|
-
parser (>= 3.2.2.3)
|
104
|
-
rainbow (>= 2.2.2, < 4.0)
|
105
|
-
regexp_parser (>= 1.8, < 3.0)
|
106
|
-
rexml (>= 3.2.5, < 4.0)
|
107
|
-
rubocop-ast (>= 1.28.1, < 2.0)
|
108
|
-
ruby-progressbar (~> 1.7)
|
109
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
110
|
-
rubocop-ast (1.29.0)
|
111
|
-
parser (>= 3.2.1.0)
|
112
|
-
rubocop-rails (2.20.2)
|
113
|
-
activesupport (>= 4.2.0)
|
114
|
-
rack (>= 1.1)
|
115
|
-
rubocop (>= 1.33.0, < 2.0)
|
116
|
-
ruby-progressbar (1.13.0)
|
117
|
-
thor (1.2.2)
|
118
|
-
tzinfo (2.0.6)
|
119
|
-
concurrent-ruby (~> 1.0)
|
120
|
-
unicode-display_width (2.4.2)
|
121
|
-
zeitwerk (2.6.8)
|
122
|
-
|
123
|
-
PLATFORMS
|
124
|
-
x86_64-linux
|
125
|
-
|
126
|
-
DEPENDENCIES
|
127
|
-
factory_bot_rails (~> 6.2)
|
128
|
-
jsonapi-rails (~> 0.4.1)
|
129
|
-
rake (~> 13.0.6)
|
130
|
-
rspec (~> 3.12)
|
131
|
-
rubocop (~> 1.55)
|
132
|
-
rubocop-rails (~> 2.20.2)
|
133
|
-
schemable!
|
134
|
-
|
135
|
-
BUNDLED WITH
|
136
|
-
2.4.12
|