language-ruby 1.1.2 → 2.0.0

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: c29e7af1daadab0c370fe551f61803a231fd8dc46481ca6c87b11867f21040ae
4
- data.tar.gz: 412873f0510761217a84caf98d5cde6126e81e2f734c188ad02afdf00c341f61
3
+ metadata.gz: '012934bac2654038f8d30254e7be0f65d506236f1535bd2bc47accf81003e731'
4
+ data.tar.gz: 2d18e473b4142fc2dca7c59638a458f59fee25f3ff916c5377f985ad60ec7ee4
5
5
  SHA512:
6
- metadata.gz: 654ab22a998ca7eae204f9a8f546cd5d348e377d8080135dcabde49ebc3374a863d09be0d6f62b9e4f3ff759f3fd9af27f190b487adad780d1d51a35c9afad82
7
- data.tar.gz: c42f9574203f55af50f4dc2fa08b62287e9f7aa7341cec1f60878c8c384c629522eb7bff684e1b32deb217c13a0d5d39ce60e533ce2042fb24c9cfb050e41d8b
6
+ metadata.gz: f7d8604b4734674575f653aa4693eaa0a0fb7d8921ce8543b4b2b45df2409405e5dda2b98453c17e64673a7c80e19e62fd69b34ae455c686fc6ffeb74bdbd401
7
+ data.tar.gz: a4f2744ded6dcc2c2969a5780181d1ac91ad8cfb0b9e57bcd2ca046f56f0858f851993d37891fcdbc1a027fb3ca1cc12dd533027b17e87db99f61363ca314e7d
@@ -1,15 +1,15 @@
1
1
  ---
2
- version: 2
3
2
  updates:
4
- - directory: "/"
5
- package-ecosystem: github-actions
6
- schedule:
7
- interval: daily
8
- - directory: "/"
9
- package-ecosystem: npm
10
- schedule:
11
- interval: daily
12
- - directory: "/"
13
- package-ecosystem: bundler
14
- schedule:
15
- interval: daily
3
+ - directory: "/"
4
+ package-ecosystem: github-actions
5
+ schedule:
6
+ interval: daily
7
+ - directory: "/"
8
+ package-ecosystem: npm
9
+ schedule:
10
+ interval: daily
11
+ - directory: "/"
12
+ package-ecosystem: bundler
13
+ schedule:
14
+ interval: daily
15
+ version: 2
@@ -1,37 +1,38 @@
1
- name: CI
2
- on: push
1
+ ---
3
2
  jobs:
4
3
  bundler-audit:
5
4
  name: Bundler Audit
6
5
  runs-on: ubuntu-latest
7
6
  steps:
8
- - uses: actions/checkout@v4
9
- - uses: ruby/setup-ruby@v1
10
- with:
11
- bundler-cache: true
12
- - run: bin/bundler-audit check --update
7
+ - uses: actions/checkout@v4
8
+ - uses: ruby/setup-ruby@v1
9
+ with:
10
+ bundler-cache: true
11
+ - run: bin/bundler-audit check --update
12
+ npm-audit:
13
+ name: npm Audit
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-node@v4
18
+ - run: npm audit
13
19
  rspec:
14
20
  name: Test
15
21
  runs-on: ubuntu-latest
16
22
  steps:
17
- - uses: actions/checkout@v4
18
- - uses: ruby/setup-ruby@v1
19
- with:
20
- bundler-cache: true
21
- - run: bin/test
23
+ - uses: actions/checkout@v4
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ bundler-cache: true
27
+ - run: bin/test
22
28
  rubocop:
23
29
  name: Rubocop
24
30
  runs-on: ubuntu-latest
25
31
  steps:
26
- - uses: actions/checkout@v4
27
- - uses: ruby/setup-ruby@v1
28
- with:
29
- bundler-cache: true
30
- - run: bin/rubocop
31
- npm-audit:
32
- name: npm Audit
33
- runs-on: ubuntu-latest
34
- steps:
35
- - uses: actions/checkout@v4
36
- - uses: actions/setup-node@v4
37
- - run: npm audit
32
+ - uses: actions/checkout@v4
33
+ - uses: ruby/setup-ruby@v1
34
+ with:
35
+ bundler-cache: true
36
+ - run: bin/rubocop
37
+ name: CI
38
+ 'on': push
data/.node-version CHANGED
@@ -1 +1 @@
1
- 22.5.1
1
+ 26.3.1
data/.npm-version ADDED
@@ -0,0 +1 @@
1
+ 11.17.0
data/.rubocop.yml CHANGED
@@ -1,19 +1,25 @@
1
1
  ---
2
2
  AllCops:
3
3
  Exclude:
4
- - "*/node_modules/**/*"
5
- - "*/vendor/**/*"
6
- - node_modules/**/*
7
- - vendor/**/*
4
+ - "**/node_modules/**/*"
5
+ - "**/vendor/**/*"
6
+ - "**/db/schema.rb"
8
7
  NewCops: enable
8
+ TargetRubyVersion: 4.0
9
9
  Layout/ClosingHeredocIndentation:
10
10
  Enabled: false
11
+ Layout/ElseAlignment:
12
+ Enabled: false
13
+ Layout/EndAlignment:
14
+ Enabled: false
11
15
  Layout/FirstArgumentIndentation:
12
16
  Enabled: false
13
17
  Layout/HashAlignment:
14
18
  Enabled: false
15
19
  Layout/HeredocIndentation:
16
20
  Enabled: false
21
+ Layout/IndentationWidth:
22
+ Enabled: false
17
23
  Layout/LineEndStringConcatenationIndentation:
18
24
  Enabled: false
19
25
  Layout/LineLength:
@@ -22,12 +28,20 @@ Layout/MultilineMethodCallIndentation:
22
28
  Enabled: false
23
29
  Layout/MultilineOperationIndentation:
24
30
  Enabled: false
31
+ Layout/SpaceAroundKeyword:
32
+ Enabled: false
33
+ Layout/SpaceInsideHashLiteralBraces:
34
+ Enabled: false
35
+ Lint/ConstantDefinitionInBlock:
36
+ Enabled: false
25
37
  Lint/EmptyClass:
26
38
  Enabled: false
27
39
  Lint/MissingSuper:
28
40
  Enabled: false
29
41
  Lint/PercentStringArray:
30
42
  Enabled: false
43
+ Lint/SafeNavigationChain:
44
+ Enabled: false
31
45
  Lint/ShadowingOuterLocalVariable:
32
46
  Enabled: false
33
47
  Lint/SuppressedException:
@@ -42,6 +56,8 @@ Metrics/BlockLength:
42
56
  Enabled: false
43
57
  Metrics/ClassLength:
44
58
  Enabled: false
59
+ Metrics/CollectionLiteralLength:
60
+ Enabled: false
45
61
  Metrics/CyclomaticComplexity:
46
62
  Enabled: false
47
63
  Metrics/MethodLength:
@@ -56,8 +72,12 @@ Naming/FileName:
56
72
  Enabled: false
57
73
  Naming/MethodParameterName:
58
74
  Enabled: false
75
+ Naming/PredicateMethod:
76
+ Enabled: false
59
77
  Naming/VariableNumber:
60
78
  Enabled: false
79
+ Performance/Sum:
80
+ Enabled: false
61
81
  Performance/UnfreezeString:
62
82
  Enabled: false
63
83
  RSpec/AnyInstance:
@@ -76,6 +96,8 @@ RSpec/NoExpectationExample:
76
96
  Enabled: false
77
97
  RSpec/PendingWithoutReason:
78
98
  Enabled: false
99
+ Rails/BulkChangeTable:
100
+ Enabled: false
79
101
  Rails/Delegate:
80
102
  Enabled: false
81
103
  Rails/DynamicFindBy:
@@ -90,6 +112,8 @@ Rails/Presence:
90
112
  Enabled: false
91
113
  Rails/Present:
92
114
  Enabled: false
115
+ Rails/SkipsModelValidations:
116
+ Enabled: false
93
117
  Rails/ThreeStateBooleanColumn:
94
118
  Enabled: false
95
119
  Rails/TimeZone:
@@ -106,6 +130,8 @@ Style/EmptyMethod:
106
130
  Enabled: false
107
131
  Style/IfUnlessModifier:
108
132
  Enabled: false
133
+ Style/Lambda:
134
+ Enabled: false
109
135
  Style/MultilineBlockChain:
110
136
  Enabled: false
111
137
  Style/NestedTernaryOperator:
@@ -116,11 +142,11 @@ Style/StringLiterals:
116
142
  Enabled: false
117
143
  Style/StringLiteralsInInterpolation:
118
144
  Enabled: false
119
- require:
120
- - rubocop-factory_bot
121
- - rubocop-performance
122
- - rubocop-rails
123
- - rubocop-rake
124
- - rubocop-rspec
125
- - rubocop-rspec_rails
126
- - rubocop-capybara
145
+ plugins:
146
+ - rubocop-factory_bot
147
+ - rubocop-performance
148
+ - rubocop-rails
149
+ - rubocop-rake
150
+ - rubocop-rspec
151
+ - rubocop-capybara
152
+ - rubocop-rspec_rails
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.5
1
+ 4.0.5
data/.tool-versions CHANGED
@@ -1,3 +1,2 @@
1
- ruby 3.3.5
2
- yarn 1.22.22
3
- nodejs 22.5.1
1
+ ruby 4.0.5
2
+ nodejs 26.3.1
data/Gemfile CHANGED
@@ -4,17 +4,15 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- ruby "3.3.5"
8
-
9
- gem "rspec"
7
+ ruby "4.0.5"
10
8
 
11
9
  gem "bundler-audit"
12
-
10
+ gem "dorian"
11
+ gem "rspec"
12
+ gem "rubocop-capybara"
13
13
  gem "rubocop-factory_bot"
14
14
  gem "rubocop-performance"
15
15
  gem "rubocop-rails"
16
16
  gem "rubocop-rake"
17
17
  gem "rubocop-rspec"
18
18
  gem "rubocop-rspec_rails"
19
-
20
- gem "rubocop-capybara"
data/Gemfile.lock CHANGED
@@ -1,109 +1,203 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- language-ruby (1.1.2)
4
+ language-ruby (2.0.0)
5
5
  dorian-arguments
6
6
  zeitwerk
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.2.1)
11
+ activesupport (8.1.3)
12
12
  base64
13
13
  bigdecimal
14
14
  concurrent-ruby (~> 1.0, >= 1.3.1)
15
15
  connection_pool (>= 2.2.5)
16
16
  drb
17
17
  i18n (>= 1.6, < 2)
18
+ json
18
19
  logger (>= 1.4.2)
19
20
  minitest (>= 5.1)
20
21
  securerandom (>= 0.3)
21
22
  tzinfo (~> 2.0, >= 2.0.5)
22
- ast (2.4.2)
23
- base64 (0.2.0)
24
- bigdecimal (3.1.8)
25
- bundler-audit (0.9.2)
26
- bundler (>= 1.2.0, < 3)
23
+ uri (>= 0.13.1)
24
+ addressable (2.9.0)
25
+ public_suffix (>= 2.0.2, < 8.0)
26
+ ast (2.4.3)
27
+ base64 (0.3.0)
28
+ bigdecimal (4.1.2)
29
+ bundler-audit (0.9.3)
30
+ bundler (>= 1.2.0)
27
31
  thor (~> 1.0)
28
- concurrent-ruby (1.3.4)
29
- connection_pool (2.4.1)
30
- diff-lcs (1.5.1)
31
- dorian-arguments (1.2.1)
32
- bigdecimal
33
- drb (2.2.1)
34
- i18n (1.14.5)
32
+ cmdparse (3.0.7)
33
+ concurrent-ruby (1.3.7)
34
+ connection_pool (3.0.2)
35
+ csv (3.3.5)
36
+ diff-lcs (1.6.2)
37
+ dorian (2.6.8)
38
+ csv
39
+ dorian-arguments
40
+ dorian-eval
41
+ dorian-progress
42
+ dorian-to_struct
43
+ git
44
+ hexapdf
45
+ json
46
+ mini_racer
47
+ ostruct
48
+ parallel
49
+ syntax_tree
50
+ syntax_tree-haml
51
+ syntax_tree-xml
52
+ terminal-table
53
+ w_syntax_tree-erb
54
+ yaml
55
+ dorian-arguments (1.2.3)
56
+ bigdecimal (>= 3.1, < 5)
57
+ dorian-eval (1.5.1)
58
+ yaml (>= 0.3, < 1)
59
+ dorian-progress (1.1.3)
60
+ ruby-progressbar (>= 1.13, < 2)
61
+ dorian-to_struct (2.0.3)
62
+ drb (2.2.3)
63
+ geom2d (0.4.1)
64
+ git (4.3.2)
65
+ activesupport (>= 5.0)
66
+ addressable (~> 2.8)
67
+ process_executer (~> 4.0)
68
+ rchardet (~> 1.9)
69
+ haml (7.2.0)
70
+ temple (>= 0.8.2)
71
+ thor
72
+ tilt
73
+ hexapdf (1.9.1)
74
+ cmdparse (~> 3.0, >= 3.0.3)
75
+ geom2d (~> 0.4, >= 0.4.1)
76
+ openssl (>= 2.2.1)
77
+ strscan (>= 3.1.2)
78
+ i18n (1.15.2)
35
79
  concurrent-ruby (~> 1.0)
36
- json (2.7.2)
37
- language_server-protocol (3.17.0.3)
38
- logger (1.6.1)
39
- minitest (5.25.1)
40
- parallel (1.26.3)
41
- parser (3.3.5.0)
80
+ json (2.20.0)
81
+ language_server-protocol (3.17.0.5)
82
+ libv8-node (24.12.0.1-arm64-darwin)
83
+ libv8-node (24.12.0.1-x86_64-linux)
84
+ lint_roller (1.1.0)
85
+ logger (1.7.0)
86
+ mini_racer (0.21.4)
87
+ libv8-node (~> 24.12.0.1)
88
+ minitest (6.0.6)
89
+ drb (~> 2.0)
90
+ prism (~> 1.5)
91
+ openssl (4.0.2)
92
+ ostruct (0.6.3)
93
+ parallel (2.1.0)
94
+ parser (3.3.11.1)
42
95
  ast (~> 2.4.1)
43
96
  racc
97
+ prettier_print (1.2.1)
98
+ prism (1.9.0)
99
+ process_executer (4.0.4)
100
+ track_open_instances (~> 0.1)
101
+ public_suffix (7.0.5)
44
102
  racc (1.8.1)
45
- rack (3.1.7)
103
+ rack (3.2.6)
46
104
  rainbow (3.1.1)
47
- regexp_parser (2.9.2)
48
- rspec (3.13.0)
105
+ rchardet (1.10.2)
106
+ regexp_parser (2.12.0)
107
+ rspec (3.13.2)
49
108
  rspec-core (~> 3.13.0)
50
109
  rspec-expectations (~> 3.13.0)
51
110
  rspec-mocks (~> 3.13.0)
52
- rspec-core (3.13.1)
111
+ rspec-core (3.13.6)
53
112
  rspec-support (~> 3.13.0)
54
- rspec-expectations (3.13.2)
113
+ rspec-expectations (3.13.5)
55
114
  diff-lcs (>= 1.2.0, < 2.0)
56
115
  rspec-support (~> 3.13.0)
57
- rspec-mocks (3.13.1)
116
+ rspec-mocks (3.13.8)
58
117
  diff-lcs (>= 1.2.0, < 2.0)
59
118
  rspec-support (~> 3.13.0)
60
- rspec-support (3.13.1)
61
- rubocop (1.66.1)
119
+ rspec-support (3.13.7)
120
+ rubocop (1.88.0)
62
121
  json (~> 2.3)
63
- language_server-protocol (>= 3.17.0)
64
- parallel (~> 1.10)
122
+ language_server-protocol (~> 3.17.0.2)
123
+ lint_roller (~> 1.1.0)
124
+ parallel (>= 1.10)
65
125
  parser (>= 3.3.0.2)
66
126
  rainbow (>= 2.2.2, < 4.0)
67
- regexp_parser (>= 2.4, < 3.0)
68
- rubocop-ast (>= 1.32.2, < 2.0)
127
+ regexp_parser (>= 2.9.3, < 3.0)
128
+ rubocop-ast (>= 1.49.0, < 2.0)
69
129
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (>= 2.4.0, < 3.0)
71
- rubocop-ast (1.32.3)
72
- parser (>= 3.3.1.0)
73
- rubocop-capybara (2.21.0)
74
- rubocop (~> 1.41)
75
- rubocop-factory_bot (2.26.1)
76
- rubocop (~> 1.61)
77
- rubocop-performance (1.21.1)
78
- rubocop (>= 1.48.1, < 2.0)
79
- rubocop-ast (>= 1.31.1, < 2.0)
80
- rubocop-rails (2.26.0)
130
+ unicode-display_width (>= 2.4.0, < 4.0)
131
+ rubocop-ast (1.49.1)
132
+ parser (>= 3.3.7.2)
133
+ prism (~> 1.7)
134
+ rubocop-capybara (3.0.0)
135
+ lint_roller (~> 1.1)
136
+ rubocop (~> 1.81)
137
+ rubocop-factory_bot (2.28.0)
138
+ lint_roller (~> 1.1)
139
+ rubocop (~> 1.72, >= 1.72.1)
140
+ rubocop-performance (1.26.1)
141
+ lint_roller (~> 1.1)
142
+ rubocop (>= 1.75.0, < 2.0)
143
+ rubocop-ast (>= 1.47.1, < 2.0)
144
+ rubocop-rails (2.35.5)
81
145
  activesupport (>= 4.2.0)
146
+ lint_roller (~> 1.1)
82
147
  rack (>= 1.1)
83
- rubocop (>= 1.52.0, < 2.0)
84
- rubocop-ast (>= 1.31.1, < 2.0)
85
- rubocop-rake (0.6.0)
86
- rubocop (~> 1.0)
87
- rubocop-rspec (3.0.4)
88
- rubocop (~> 1.61)
89
- rubocop-rspec_rails (2.30.0)
90
- rubocop (~> 1.61)
91
- rubocop-rspec (~> 3, >= 3.0.1)
148
+ rubocop (>= 1.75.0, < 2.0)
149
+ rubocop-ast (>= 1.44.0, < 2.0)
150
+ rubocop-rake (0.7.1)
151
+ lint_roller (~> 1.1)
152
+ rubocop (>= 1.72.1)
153
+ rubocop-rspec (3.10.2)
154
+ lint_roller (~> 1.1)
155
+ regexp_parser (>= 2.0)
156
+ rubocop (~> 1.86, >= 1.86.2)
157
+ rubocop-rspec_rails (2.32.0)
158
+ lint_roller (~> 1.1)
159
+ rubocop (~> 1.72, >= 1.72.1)
160
+ rubocop-rspec (~> 3.5)
92
161
  ruby-progressbar (1.13.0)
93
- securerandom (0.3.1)
94
- thor (1.3.2)
162
+ securerandom (0.4.1)
163
+ strscan (3.1.8)
164
+ syntax_tree (6.3.0)
165
+ prettier_print (>= 1.2.0)
166
+ syntax_tree-haml (4.0.3)
167
+ haml (>= 5.2)
168
+ prettier_print (>= 1.2.1)
169
+ syntax_tree (>= 6.0.0)
170
+ syntax_tree-xml (0.1.0)
171
+ prettier_print
172
+ syntax_tree (>= 2.0.1)
173
+ temple (0.10.4)
174
+ terminal-table (4.0.0)
175
+ unicode-display_width (>= 1.1.1, < 4)
176
+ thor (1.5.0)
177
+ tilt (2.7.0)
178
+ track_open_instances (0.1.15)
95
179
  tzinfo (2.0.6)
96
180
  concurrent-ruby (~> 1.0)
97
- unicode-display_width (2.5.0)
98
- zeitwerk (2.6.18)
181
+ unicode-display_width (3.2.0)
182
+ unicode-emoji (~> 4.1)
183
+ unicode-emoji (4.2.0)
184
+ uri (1.1.1)
185
+ w_syntax_tree-erb (0.12.0)
186
+ prettier_print (~> 1.2, >= 1.2.0)
187
+ syntax_tree (~> 6.1, >= 6.1.1)
188
+ yaml (0.4.0)
189
+ zeitwerk (2.8.2)
99
190
 
100
191
  PLATFORMS
101
192
  arm64-darwin-22
102
193
  arm64-darwin-23
194
+ arm64-darwin-24
195
+ arm64-darwin-25
103
196
  x86_64-linux
104
197
 
105
198
  DEPENDENCIES
106
199
  bundler-audit
200
+ dorian
107
201
  language-ruby!
108
202
  rspec
109
203
  rubocop-capybara
@@ -115,7 +209,7 @@ DEPENDENCIES
115
209
  rubocop-rspec_rails
116
210
 
117
211
  RUBY VERSION
118
- ruby 3.3.5p100
212
+ ruby 4.0.5
119
213
 
120
214
  BUNDLED WITH
121
- 2.5.18
215
+ 4.0.15
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 2.0.0
data/bin/dorian ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'dorian' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?(
17
+ "This file was generated by Bundler"
18
+ )
19
+ load(bundle_binstub)
20
+ else
21
+ abort(
22
+ "Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
23
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
24
+ )
25
+ end
26
+ end
27
+
28
+ require "rubygems"
29
+ require "bundler/setup"
30
+
31
+ load Gem.bin_path("dorian", "dorian")
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency "dorian-arguments"
16
16
  s.add_dependency "zeitwerk"
17
17
  s.metadata["rubygems_mfa_required"] = "true"
18
- s.required_ruby_version = ">= 3.3.0"
18
+ s.required_ruby_version = ">= 4.0"
19
19
  end
@@ -25,7 +25,7 @@ class Language
25
25
  end
26
26
 
27
27
  def to_s
28
- "#{@left} >> #{@right}".to_s
28
+ "#{@left} >> #{@right}"
29
29
  end
30
30
  end
31
31
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Language
4
+ class Atom
5
+ class Present < Atom
6
+ def initialize(parent: nil)
7
+ @parent = parent
8
+ end
9
+
10
+ def parse(parser)
11
+ clone =
12
+ Parser.new(
13
+ root: self,
14
+ input: parser.input,
15
+ cursor: parser.cursor,
16
+ buffer: parser.buffer
17
+ )
18
+
19
+ @parent&.parse(clone)
20
+ end
21
+
22
+ def to_s
23
+ @parent ? "(#{@parent}).present" : "present"
24
+ end
25
+ end
26
+ end
27
+ end
data/lib/language/atom.rb CHANGED
@@ -14,6 +14,10 @@ class Language
14
14
  Absent.new(parent: self)
15
15
  end
16
16
 
17
+ def present
18
+ Present.new(parent: self)
19
+ end
20
+
17
21
  def ignore
18
22
  Ignore.new(parent: self)
19
23
  end
data/lib/language.rb CHANGED
@@ -9,6 +9,10 @@ class Language
9
9
  Atom::Absent.new(parent: new)
10
10
  end
11
11
 
12
+ def self.present
13
+ Atom::Present.new(parent: new)
14
+ end
15
+
12
16
  def self.ignore
13
17
  Atom::Ignore.new(parent: new)
14
18
  end
data/package-lock.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "": {
7
7
  "license": "MIT",
8
8
  "engines": {
9
- "node": "22.5.1",
10
- "npm": "10.8.2"
9
+ "node": "26.3.1",
10
+ "npm": "11.17.0"
11
11
  }
12
12
  }
13
13
  }
data/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "engines": {
4
- "node": "22.5.1",
5
- "npm": "10.8.2"
4
+ "node": "26.3.1",
5
+ "npm": "11.17.0"
6
6
  }
7
7
  }
@@ -32,6 +32,15 @@ class Code
32
32
  .then { |output| output[:something].upcase }
33
33
  end
34
34
  end
35
+
36
+ class BooleanPresent < Language
37
+ def root
38
+ (
39
+ str("t").aka(:boolean) << str(" ").present << str(" ") <<
40
+ str("rest").aka(:string)
41
+ ) | str("trest").aka(:string)
42
+ end
43
+ end
35
44
  end
36
45
  end
37
46
 
@@ -55,4 +64,16 @@ RSpec.describe Language do
55
64
  it "works with then with output" do
56
65
  expect(Code::Parser::ThenWithOutput.parse("value")).to eq("VALUE")
57
66
  end
67
+
68
+ it "works with present (string)" do
69
+ expect(Code::Parser::BooleanPresent.parse("trest")).to eq(
70
+ { string: "trest" }
71
+ )
72
+ end
73
+
74
+ it "works with present (boolean and string)" do
75
+ expect(Code::Parser::BooleanPresent.parse("t rest")).to eq(
76
+ { boolean: "t", string: "rest" }
77
+ )
78
+ end
58
79
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: language-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dorian-arguments
@@ -49,6 +48,7 @@ files:
49
48
  - ".github/workflows/ci.yml"
50
49
  - ".gitignore"
51
50
  - ".node-version"
51
+ - ".npm-version"
52
52
  - ".prettierignore"
53
53
  - ".rspec"
54
54
  - ".rubocop.yml"
@@ -62,6 +62,7 @@ files:
62
62
  - bin/bundle
63
63
  - bin/bundle-audit
64
64
  - bin/bundler-audit
65
+ - bin/dorian
65
66
  - bin/language
66
67
  - bin/rspec
67
68
  - bin/rubocop
@@ -77,6 +78,7 @@ files:
77
78
  - lib/language/atom/ignore.rb
78
79
  - lib/language/atom/maybe.rb
79
80
  - lib/language/atom/or.rb
81
+ - lib/language/atom/present.rb
80
82
  - lib/language/atom/repeat.rb
81
83
  - lib/language/atom/str.rb
82
84
  - lib/language/atom/then.rb
@@ -99,7 +101,6 @@ licenses:
99
101
  - MIT
100
102
  metadata:
101
103
  rubygems_mfa_required: 'true'
102
- post_install_message:
103
104
  rdoc_options: []
104
105
  require_paths:
105
106
  - lib
@@ -107,15 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
108
  requirements:
108
109
  - - ">="
109
110
  - !ruby/object:Gem::Version
110
- version: 3.3.0
111
+ version: '4.0'
111
112
  required_rubygems_version: !ruby/object:Gem::Requirement
112
113
  requirements:
113
114
  - - ">="
114
115
  - !ruby/object:Gem::Version
115
116
  version: '0'
116
117
  requirements: []
117
- rubygems_version: 3.5.16
118
- signing_key:
118
+ rubygems_version: 4.0.15
119
119
  specification_version: 4
120
120
  summary: parser dsl
121
121
  test_files: []