lib/boson/manager.rb in boson-0.2.5 vs lib/boson/manager.rb in boson-0.3.0

- old
+ new

@@ -38,19 +38,24 @@ end def rescue_load_action(library, load_method) yield rescue AppendFeaturesFalseError + warn "DEBUG: Library #{library} didn't load due to append_features" if Runner.debug rescue LoaderError=>e FileLibrary.reset_file_cache(library.to_s) failed_libraries << library $stderr.puts "Unable to #{load_method} library #{library}. Reason: #{e.message}" - rescue StandardError=>e + rescue StandardError, SyntaxError, LoadError =>e FileLibrary.reset_file_cache(library.to_s) failed_libraries << library message = "Unable to #{load_method} library #{library}. Reason: #{$!}" - message += "\n" + e.backtrace.slice(0,3).map {|e| " " + e }.join("\n") if @options[:verbose] + if Runner.debug + message += "\n" + e.backtrace.map {|e| " " + e }.join("\n") + elsif @options[:verbose] + message += "\n" + e.backtrace.slice(0,3).map {|e| " " + e }.join("\n") + end $stderr.puts message ensure Inspector.disable if Inspector.enabled end @@ -141,10 +146,10 @@ def create_instance_aliases(aliases_hash) Alias.manager.create_aliases(:instance_method, aliases_hash) end def create_class_aliases(mod, class_commands) - class_commands.each {|k,v| + class_commands.dup.each {|k,v| if v.is_a?(Array) class_commands.delete(k).each {|e| class_commands[e] = "#{k}.#{e}"} end } Alias.manager.create_aliases(:any_to_instance_method, mod.to_s=>class_commands.invert) \ No newline at end of file