mvz-live_ast 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.
- checksums.yaml +4 -4
- data/CHANGES.rdoc +4 -0
- data/lib/live_ast/common.rb +18 -1
- data/lib/live_ast/replace_eval.rb +1 -1
- data/lib/live_ast/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14243cf3ff6a019d43ede0de0ff3ef18e66a7b3dd67b90b4ff9962c94f67d050
|
4
|
+
data.tar.gz: 428709d2937e21ffec0dca92b93af53717275d1817709796628db2f3d11ff9b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4534a5bee591b83ff08f21d8b80e906838bf1934698da9652024918d85d9f415fe492291eca81f164165f61900d96155e8b3e0ac1c70c8859de6751e46122e
|
7
|
+
data.tar.gz: d787544a791a87615fb1754a67481743c3c7f85cb71b5a747895056c4d2b5b398708c66d8fe2031251a0c17aa9533f6352d5684743c09f3c7328de63ff30a37e
|
data/CHANGES.rdoc
CHANGED
data/lib/live_ast/common.rb
CHANGED
@@ -13,6 +13,19 @@ module LiveAST
|
|
13
13
|
raise TypeError, message
|
14
14
|
end
|
15
15
|
|
16
|
+
def arg_to_str2(arg)
|
17
|
+
arg.to_str
|
18
|
+
rescue NameError
|
19
|
+
thing = arg.nil? ? nil : arg.class
|
20
|
+
|
21
|
+
message = if RUBY_VERSION >= "2.6.0"
|
22
|
+
"wrong argument type #{thing.inspect} (expected String)"
|
23
|
+
else
|
24
|
+
"no implicit conversion of #{thing.inspect} into String"
|
25
|
+
end
|
26
|
+
raise TypeError, message
|
27
|
+
end
|
28
|
+
|
16
29
|
def check_arity(args, range)
|
17
30
|
return if range.include? args.size
|
18
31
|
|
@@ -35,7 +48,11 @@ module LiveAST
|
|
35
48
|
if bind
|
36
49
|
case location.size
|
37
50
|
when 0
|
38
|
-
|
51
|
+
if RUBY_VERSION < "2.6.0"
|
52
|
+
NATIVE_EVAL.call("[__FILE__, __LINE__]", bind)
|
53
|
+
else
|
54
|
+
bind.source_location
|
55
|
+
end
|
39
56
|
when 1
|
40
57
|
[location.first, 1]
|
41
58
|
else
|
@@ -36,7 +36,7 @@ module LiveAST
|
|
36
36
|
def handle_args(args)
|
37
37
|
LiveAST::Common.check_arity(args, 1..3)
|
38
38
|
args[0] = Common.arg_to_str(args[0])
|
39
|
-
args[1] = Common.
|
39
|
+
args[1] = Common.arg_to_str2(args[1]) if args.length > 1
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/lib/live_ast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mvz-live_ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James M. Lawrence
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-12-
|
12
|
+
date: 2018-12-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby2ruby
|
@@ -220,8 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
|
224
|
-
rubygems_version: 2.7.6
|
223
|
+
rubygems_version: 3.0.1
|
225
224
|
signing_key:
|
226
225
|
specification_version: 4
|
227
226
|
summary: Live abstract syntax trees of methods and procs.
|