Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --gem-disable-dependencies flag to allow for excluding one or more dependencies #598

Merged
merged 1 commit into from Apr 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/fpm/package/gem.rb
Expand Up @@ -38,6 +38,9 @@ class FPM::Package::Gem < FPM::Package
"shebang rewritten to use env?", :default => true

option "--prerelease", :flag, "Allow prerelease versions of a gem", :default => false
option "--disable-dependencies", "gem_name",
"The gem name to remove from dependency list",
:multivalued => true, :attribute_name => :gem_disable_dependencies

def input(gem)
# 'arg' is the name of the rubygem we should unpack.
Expand Down Expand Up @@ -147,6 +150,10 @@ def load_package_info(gem_path)

# Some reqs can be ">= a, < b" versions, let's handle that.
reqs.to_s.split(/, */).each do |req|
if attributes[:gem_disable_dependencies]
next if attributes[:gem_disable_dependencies].include?(dep.name)
end

if attributes[:gem_fix_dependencies?]
name = fix_name(dep.name)
else
Expand Down