sirop 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sirop/prism_ext.rb +6 -0
- data/lib/sirop/sourcifier.rb +1 -0
- data/lib/sirop/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eee92f9d96e1938e770c3c2eb445e43a68c67920e3e885a8016f2150ce429ec5
|
4
|
+
data.tar.gz: 5a7ebbb732eae90b4b3f35f54728f118684eab3f32575ce6000795310a6ca541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda8d3c698363b564d14077994cb96ccaabbf1408bab88e37492d88ec30d251926af93340ac376174b7f7c18f27408b9ab942bc68a16d3fdc27b32755d9209aa
|
7
|
+
data.tar.gz: 2a84dd4f5586e18f2a5b2eb87759285b20b422e484e6d4afebd58fd10a707a4baa962713b296c9b36a45b8a219b10552ceae3e29e8882e36c26022f9dc144371
|
data/CHANGELOG.md
CHANGED
data/lib/sirop/prism_ext.rb
CHANGED
@@ -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
|
data/lib/sirop/sourcifier.rb
CHANGED
@@ -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
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
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
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.
|
79
|
+
rubygems_version: 3.6.2
|
80
80
|
specification_version: 4
|
81
81
|
summary: 'Sirop: Ruby code rewriter'
|
82
82
|
test_files: []
|