tapioca 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapioca/compilers/symbol_table/symbol_generator.rb +23 -1
- data/lib/tapioca/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8843a601bd4e5a685e116ee6c85e4045d1373efa827a74d0a81fdfbf010e81b5
|
4
|
+
data.tar.gz: 4692376ebaa71712f5979cf9dbdfe926556011ab49c237dde05c7ef59817da12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb00333afc55d6de709d6f211859dee1e1c6ed04c7b535b32f1860f1fc2717293c68d3cf542dbfe36a26fb62c406d7a63de6f7296b50cebf2579984d3b3af1a
|
7
|
+
data.tar.gz: d6199e46bf54ba1907186f27478449ba6431ec26b346028acff456dc54ea78ef58c18e6281901b9f6e1224e1cda0250ac7c66879b3286ff38cea407f6673475c
|
@@ -540,15 +540,37 @@ module Tapioca
|
|
540
540
|
Module.instance_method(:constants).bind(constant).call(false)
|
541
541
|
end
|
542
542
|
|
543
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
544
|
+
def raw_name_of(constant)
|
545
|
+
Module.instance_method(:name).bind(constant).call
|
546
|
+
end
|
547
|
+
|
543
548
|
sig { params(constant: Module).returns(T.nilable(String)) }
|
544
549
|
def name_of(constant)
|
545
|
-
name =
|
550
|
+
name = name_of_proxy_target(constant)
|
551
|
+
return name if name
|
552
|
+
name = raw_name_of(constant)
|
546
553
|
return if name.nil?
|
547
554
|
return unless are_equal?(constant, resolve_constant(name))
|
548
555
|
name = "Struct" if name =~ /^(::)?Struct::[^:]+$/
|
549
556
|
name
|
550
557
|
end
|
551
558
|
|
559
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
560
|
+
def name_of_proxy_target(constant)
|
561
|
+
klass = class_of(constant)
|
562
|
+
return unless raw_name_of(klass) == "ActiveSupport::Deprecation::DeprecatedConstantProxy"
|
563
|
+
# We are dealing with a ActiveSupport::Deprecation::DeprecatedConstantProxy
|
564
|
+
# so try to get the name of the target class
|
565
|
+
begin
|
566
|
+
target = Kernel.instance_method(:send).bind(constant).call(:target)
|
567
|
+
rescue NoMethodError
|
568
|
+
return nil
|
569
|
+
end
|
570
|
+
|
571
|
+
name_of(target)
|
572
|
+
end
|
573
|
+
|
552
574
|
sig { params(constant: Module).returns(T.nilable(String)) }
|
553
575
|
def qualified_name_of(constant)
|
554
576
|
name = name_of(constant)
|
data/lib/tapioca/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapioca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ufuk Kayserilioglu
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-07-
|
14
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: pry
|