Module: Opal::UseGem

Included in:
Opal, Builder
Defined in:
/Users/elia/Code/opal-docs/opal/lib/opal/paths.rb

Instance Method Summary collapse

Instance Method Details

#use_gem(gem_name, include_dependencies = true) ⇒ Object

Adds the "require_paths" (usually lib/) of gem with the given name to Opal paths. By default will include the "require_paths" from all the dependent gems.

Parameters:

  • gem_name (String)

    the name of the gem

  • include_dependencies (Boolean) (defaults to: true)

    whether or not to add recursively the gem's dependencies


36
37
38
# File '/Users/elia/Code/opal-docs/opal/lib/opal/paths.rb', line 36

def use_gem(gem_name, include_dependencies = true)
  append_paths(*require_paths_for_gem(gem_name, include_dependencies))
end