Skip to content

Commit

Permalink
Legacy option from the days of Bundler opposition (#42996)
Browse files Browse the repository at this point in the history
Don't have to keep all the monuments to old skirmishes around forever.
  • Loading branch information
dhh committed Aug 11, 2021
1 parent e34300a commit d9eeedf
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 23 deletions.
5 changes: 1 addition & 4 deletions railties/lib/rails/generators/app_base.rb
Expand Up @@ -30,9 +30,6 @@ def self.add_shared_options_for(name)
class_option :database, type: :string, aliases: "-d", default: "sqlite3",
desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"

class_option :skip_gemfile, type: :boolean, default: false,
desc: "Don't create a Gemfile"

class_option :skip_git, type: :boolean, aliases: "-G", default: false,
desc: "Skip .gitignore file"

Expand Down Expand Up @@ -399,7 +396,7 @@ def exec_bundle_command(bundle_command, command, env)
end

def bundle_install?
!(options[:skip_gemfile] || options[:skip_bundle] || options[:pretend])
!(options[:skip_bundle] || options[:pretend])
end

def spring_install?
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -356,7 +356,7 @@ def create_root_files
build(:gitattributes)
end

build(:gemfile) unless options[:skip_gemfile]
build(:gemfile)
build(:version_control)
build(:package_json) unless options[:skip_javascript]
end
Expand Down
Expand Up @@ -247,7 +247,7 @@ def create_root_files
build(:gemspec) unless options[:skip_gemspec]
build(:license)
build(:gitignore) unless options[:skip_git]
build(:gemfile) unless options[:skip_gemfile]
build(:gemfile)
build(:version_control)
end

Expand Down
9 changes: 0 additions & 9 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -116,15 +116,6 @@ def test_skip_bundle
assert_webpack_installation_skipped(output)
end

def test_skip_gemfile
generator([destination_root], skip_gemfile: true)
output = run_generator_instance

assert_empty @bundle_commands
assert_no_file "Gemfile"
assert_webpack_installation_skipped(output)
end

def test_assets
run_generator

Expand Down
8 changes: 0 additions & 8 deletions railties/test/generators/shared_generator_tests.rb
Expand Up @@ -95,14 +95,6 @@ def test_template_is_executed_when_supplied_an_https_path
assert_equal url, applied
end

def test_skip_gemfile
generator([destination_root], skip_gemfile: true, skip_webpack_install: true)
run_generator_instance

assert_empty @bundle_commands
assert_no_file "Gemfile"
end

def test_skip_git
run_generator [destination_root, "--skip-git", "--full"]
assert_no_file(".gitignore")
Expand Down

0 comments on commit d9eeedf

Please sign in to comment.