Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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. #27
- Loading branch information
1 parent
5288f92
commit 00e6e8b
Showing
4 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters