rbs 0.9.0 → 0.9.1

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: cbe5937993dd712f397e9008911a67bea344277222c45f94f09d1fe6e30399d8
4
- data.tar.gz: 914834d0f1bcb1d5e13dd8bb8446f8bfd544625ed8bf49d673fce5d47063b20c
3
+ metadata.gz: '094182e5d2602ec5ba9244068f67f854dfd5aa9c804fe48f2e943934da3e806b'
4
+ data.tar.gz: bbd2a02e2c79a092f3e3555337aebdb557301fd2dd712bc46bcfaaa3ae4f3ed5
5
5
  SHA512:
6
- metadata.gz: 7ab09d820f4254c7be5648c64c43fd349414393eaecc7875fea580442f34f88b6284d4af360bcc3a9c4181cf6c0c041f39cf58b49c81ce913fe2051872517719
7
- data.tar.gz: e27fd8bd3df37c73efeb6e56c355b76c6f12aa3ff538e4b6dacf5d627a9894947decd5edcdb76715fc3bb94bff42bb6ef286f6c1cfc69aeab20ae2db3a8f7ddc
6
+ metadata.gz: 8de689c6af71a94ef511cd5efc9b64d1277f99256e759ec58ad4185505831e3ca041a8555f454ea6700713a4f03a88caeed2104009b8915b9acf5c8b4e5ba53b
7
+ data.tar.gz: dec9ab30d0d1261897103b71c7203d3857c2cd4150ef145f3b8f3d005b7ba3f9daa947033a1db37c7f7aaf7530725f9129707d29def747fe9334a75acbcc9a16
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.9.1 (2020-08-04)
6
+
7
+ * Ensure using Module#name [#354](https://github.com/ruby/rbs/pull/354)
8
+ * Fix runtime test setup [#353](https://github.com/ruby/rbs/pull/353)
9
+
5
10
  ## 0.9.0 (2020-08-03)
6
11
 
7
12
  * Fix signature validation [#351](https://github.com/ruby/rbs/pull/351), [#352](https://github.com/ruby/rbs/pull/352)
@@ -9,15 +9,16 @@ logger = Logger.new(STDERR)
9
9
 
10
10
  begin
11
11
  opts = Shellwords.shellsplit(ENV["RBS_TEST_OPT"] || "-I sig")
12
- filter = ENV.fetch('RBS_TEST_TARGET').split(',').map! { |e| e.strip }
12
+ filter = ENV.fetch('RBS_TEST_TARGET', "").split(',').map! { |e| e.strip }
13
13
  skips = (ENV['RBS_TEST_SKIP'] || '').split(',').map! { |e| e.strip }
14
14
  RBS.logger_level = (ENV["RBS_TEST_LOGLEVEL"] || "info")
15
15
  sample_size = get_sample_size(ENV['RBS_TEST_SAMPLE_SIZE'] || '')
16
16
  rescue InvalidSampleSizeError => exception
17
17
  RBS.logger.error exception.message
18
18
  exit 1
19
- rescue Exception => e
20
- raise e.message
19
+ end
20
+
21
+ if filter.empty?
21
22
  STDERR.puts "rbs/test/setup handles the following environment variables:"
22
23
  STDERR.puts " [REQUIRED] RBS_TEST_TARGET: test target class name, `Foo::Bar,Foo::Baz` for each class or `Foo::*` for all classes under `Foo`"
23
24
  STDERR.puts " [OPTIONAL] RBS_TEST_SKIP: skip testing classes"
@@ -50,12 +51,14 @@ end
50
51
 
51
52
  tester = RBS::Test::Tester.new(env: env)
52
53
 
54
+ module_name = Module.instance_method(:name)
55
+
53
56
  TracePoint.trace :end do |tp|
54
- class_name = tp.self.name&.yield_self {|name| to_absolute_typename name }
57
+ class_name = module_name.bind(tp.self).call&.yield_self {|name| to_absolute_typename name }
55
58
 
56
59
  if class_name
57
60
  if filter.any? {|f| match(to_absolute_typename(f).to_s, class_name.to_s) } && skips.none? {|f| match(f, class_name.to_s) }
58
- if tester.checkers.none? {|hook| hook.klass == tp.self }
61
+ unless tester.targets.include?(tp.self)
59
62
  if env.class_decls.key?(class_name)
60
63
  logger.info "Setting up hooks for #{class_name}"
61
64
  tester.install!(tp.self, sample_size: sample_size)
@@ -67,8 +70,8 @@ end
67
70
 
68
71
  at_exit do
69
72
  if $!.nil? || $!.is_a?(SystemExit) && $!.success?
70
- logger.warn "No type checker was installed! " if tester.checkers.empty?
73
+ if tester.targets.empty?
74
+ logger.warn "No type checker was installed!"
75
+ end
71
76
  end
72
77
  end
73
-
74
-
@@ -2,11 +2,11 @@ module RBS
2
2
  module Test
3
3
  class Tester
4
4
  attr_reader :env
5
- attr_reader :checkers
5
+ attr_reader :targets
6
6
 
7
7
  def initialize(env:)
8
8
  @env = env
9
- @checkers = []
9
+ @targets = []
10
10
  end
11
11
 
12
12
  def factory
@@ -45,6 +45,8 @@ module RBS
45
45
  end
46
46
  end
47
47
  end
48
+
49
+ targets << klass
48
50
  end
49
51
 
50
52
  def new_key(type_name, prefix)
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-02 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.