disu.se

DependencyModule

Namespace

Inventory

Included by
Development

A development dependency is one that’s needed during development of a project.

Optional

An optional dependency is one that may or may not be needed during runtime.

Runtime

A runtime dependency is one that’s needed during runtime.

Some form of dependency of this project. A dependency can be #required, added to a gem specification, and has various information associated with it: #name, #major, #minor, #patch, and #feature.

Instance Methods

initialize(nameString, majorInteger, minorInteger, patchInteger, optionsHash = {})#

Sets up a dependency on project name, version major, minor, patch, along with any options. Any methods may be overridden on the instance in the optionally #instance_exec’d block, if a dependency has any non-standard requirements.

Options
:featureString = '%s-%s.0' % [name.gsub('-', '/'), major]

The name of the feature to load

requireBoolean#

Returns the result of requiring #feature.

add_to_gem_specification(specificationGem::Specification)self#

Add the receiver as a runtime dependency to specification.

to_sString#

Returns the version atoms on the form #major.#minor.#patch.

gem_requirementStringprivate#

Returns the version range to use in #add_to_gem_specification. The default is to use ~> #major.#minor if #major > 0 and ~> #major.#minor.#patch otherwise. The reasoning here is that the version numbers are using semantic versioning with the unfortunate use of minor and patch as a fake major/minor combination when major is 0, which is most often the case for Ruby projects. Start your major versions at 1 and you’ll avoid this misuse of version numbers.

nameString#

Returns the name of the project that this dependency pertains to.

majorInteger#

Returns the major version atom of the dependency.

minorInteger#

Returns the minor version atom of the dependency.

patchInteger#

Returns the patch version atom of the dependency.

featureString#

Returns the name of the feature to #require.