diff options
author | Boggs <hello.boggs@gmail.com> | 2016-06-15 18:09:07 +0800 |
---|---|---|
committer | Boggs <hello.boggs@gmail.com> | 2016-06-15 18:09:07 +0800 |
commit | d82d7b783a8a969fbf97a69cfdc447f30583ebce (patch) | |
tree | af065ab17285f538910b8665cb9dd4f854b56eb4 /lib/bundler/cli | |
parent | 09e06a3093d5c61bc1079858b5c8d9b7b007bb1b (diff) | |
download | bundler-d82d7b783a8a969fbf97a69cfdc447f30583ebce.tar.gz |
Add `--pre` flag to add prerelease gems
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r-- | lib/bundler/cli/inject.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb index 4e49bf7cd5..bebc438370 100644 --- a/lib/bundler/cli/inject.rb +++ b/lib/bundler/cli/inject.rb @@ -37,7 +37,9 @@ module Bundler definition = Bundler.definition(true) definition.resolve_remotely! specs = definition.index[name].sort_by(&:version) - specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? } + unless options[:pre] + specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? } + end spec = specs.last spec.version.to_s end |