static_literal_parser 1.3.1 → 1.3.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/static_literal_parser.rb +3 -2
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92355876f3c25d3bbadaeda45c9db6839fd10cc51f80282f24f25f8894ed3638
4
- data.tar.gz: ce5057a81dc89744fcb9b4467e61e0a4e0a1eb550a6061f1f44f3ce461679bc9
3
+ metadata.gz: aff6dfa8f8fcafdc338c2b9e50ecebb74b48c1fcd594bde02d7509125a798eac
4
+ data.tar.gz: d43b05bf656f8fe253da12381d15b7e0f5c69e29b674c3641dca8e6acac64a36
5
5
  SHA512:
6
- metadata.gz: cd4350e8a9a5844d0dd5712d8ed4cca8fd7bd13807d8f85b5fd7fe064261a3c6b54ac512cfa88d72327705369980e54d338187236d679a7409992260435fb14e
7
- data.tar.gz: 5b64848177296a3b1f24145c9d973a7c52703d7e079144545cd2e9ae7953ccd3790c9a924ce1861e13dd33ef411cba5ba402def631d66cf8861dadafe45d89c7
6
+ metadata.gz: cdc043852e925c1426a8f14301ec3f87fef96611d4272d27a821513300e97a63913f5b5c7ac656fc1b12765849e4d97bf01d4dd2b6afce6cc9ae34eb666b8588
7
+ data.tar.gz: e9e3764e41ead14f31dcecfaea3a9dedbfecccfd6e62686781f29af3c3d09c1de3ee03b1aeac5bda600228040376770f8f98c3be6da34bc5e2f4cc3ca33f7987
@@ -30,13 +30,14 @@ module StaticLiteralParser
30
30
  when :FALSE
31
31
  false
32
32
  when :CONST
33
- constants[node.children[0]] or raise "Missing const: #{node.children[0]}"
33
+ constants.fetch(node.children[0]) { raise "Missing const: #{node.children[0]}" }
34
34
  when :COLON2
35
35
  (parent, child) = node.children
36
36
  case parent.type
37
37
  when :CONST, :COLON2
38
38
  parent = parse_(parent, constants)
39
- constants[:"#{parent}::#{child}"] or raise "Missing nested const: #{[parent, child]}"
39
+ name = :"#{parent}::#{child}"
40
+ constants.fetch(name) { raise "Missing nested const: #{[parent, child]}" }
40
41
  else
41
42
  raise "Unexpected COLON2 parent #{parent.type}"
42
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: static_literal_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuhiro Ujihisa
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2020-11-01 00:00:00.000000000 Z
10
+ date: 2026-11-11 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: StaticLiteralParser is a RubyGems library that you can convert a String
13
13
  to a Ruby object, parsing the string as an executable Ruby code, but without actually
@@ -30,14 +30,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.6.6
34
34
  required_rubygems_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements: []
40
- rubygems_version: 3.6.2
40
+ rubygems_version: 4.0.3
41
41
  specification_version: 4
42
42
  summary: StaticLiteralParser.parse(str, constants)
43
43
  test_files: []