sirop 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6ffcc66301949fc52bae4b2eef554243263b06a9bdf699d6be61d9d38f1ade1
4
- data.tar.gz: 6aeba8547c161f56a20e64d7cf219489bfd0f2195063ca8b651c821134944232
3
+ metadata.gz: eee92f9d96e1938e770c3c2eb445e43a68c67920e3e885a8016f2150ce429ec5
4
+ data.tar.gz: 5a7ebbb732eae90b4b3f35f54728f118684eab3f32575ce6000795310a6ca541
5
5
  SHA512:
6
- metadata.gz: 8dde7126119287b24f05352b5c62922a5023c80ff9ffb3f258ddf8824b6ce947b7f2551bc1818202036ac152815458e3126a838b3e91d147ed413cb6fb181818
7
- data.tar.gz: 83856a27062116324228881ff61172c62234ca3ce6992ba5ef8355db3f5a823e018695eb6e9e61b61b852cfa1b497039c1ad3fcbf6e7451bb0a9b14b64801da0
6
+ metadata.gz: bda8d3c698363b564d14077994cb96ccaabbf1408bab88e37492d88ec30d251926af93340ac376174b7f7c18f27408b9ab942bc68a16d3fdc27b32755d9209aa
7
+ data.tar.gz: 2a84dd4f5586e18f2a5b2eb87759285b20b422e484e6d4afebd58fd10a707a4baa962713b296c9b36a45b8a219b10552ceae3e29e8882e36c26022f9dc144371
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2025-01-09 0.5
2
+
3
+ - Add after_body hook for lambdas
4
+
1
5
  # 2024-04-29 0.4
2
6
 
3
7
  - Improve sourcifier to support all Ruby syntax, based on Prism test fixtures
@@ -18,6 +18,8 @@ class Prism::BlockParametersNode
18
18
  end
19
19
 
20
20
  class Prism::LambdaNode
21
+ attr_reader :after_body_proc
22
+
21
23
  # @param params [String] injected parameters
22
24
  # @return [void]
23
25
  def inject_parameters(params)
@@ -31,4 +33,8 @@ class Prism::LambdaNode
31
33
  instance_variable_set(:@parameters, Sirop::Injection.new("(#{params})"))
32
34
  end
33
35
  end
36
+
37
+ def after_body(&b)
38
+ @after_body_proc = b
39
+ end
34
40
  end
@@ -649,6 +649,7 @@ module Sirop
649
649
  emit_code(node.parameters)
650
650
  emit_code(node.opening_loc)
651
651
  emit_code(node.body, semicolon: node.opening_loc.slice == 'do')
652
+ node.after_body_proc&.(node)
652
653
  emit_code(node.closing_loc, semicolon: node.closing_loc.slice == 'end')
653
654
  end
654
655
 
data/lib/sirop/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Sirop
2
2
  # Sirop version
3
- VERSION = '0.4'
3
+ VERSION = '0.5'
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sirop
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2024-04-29 00:00:00.000000000 Z
10
+ date: 2025-01-09 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: prism
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.6.0.dev
79
+ rubygems_version: 3.6.2
80
80
  specification_version: 4
81
81
  summary: 'Sirop: Ruby code rewriter'
82
82
  test_files: []