Blob Blame History Raw
From 03b7582e31df76cd54db80136e4076123c71f82a Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Mon, 5 Nov 2018 22:16:55 +0100
Subject: [PATCH 0/9] jekyll/commands: remove "bundle install" step for "new"
 command

---
 lib/jekyll/commands/new.rb | 30 +-----------------------------
 test/test_new_command.rb   |  8 --------
 2 files changed, 1 insertion(+), 37 deletions(-)

diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb
index b1230156..dbf07cd5 100644
--- a/lib/jekyll/commands/new.rb
+++ b/lib/jekyll/commands/new.rb
@@ -13,7 +13,6 @@ module Jekyll
 
             c.option "force", "--force", "Force creation even if PATH already exists"
             c.option "blank", "--blank", "Creates scaffolding but with empty files"
-            c.option "skip-bundle", "--skip-bundle", "Skip 'bundle install'"
 
             c.action do |args, options|
               Jekyll::Commands::New.process(args, options)
@@ -126,36 +125,9 @@ RUBY
           "_posts/0000-00-00-welcome-to-jekyll.markdown.erb"
         end
 
-        # After a new blog has been created, print a success notification and
-        # then automatically execute bundle install from within the new blog dir
-        # unless the user opts to generate a blank blog or skip 'bundle install'.
-
+        # After a new blog has been created, print a success notification
         def after_install(path, options = {})
-          unless options["blank"] || options["skip-bundle"]
-            begin
-              require "bundler"
-              bundle_install path
-            rescue LoadError
-              Jekyll.logger.info "Could not load Bundler. Bundle install skipped."
-            end
-          end
-
           Jekyll.logger.info "New jekyll site installed in #{path.cyan}."
-          Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"]
-        end
-
-        def bundle_install(path)
-          Jekyll.logger.info "Running bundle install in #{path.cyan}..."
-          Dir.chdir(path) do
-            exe = Gem.bin_path("bundler", "bundle")
-            process, output = Jekyll::Utils::Exec.run("ruby", exe, "install")
-
-            output.to_s.each_line do |line|
-              Jekyll.logger.info("Bundler:".green, line.strip) unless line.to_s.empty?
-            end
-
-            raise SystemExit unless process.success?
-          end
         end
       end
     end
diff --git a/test/test_new_command.rb b/test/test_new_command.rb
index 632ad3d5..11ffe06f 100644
--- a/test/test_new_command.rb
+++ b/test/test_new_command.rb
@@ -43,9 +43,7 @@ class TestNewCommand < JekyllUnitTest
     should "display a success message" do
       output = capture_output { Jekyll::Commands::New.process(@args) }
       success_message = "New jekyll site installed in #{@full_path.cyan}. "
-      bundle_message = "Running bundle install in #{@full_path.cyan}... "
       assert_includes output, success_message
-      assert_includes output, bundle_message
     end
 
     should "copy the static files in site template to the new directory" do
@@ -98,12 +96,6 @@ class TestNewCommand < JekyllUnitTest
       output = capture_output { Jekyll::Commands::New.process(@args, "--force") }
       assert_match %r!New jekyll site installed in!, output
     end
-
-    should "skip bundle install when opted to" do
-      output = capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") }
-      bundle_message = "Bundle install skipped."
-      assert_includes output, bundle_message
-    end
   end
 
   context "when multiple args are given" do
-- 
2.19.1