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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a6c3c4ea122e5868314d24caef675f8dbc6e4d070d2aa971ccdfe51b3ab969d
4
- data.tar.gz: 83d03bab639162efe7bc68ba3a184801616d620d539c9e7e375b8bcf2ad12456
3
+ metadata.gz: 14243cf3ff6a019d43ede0de0ff3ef18e66a7b3dd67b90b4ff9962c94f67d050
4
+ data.tar.gz: 428709d2937e21ffec0dca92b93af53717275d1817709796628db2f3d11ff9b4
5
5
  SHA512:
6
- metadata.gz: 39bd428bb2fa0b0b5616f062b25452029b42bfd69e2f3f4b79348e73223fa361687cf93300dce215207077b60997c068c5ba4c518e0015a373cfa559d63d0055
7
- data.tar.gz: 1ba4e15904892e3bf63d1407ce63622a07867f1f2ab27e058efdec403361d8920ba94640923358cade0a0308fd110366083b357121af108f1a7ac2295f684ec5
6
+ metadata.gz: 5e4534a5bee591b83ff08f21d8b80e906838bf1934698da9652024918d85d9f415fe492291eca81f164165f61900d96155e8b3e0ac1c70c8859de6751e46122e
7
+ data.tar.gz: d787544a791a87615fb1754a67481743c3c7f85cb71b5a747895056c4d2b5b398708c66d8fe2031251a0c17aa9533f6352d5684743c09f3c7328de63ff30a37e
@@ -1,6 +1,10 @@
1
1
 
2
2
  = live_ast Changes
3
3
 
4
+ == Version 1.3.2
5
+
6
+ * Add support for Ruby 2.6
7
+
4
8
  == Version 1.3.1
5
9
 
6
10
  * Loosen dependency on ruby_parser
@@ -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
- NATIVE_EVAL.call("[__FILE__, __LINE__]", bind)
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.arg_to_str(args[1]) if args.length > 1
39
+ args[1] = Common.arg_to_str2(args[1]) if args.length > 1
40
40
  end
41
41
  end
42
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LiveAST
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.2"
5
5
  end
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.1
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-09 00:00:00.000000000 Z
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
- rubyforge_project:
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.