summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrim Mittal <agrimmittal97@gmail.com>2018-05-02 16:47:35 +0530
committerAgrim Mittal <agrimmittal97@gmail.com>2018-05-14 18:48:44 +0530
commitdddfcf24ebce9e69aea74c3342a64d42c3e17ec3 (patch)
treed586799f43d3d75d32312027fb8168b3e4955529
parent9e87a1ca4b0c3002ac2774e4837234cef7e3ce08 (diff)
downloadbundler-dddfcf24ebce9e69aea74c3342a64d42c3e17ec3.tar.gz
Add documentation for --skip-install flag
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--man/bundle-add.ronn9
-rw-r--r--spec/commands/add_spec.rb2
3 files changed, 9 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 3a15ec6dc5..f3340f7cf7 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -334,7 +334,7 @@ module Bundler
method_option "group", :aliases => "-g", :type => :string
method_option "source", :aliases => "-s", :type => :string
method_option "skip-install", :type => :boolean, :banner =>
- "Adds gem to gemfile but does not install it"
+ "Adds gem to the Gemfile but does not install it"
def add(gem_name)
require "bundler/cli/add"
Add.new(options.dup, gem_name).run
diff --git a/man/bundle-add.ronn b/man/bundle-add.ronn
index f0f9b54d8f..91eb1d7188 100644
--- a/man/bundle-add.ronn
+++ b/man/bundle-add.ronn
@@ -3,10 +3,10 @@ bundle-add(1) -- Add gem to the Gemfile and run bundle install
## SYNOPSIS
-`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
+`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE] [--skip-install]
## DESCRIPTION
-Adds the named gem to the Gemfile and run `bundle install`.
+Adds the named gem to the Gemfile and run `bundle install`. `bundle install` can be avoided by using the flag `--skip-install`.
Example:
@@ -16,6 +16,8 @@ bundle add rails --version "< 3.0, > 1.1"
bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
+bundle add rails --skip-install
+
bundle add rails --group "development, test"
## OPTIONS
@@ -27,3 +29,6 @@ bundle add rails --group "development, test"
* `--source`, , `-s`:
Specify the source for the added gem.
+
+* `--skip-install`:
+ Adds the gem to the Gemfile but does not install it.
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb
index 194ff7651b..7299938caa 100644
--- a/spec/commands/add_spec.rb
+++ b/spec/commands/add_spec.rb
@@ -85,7 +85,7 @@ RSpec.describe "bundle add" do
it "adds gem to Gemfile but is not installed" do
bundle "add foo --skip-install --version=2.0"
- expect(bundled_app("Gemfile").read).to match(%r{gem "foo", "= 2.0"})
+ expect(bundled_app("Gemfile").read).to match(/gem "foo", "= 2.0"/)
expect(the_bundle).to_not include_gems "foo 2.0"
end
end