summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli.rb1
-rw-r--r--lib/bundler/injector.rb9
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index d271086b25..9046c0115c 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -367,6 +367,7 @@ module Bundler
method_option "version", :aliases => "-v", :type => :string
method_option "group", :aliases => "-g", :type => :string
method_option "source", :aliases => "-s", :type => :string
+ method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
method_option "git", :type => :string
method_option "branch", :type => :string
method_option "skip-install", :type => :boolean, :banner =>
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb
index 613bda4f84..5e5dfca02e 100644
--- a/lib/bundler/injector.rb
+++ b/lib/bundler/injector.rb
@@ -113,8 +113,9 @@ module Bundler
source = ", :source => \"#{d.source}\"" unless d.source.nil?
git = ", :git => \"#{d.git}\"" unless d.git.nil?
branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
+ require_path = ", :require => #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
- %(gem #{name}#{requirement}#{group}#{source}#{git}#{branch})
+ %(gem #{name}#{requirement}#{group}#{source}#{git}#{branch}#{require_path})
end.join("\n")
end
@@ -269,5 +270,11 @@ module Bundler
def show_warning(message)
Bundler.ui.info Bundler.ui.add_color(message, :yellow)
end
+
+ def convert_autorequire(autorequire)
+ autorequire = autorequire.first
+ return autorequire if autorequire == "false"
+ autorequire.inspect
+ end
end
end