* Remove unnecessary exception variable
* You can use strings, symbols, and anything else that handles to_s as a library name
| 39 | 40 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | class MultipleDependencyRequirement #:nodoc: |
| 36 | 36 | # :type :any or :all |
| 37 | # :libraries an array of strings to try to +require+ | |
| 37 | # :libraries an array of strings/symbols/etc. to try to +require+ | |
| 38 | 38 | def initialize(type, libraries) |
| 39 | 39 | @type = type |
| 40 | 40 | @libraries = libraries |
| --- | --- | |
| 46 | 46 | libraries.each do |lib| |
| 47 | 47 | begin |
| 48 | 48 | require lib.to_s |
| 49 | rescue LoadError, MissingSourceFile => e | |
| 50 | @failed_libraries << lib | |
| 49 | rescue LoadError, MissingSourceFile | |
| 50 | @failed_libraries << lib.to_s | |
| 51 | 51 | end |
| 52 | 52 | end |
| 53 | 53 | |
