From 730301ba57ad8158bc0b748d52a816cc356cc7aa Mon Sep 17 00:00:00 2001 From: Watson Date: Mon, 29 Apr 2013 22:02:29 +0900 Subject: [PATCH] more fix in detecting file dependencies if add the constant name into @defined and @referred in #on_const_path_ref, it might not detect dependencies. --- lib/motion/project/builder.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index 080ec46a..e5ad94b1 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -635,9 +635,25 @@ PLIST def on_const_path_ref(parent, args) type, name, position = args if type == :@const - @defined << name @referred << name end + args + end + + def on_module(const, *args) + type, name = const + if type == :@const + @defined << name + @referred.delete(name) + end + end + + def on_class(const, *args) + type, name = const + if type == :@const + @defined << name + @referred.delete(name) + end end end end