Artifact [4917841e91]
Artifact 4917841e9191e618c5f4341b0bf2fe0c892c094f:
- File lib/fpm/flags.rb — part of check-in [bbaf8bab13] at 2011-05-17 07:17:22 on branch trunk — - Add general way for source plugins to add flags specific to that plugin. For now, only 'gem' uses this. - Add flag --gem-bin-path to install a gem's executables to a specific place. Some folks like /usr/bin, so, package puppet with bins there: * fpm -s gem -t deb --gem-bin-path /usr/bin puppet The original implementation for this bin-path flag was by lassizci. https://github.com/jordansissel/fpm/pull/27 (user: jls@semicomplete.com size: 467)
require "fpm/namespace" class FPM::Flags def initialize(opts, flag_prefix, help_prefix) @opts = opts @flag_prefix = flag_prefix @help_prefix = help_prefix end # def initialize def on(*args, &block) fixed_args = args.collect do |arg| if arg =~ /^--/ "--#{@flag_prefix}-#{arg.gsub(/^--/, "")}" else "(#{@help_prefix}) #{arg}" end end @opts.on(*fixed_args, &block) end # def on end # class FPM::Flags