model-to-schema 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +20 -0
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +13 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +111 -0
  8. data/Rakefile +12 -0
  9. data/esquema.gemspec +38 -0
  10. data/lib/esquema/builder.rb +155 -0
  11. data/lib/esquema/configuration.rb +34 -0
  12. data/lib/esquema/keyword_validator.rb +98 -0
  13. data/lib/esquema/model.rb +31 -0
  14. data/lib/esquema/property.rb +238 -0
  15. data/lib/esquema/schema_enhancer.rb +90 -0
  16. data/lib/esquema/type_caster.rb +53 -0
  17. data/lib/esquema/version.rb +5 -0
  18. data/lib/esquema/virtual_column.rb +46 -0
  19. data/lib/esquema.rb +14 -0
  20. data/lib/generators/esquema/install/install_generator.rb +16 -0
  21. data/lib/generators/esquema/install/templates/esquema_initializer.rb +22 -0
  22. data/sorbet/config +4 -0
  23. data/sorbet/rbi/annotations/.gitattributes +1 -0
  24. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  25. data/sorbet/rbi/annotations/activerecord.rbi +92 -0
  26. data/sorbet/rbi/annotations/activesupport.rbi +421 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/gems/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/activemodel@7.1.3.rbi +8 -0
  30. data/sorbet/rbi/gems/activerecord@7.1.3.rbi +8 -0
  31. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +192 -0
  32. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  33. data/sorbet/rbi/gems/base64@0.2.0.rbi +8 -0
  34. data/sorbet/rbi/gems/bigdecimal@3.1.6.rbi +8 -0
  35. data/sorbet/rbi/gems/byebug@11.1.3.rbi +3606 -0
  36. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
  37. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +8 -0
  38. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  39. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1130 -0
  40. data/sorbet/rbi/gems/drb@2.2.0.rbi +1272 -0
  41. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  42. data/sorbet/rbi/gems/i18n@1.14.1.rbi +8 -0
  43. data/sorbet/rbi/gems/json@2.7.1.rbi +1553 -0
  44. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  45. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  46. data/sorbet/rbi/gems/minitest@5.22.2.rbi +8 -0
  47. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +8 -0
  48. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  49. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  50. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  51. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  52. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  53. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1150 -0
  54. data/sorbet/rbi/gems/pry@0.14.2.rbi +10075 -0
  55. data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
  56. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  57. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  58. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  59. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  60. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  61. data/sorbet/rbi/gems/rspec-core@3.13.0.rbi +10978 -0
  62. data/sorbet/rbi/gems/rspec-expectations@3.13.0.rbi +8153 -0
  63. data/sorbet/rbi/gems/rspec-mocks@3.13.0.rbi +5340 -0
  64. data/sorbet/rbi/gems/rspec-support@3.13.0.rbi +1629 -0
  65. data/sorbet/rbi/gems/rspec@3.13.0.rbi +82 -0
  66. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7006 -0
  67. data/sorbet/rbi/gems/rubocop@1.60.2.rbi +57383 -0
  68. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  69. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  70. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  71. data/sorbet/rbi/gems/sqlite3@1.7.2.rbi +1691 -0
  72. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23133 -0
  73. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3510 -0
  74. data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
  75. data/sorbet/rbi/gems/timeout@0.4.1.rbi +142 -0
  76. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +8 -0
  77. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  78. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  79. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  80. data/sorbet/rbi/todo.rbi +20 -0
  81. data/sorbet/tapioca/config.yml +13 -0
  82. data/sorbet/tapioca/require.rb +4 -0
  83. metadata +176 -0
@@ -0,0 +1,20 @@
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for unresolved constants.
3
+ # Please instead update this file by running `bin/tapioca todo`.
4
+
5
+ # typed: false
6
+
7
+ module ::DateAndTime::Calculations; end
8
+ module ::DateAndTime::Zones; end
9
+ module ActiveModel::Error; end
10
+ module ActiveRecord::ConnectionAdapters::DatabaseStatements; end
11
+ module ActiveRecord::ConnectionAdapters::SchemaStatements; end
12
+ module ActiveRecord::Tasks::DatabaseTasks; end
13
+ module ActiveSupport::ArrayInquirer; end
14
+ module ActiveSupport::Multibyte::Chars; end
15
+ module ActiveSupport::SafeBuffer; end
16
+ module ActiveSupport::StringInquirer; end
17
+ module ActiveSupport::TimeZone; end
18
+ module Esquema::Generators::Rails::Generators::Base; end
19
+ module Matchers::UnorderedArrayMatcher::JsonTraverser; end
20
+ module RSpec::JsonExpectations::Matchers::UnorderedArrayMatcher; end
@@ -0,0 +1,13 @@
1
+ gem:
2
+ # Add your `gem` command parameters here:
3
+ #
4
+ # exclude:
5
+ # - gem_name
6
+ # doc: true
7
+ # workers: 5
8
+ dsl:
9
+ # Add your `dsl` command parameters here:
10
+ #
11
+ # exclude:
12
+ # - SomeGeneratorName
13
+ # workers: 5
@@ -0,0 +1,4 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ # Add your extra requires here (`bin/tapioca require` can be used to bootstrap this list)
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: model-to-schema
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sergio Bayona
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-08-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '7.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '7.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-byebug
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.10'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.10.1
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.10'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.10.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '13.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13.0'
61
+ description: Generate json-schema from ActiveRecord models.
62
+ email:
63
+ - bayona.sergio@gmail.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - ".rspec"
69
+ - ".rubocop.yml"
70
+ - ".ruby-version"
71
+ - CHANGELOG.md
72
+ - LICENSE.txt
73
+ - README.md
74
+ - Rakefile
75
+ - esquema.gemspec
76
+ - lib/esquema.rb
77
+ - lib/esquema/builder.rb
78
+ - lib/esquema/configuration.rb
79
+ - lib/esquema/keyword_validator.rb
80
+ - lib/esquema/model.rb
81
+ - lib/esquema/property.rb
82
+ - lib/esquema/schema_enhancer.rb
83
+ - lib/esquema/type_caster.rb
84
+ - lib/esquema/version.rb
85
+ - lib/esquema/virtual_column.rb
86
+ - lib/generators/esquema/install/install_generator.rb
87
+ - lib/generators/esquema/install/templates/esquema_initializer.rb
88
+ - sorbet/config
89
+ - sorbet/rbi/annotations/.gitattributes
90
+ - sorbet/rbi/annotations/activemodel.rbi
91
+ - sorbet/rbi/annotations/activerecord.rbi
92
+ - sorbet/rbi/annotations/activesupport.rbi
93
+ - sorbet/rbi/annotations/rainbow.rbi
94
+ - sorbet/rbi/gems/.gitattributes
95
+ - sorbet/rbi/gems/activemodel@7.1.3.rbi
96
+ - sorbet/rbi/gems/activerecord@7.1.3.rbi
97
+ - sorbet/rbi/gems/activesupport@7.1.3.rbi
98
+ - sorbet/rbi/gems/ast@2.4.2.rbi
99
+ - sorbet/rbi/gems/base64@0.2.0.rbi
100
+ - sorbet/rbi/gems/bigdecimal@3.1.6.rbi
101
+ - sorbet/rbi/gems/byebug@11.1.3.rbi
102
+ - sorbet/rbi/gems/coderay@1.1.3.rbi
103
+ - sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi
104
+ - sorbet/rbi/gems/connection_pool@2.4.1.rbi
105
+ - sorbet/rbi/gems/diff-lcs@1.5.1.rbi
106
+ - sorbet/rbi/gems/drb@2.2.0.rbi
107
+ - sorbet/rbi/gems/erubi@1.12.0.rbi
108
+ - sorbet/rbi/gems/i18n@1.14.1.rbi
109
+ - sorbet/rbi/gems/json@2.7.1.rbi
110
+ - sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi
111
+ - sorbet/rbi/gems/method_source@1.0.0.rbi
112
+ - sorbet/rbi/gems/minitest@5.22.2.rbi
113
+ - sorbet/rbi/gems/mutex_m@0.2.0.rbi
114
+ - sorbet/rbi/gems/netrc@0.11.0.rbi
115
+ - sorbet/rbi/gems/parallel@1.24.0.rbi
116
+ - sorbet/rbi/gems/parser@3.3.0.5.rbi
117
+ - sorbet/rbi/gems/prettier_print@1.2.1.rbi
118
+ - sorbet/rbi/gems/prism@0.24.0.rbi
119
+ - sorbet/rbi/gems/pry-byebug@3.10.1.rbi
120
+ - sorbet/rbi/gems/pry@0.14.2.rbi
121
+ - sorbet/rbi/gems/racc@1.7.3.rbi
122
+ - sorbet/rbi/gems/rainbow@3.1.1.rbi
123
+ - sorbet/rbi/gems/rake@13.1.0.rbi
124
+ - sorbet/rbi/gems/rbi@0.1.9.rbi
125
+ - sorbet/rbi/gems/regexp_parser@2.9.0.rbi
126
+ - sorbet/rbi/gems/rexml@3.2.6.rbi
127
+ - sorbet/rbi/gems/rspec-core@3.13.0.rbi
128
+ - sorbet/rbi/gems/rspec-expectations@3.13.0.rbi
129
+ - sorbet/rbi/gems/rspec-mocks@3.13.0.rbi
130
+ - sorbet/rbi/gems/rspec-support@3.13.0.rbi
131
+ - sorbet/rbi/gems/rspec@3.13.0.rbi
132
+ - sorbet/rbi/gems/rubocop-ast@1.30.0.rbi
133
+ - sorbet/rbi/gems/rubocop@1.60.2.rbi
134
+ - sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi
135
+ - sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi
136
+ - sorbet/rbi/gems/spoom@1.2.4.rbi
137
+ - sorbet/rbi/gems/sqlite3@1.7.2.rbi
138
+ - sorbet/rbi/gems/syntax_tree@6.2.0.rbi
139
+ - sorbet/rbi/gems/tapioca@0.12.0.rbi
140
+ - sorbet/rbi/gems/thor@1.3.0.rbi
141
+ - sorbet/rbi/gems/timeout@0.4.1.rbi
142
+ - sorbet/rbi/gems/tzinfo@2.0.6.rbi
143
+ - sorbet/rbi/gems/unicode-display_width@2.5.0.rbi
144
+ - sorbet/rbi/gems/yard-sorbet@0.8.1.rbi
145
+ - sorbet/rbi/gems/yard@0.9.34.rbi
146
+ - sorbet/rbi/todo.rbi
147
+ - sorbet/tapioca/config.yml
148
+ - sorbet/tapioca/require.rb
149
+ homepage: https://github.com/sergiobayona/esquema
150
+ licenses:
151
+ - MIT
152
+ metadata:
153
+ allowed_push_host: https://rubygems.org
154
+ homepage_uri: https://github.com/sergiobayona/esquema
155
+ source_code_uri: https://github.com/sergiobayona/esquema
156
+ changelog_uri: https://github.com/sergiobayona/esquema/blob/main/CHANGELOG.md
157
+ post_install_message:
158
+ rdoc_options: []
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '3.1'
166
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ requirements: []
172
+ rubygems_version: 3.3.3
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: Generate json-schema from ActiveRecord models.
176
+ test_files: []