shale-builder 0.1.6 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15122ca23e6581da8b35ea0567084d915cb5fca400179505ad618470a6b5b014
4
- data.tar.gz: 65c523711576535345141f10d2f656a892a29d111bde9f661310b0a01158b5c4
3
+ metadata.gz: cbe778d73cceabc621cd8f6a519f5ae1918f9f0adaca89440f4bbc40a26d2c82
4
+ data.tar.gz: 8fca87cc033853a3f2bb11fd2a40c1c96f2a3253018418ab03759431d6d07111
5
5
  SHA512:
6
- metadata.gz: b2fb0f51350d3b412a92fc1c20fd3dc470313a403dbeb2a13196ad7bf7b4423cc7a6cb4862c434106964e1a3d9597c68b2648f715cbfbf77344a2b0450e7c08c
7
- data.tar.gz: c87b6e5e6a75c80fc3b08a2c2473e7d775c452b85fcc890ac940848223c65ff847824816382922cd88c80f22c4d4f9b67cca0cacc0455b6d35de9926d1f53998
6
+ metadata.gz: bbbe39c11d85f4dfae32313d72d751ba72d69e7a3bf13c8fcf9ba19df598975a67b6de20a4db66a1335d3a6b6a5c2adff8c102ddc7fc31d8f1505c7742e5939e
7
+ data.tar.gz: d446a57ccf5eb4be78014d1bf8852017463ceee2fcb4af3746be191c8b11240fc50a65129b9daffb8c33ea35cc29733b30dc53a47fac28fbd7996ddd84d15521
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  rubocop-espago: rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 3.0
5
+ TargetRubyVersion: 3.1
6
6
  Exclude:
7
7
  - lib/tapioca/**/*.rb
8
8
 
@@ -11,3 +11,6 @@ Style/DocumentationMethod:
11
11
 
12
12
  Style/TrailingCommaInArguments:
13
13
  Enabled: false
14
+
15
+ Naming/BlockForwarding:
16
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.1.8] - 2024-05-15
2
+
3
+ - Sort attribute names in the tapioca compiler
4
+
5
+ ## [0.1.7] - 2024-05-13
6
+
7
+ - Drop support for Ruby 3.0
8
+ - Add support for Ruby 3.3
9
+
1
10
  ## [0.1.6] - 2024-05-13
2
11
 
3
12
  - Add support for doc strings in the tapioca compiler
data/Gemfile CHANGED
@@ -11,4 +11,5 @@ gem 'rake', '~> 13.0' # automation tasks
11
11
  gem 'rubocop-espago', '~> 1.0' # ruby linter
12
12
  gem 'shoulda-context', '~> 2.0' # more pleasant test syntax
13
13
  gem 'solargraph', '~> 0.48' # language server
14
+ gem 'sorbet', '>= 0.5' # static typechecker
14
15
  gem 'tapioca', '> 0.13' # RBI generator for sorbet
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shale-builder (0.1.6)
4
+ shale-builder (0.1.8)
5
5
  booleans (>= 0.1)
6
6
  shale (< 2.0)
7
7
  sorbet-runtime (> 0.5)
@@ -25,15 +25,15 @@ GEM
25
25
  kramdown (~> 2.0)
26
26
  minitest (5.17.0)
27
27
  netrc (0.11.0)
28
- nokogiri (1.14.2-arm64-darwin)
28
+ nokogiri (1.16.5-arm64-darwin)
29
29
  racc (~> 1.4)
30
- nokogiri (1.14.2-x86_64-linux)
30
+ nokogiri (1.16.5-x86_64-linux)
31
31
  racc (~> 1.4)
32
32
  parallel (1.22.1)
33
33
  parser (3.2.1.0)
34
34
  ast (~> 2.4.1)
35
35
  prism (0.29.0)
36
- racc (1.6.2)
36
+ racc (1.7.3)
37
37
  rainbow (3.1.1)
38
38
  rake (13.0.6)
39
39
  rbi (0.1.13)
@@ -120,6 +120,7 @@ DEPENDENCIES
120
120
  shale-builder!
121
121
  shoulda-context (~> 2.0)
122
122
  solargraph (~> 0.48)
123
+ sorbet (>= 0.5)
123
124
  tapioca (> 0.13)
124
125
 
125
126
  BUNDLED WITH
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Shale
4
4
  module Builder
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.8'
6
6
  end
7
7
  end
data/lib/shale/builder.rb CHANGED
@@ -106,7 +106,7 @@ module Shale
106
106
  ).void
107
107
  end
108
108
  def attribute(name, type, collection: false, default: nil, doc: nil, **kwargs, &block)
109
- super(name, type, collection: collection, default: default, **kwargs, &block)
109
+ super(name, type, collection:, default:, **kwargs, &block)
110
110
  attributes[name.to_sym]&.doc = doc # add doc to the attribute
111
111
  return unless type < ::Shale::Mapper
112
112
 
@@ -34,8 +34,9 @@ module Tapioca
34
34
  mod = klass.create_module(SHALE_ATTRIBUTE_MODULE)
35
35
  klass.create_include(SHALE_ATTRIBUTE_MODULE)
36
36
  # For each attribute defined in the class
37
- constant.attributes.each_value do |attribute|
38
- attribute = T.let(attribute, ::Shale::Attribute)
37
+ attribute_names = constant.attributes.keys.sort
38
+ attribute_names.each do |attribute_name|
39
+ attribute = T.let(constant.attributes[attribute_name], ::Shale::Attribute)
39
40
  non_nilable_type, nilable_type = shale_type_to_sorbet_type(attribute)
40
41
  type = nilable_type
41
42
  if attribute.collection?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shale-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-13 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: booleans
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 3.0.0
92
+ version: 3.1.0
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ">="