lib/csd/applications.rb in csd-0.1.4 vs lib/csd/applications.rb in csd-0.1.5

- old
+ new

@@ -11,22 +11,27 @@ # Returns nil if application could not be found # def self.find(app_name) begin + UI.debug "Applications.find: Attempting to require `#{File.join(Path.applications, app_name.to_s)}´." require File.join(Path.applications, app_name.to_s) + UI.debug "Applications.find: Attempting to load `#{app_name}´." ActiveSupport::Inflector.constantize "CSD::Application::#{app_name.camelize}" - rescue LoadError - UI.debug "The Application `#{app_name}´ could not be loaded properly." + rescue LoadError => e + UI.debug "Applications.find: The Application `#{app_name}´ could not be loaded properly." + UI.debug " Reason: #{e}" nil end end def self.all(&block) result = [] Dir.directories(Path.applications) do |dir| next if dir == 'default' + UI.debug "Applications.all: Identified application directory `#{dir}´." if app = find(dir) + UI.debug "Applications.all: The application `#{dir}´ is valid." block_given? ? yield(app) : result << app end end result end \ No newline at end of file