Method: Kernel#load_dependencies

Defined in:
lib/merb-core/core_ext/kernel.rb

#load_dependencies(*args) ⇒ Object

Note:

Each argument can be:

String

Single dependency.

Hash

Multiple dependencies where the keys are names and the values versions.

Array

Multiple string dependencies.

Loads both gem and library dependencies that are passed in as arguments.

Examples:

dependencies "RedCloth" # Loads the the RedCloth gem


dependencies "RedCloth", "merb_helpers" # Loads RedCloth and merb_helpers


dependencies "RedCloth" => "3.0" # Loads RedCloth 3.0


Parameters:

  • *args (String, Hash, Array)

    The dependencies to load.



92
93
94
95
96
97
98
99
100
# File 'lib/merb-core/core_ext/kernel.rb', line 92

def load_dependencies(*args)
  args.each do |arg|
    case arg
    when String then load_dependency(arg)
    when Hash   then arg.each { |r,v| load_dependency(r, v) }
    when Array  then arg.each { |r|   load_dependency(r)    }
    end
  end
end