Sha256: ee936bc300f30b415ad23a47cae6eabc2f28d42c4a56b089cdcbbb5e314d8e1f

Contents?: true

Size: 259 Bytes

Versions: 11

Compression:

Stored size: 259 Bytes

Contents

class Object
  # Requires the specified argument but silently ignores any LoadErrors.
  def require_optional(*args)
    require *args
  rescue LoadError
    # that's fine, it's an optional require
  end
  alias_method :optional_require, :require_optional
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
wagons-0.4.8 lib/wagons/extensions/require_optional.rb
wagons-0.4.7 lib/wagons/extensions/require_optional.rb
wagons-0.4.6 lib/wagons/extensions/require_optional.rb
wagons-0.4.5 lib/wagons/extensions/require_optional.rb
wagons-0.4.4 lib/wagons/extensions/require_optional.rb
wagons-0.4.3 lib/wagons/extensions/require_optional.rb
wagons-0.4.2 lib/wagons/extensions/require_optional.rb
wagons-0.4.1 lib/wagons/extensions/require_optional.rb
wagons-0.4.0 lib/wagons/extensions/require_optional.rb
wagons-0.3.1 lib/wagons/extensions/require_optional.rb
wagons-0.3.0 lib/wagons/extensions/require_optional.rb