dissociated_introspection 0.11.0 → 0.12.0
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/dissociated_introspection/method_in_liner.rb +12 -3
- data/lib/dissociated_introspection/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8040b8f7ef63c5de08e4b88d65fe5ca999234c322cfb5af86d39878c1f6e08e3
|
4
|
+
data.tar.gz: 57248fae037569c0aebb652e6392f898a9b02c6f7c3c877aaf87a1b15de56bd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88c2abac9098f88bbb57f0ea57141e53a2923787d4d24094ff43d2d021c2f7a03c8e709f9b3f0c2219d81bc38d2b015271f8e47c1d15ce861e2c2eb75da3de08
|
7
|
+
data.tar.gz: 547e6a36dbc1734a9f5ba16b68703eedf2e87b66364e04c3b39fc771c05fa2ce67301809d6ed09b91d1630b6b68fc480500429d94c4a92fbf23a6ed12527fb39
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.12.0 - 2018-08-02
|
5
|
+
### Enhancement
|
6
|
+
- MethodInLiner will now recursively in-lines methods.
|
7
|
+
|
4
8
|
## 0.11.0 - 2018-08-01
|
5
9
|
### Enhancement
|
6
10
|
- Ability to Inline local methods with the exception of ones with arguments passed.
|
@@ -20,12 +20,21 @@ module DissociatedIntrospection
|
|
20
20
|
attr_accessor :defs
|
21
21
|
|
22
22
|
def on_send(node)
|
23
|
+
if (result = in_line_calls(node))
|
24
|
+
result
|
25
|
+
else
|
26
|
+
super
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def in_line_calls(node)
|
23
31
|
called_on, method_name, *args = *node
|
24
32
|
# TODO: Deal with args by replacing lvar with passed objects
|
25
|
-
return
|
33
|
+
return unless args.empty? && called_on_self?(called_on)
|
26
34
|
called_method = called_method(method_name)
|
27
|
-
return
|
28
|
-
|
35
|
+
return unless called_method
|
36
|
+
processed_called_method = process(called_method.body.ast)
|
37
|
+
node.updated(processed_called_method.type, processed_called_method.children)
|
29
38
|
end
|
30
39
|
|
31
40
|
def called_on_self?(called_on)
|