Skip to content

Commit

Permalink
- Add flag --gem-gem to specify the path to the 'gem' tool
Browse files Browse the repository at this point in the history
  Default is 'gem' and uses $PATH
  #85
  • Loading branch information
jordansissel committed Aug 20, 2011
1 parent c71a414 commit 1833e94
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/fpm/source/gem.rb
Expand Up @@ -7,6 +7,8 @@


class FPM::Source::Gem < FPM::Source class FPM::Source::Gem < FPM::Source
def self.flags(opts, settings) def self.flags(opts, settings)
settings.source[:gem] = "gem"

opts.on("--bin-path DIRECTORY", opts.on("--bin-path DIRECTORY",
"The directory to install gem executables") do |path| "The directory to install gem executables") do |path|
settings.source[:bin_path] = path settings.source[:bin_path] = path
Expand All @@ -15,6 +17,12 @@ def self.flags(opts, settings)
"Prefix for gem packages") do |package_prefix| "Prefix for gem packages") do |package_prefix|
settings.source[:package_prefix] = package_prefix settings.source[:package_prefix] = package_prefix
end end

opts.on("--gem PATH_TO_GEM",
"The path to the 'gem' tool (defaults to 'gem' and searches " \
"your $PATH)") do |path|
settings.source[:gem] = path
end
end # def flags end # def flags


def get_source(params) def get_source(params)
Expand Down Expand Up @@ -131,7 +139,7 @@ def make_tarball!(tar_path, builddir)
end end


::FileUtils.mkdir_p(installdir) ::FileUtils.mkdir_p(installdir)
args = ["gem", "install", "--quiet", "--no-ri", "--no-rdoc", args = [self[:settings][:gem], "install", "--quiet", "--no-ri", "--no-rdoc",
"--install-dir", installdir, "--ignore-dependencies", "-E"] "--install-dir", installdir, "--ignore-dependencies", "-E"]
if self[:settings][:bin_path] if self[:settings][:bin_path]
tmp_bin_path = File.join(tmpdir, self[:settings][:bin_path]) tmp_bin_path = File.join(tmpdir, self[:settings][:bin_path])
Expand Down

0 comments on commit 1833e94

Please sign in to comment.