lib/require_smasher.rb in require_smasher-0.3.2 vs lib/require_smasher.rb in require_smasher-0.4.0

- old
+ new

@@ -1,9 +1,17 @@ require 'require_smasher/version' require 'require_smasher/file_smasher' require 'require_smasher/classifier' require 'require_smasher/require_file' +require 'require_smasher/errors/base_error' +require 'require_smasher/errors/not_informed_error' +require 'require_smasher/errors/not_informed_error/dir_not_informed_error' +require 'require_smasher/errors/not_informed_error/file_not_informed_error' +require 'require_smasher/errors/not_informed_error/gem_not_informed_error' +require 'require_smasher/errors/not_exist_error' +require 'require_smasher/errors/not_exist_error/dir_not_exist_error' +require 'require_smasher/errors/require_file_error' def require_all(*required_list) classified = Classifier.classify(required_list) gems = classified[:gems] files = classified[:files] @@ -29,10 +37,11 @@ def require_dirs(*directories) RequireFile.require_directories(directories) end def require_gems(*gems) - raise StandardError, 'Gem was not informed' if gems.empty? + raise GemNotInformedError if gems.empty? + gems.uniq.each { |gem| require gem } end def require_files(*files) RequireFile.require(files)