method

gem

Importance_2
v2_5_5 - Show latest stable - 0 notes - Class: GemDependencyAPI
gem(name, *requirements) public

:category: Gem Dependencies DSL

Specifies a gem dependency with the given name and requirements. You may also supply options following the requirements

options include:

require:

RubyGems does not provide any autorequire features so requires in a gem dependencies file are recorded but ignored.

In bundler the require: option overrides the file to require during Bundler.require. By default the name of the dependency is required in Bundler. A single file or an Array of files may be given.

To disable requiring any file give false:

gem 'rake', require: false

group:

Place the dependencies in the given dependency group. A single group or an Array of groups may be given.

See also #group

platform:

Only install the dependency on the given platform. A single platform or an Array of platforms may be given.

See #platform for a list of platforms available.

path:

Install this dependency from an unpacked gem in the given directory.

gem 'modified_gem', path: 'vendor/modified_gem'

git:

Install this dependency from a git repository:

gem 'private_gem', git: git@my.company.example:private_gem.git'

gist:

Install this dependency from the gist ID:

gem 'bang', gist: '1232884'

github:

Install this dependency from a github git repository:

gem 'private_gem', github: 'my_company/private_gem'

submodules:

Set to true to include submodules when fetching the git repository for git:, gist: and github: dependencies.

ref:

Use the given commit name or SHA for git:, gist: and github: dependencies.

branch:

Use the given branch for git:, gist: and github: dependencies.

tag:

Use the given tag for git:, gist: and github: dependencies.

Show source
Register or log in to add new notes.