diff --git a/NEWS.md b/NEWS.md index 264854c0..61acc707 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Unreleased * Require `--skip-rubocop` in favor of our [linting configuration][] * Fixed: [Specify a tag when installing capybara_accessible_selectors](https://github.com/thoughtbot/suspenders/issues/1228) +* Fixed: [Issue 1229: How do we want to handle un-released versions?](https://github.com/thoughtbot/suspenders/issues/1229) [linting configuration]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting diff --git a/README.md b/README.md index ddd03a4f..d12a337f 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,22 @@ PostgreSQL][] as our database. We skip [RuboCop rules by default][] in favor of our [holistic linting rules][]. +#### Use the latest suspenders release: + +``` +rails new app_name \ + --skip-rubocop \ + --skip-test \ + -d=postgresql \ + -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb +``` + +#### OR use the current (possibly unreleased) `main` branch of suspenders: + ``` rails new app_name \ - --skip_rubocop \ + --suspenders-main \ + --skip-rubocop \ --skip-test \ -d=postgresql \ -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb @@ -49,7 +62,7 @@ Alternatively, if you're using our [dotfiles][], then you can just run `rails ne app_name`, or create your own [railsrc][] file with the following configuration: ``` ---skip_rubocop +--skip-rubocop --skip-test --database=postgresql -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb diff --git a/lib/generators/suspenders/install/web_generator.rb b/lib/generators/suspenders/install/web_generator.rb index add19170..cb31be33 100644 --- a/lib/generators/suspenders/install/web_generator.rb +++ b/lib/generators/suspenders/install/web_generator.rb @@ -13,11 +13,24 @@ class WebGenerator < Rails::Generators::Base This generatator is intended to be invoked as part of an [application template][]. + #### Use the latest suspenders release: + + ``` + rails new \\ + --skip-rubocop \\ + --skip-test \\ + -d=postgresql \\ + -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb + ``` + + #### OR use the current (possibly unreleased) `main` branch of suspenders: + ``` - rails new \ + rails new app_name \\ + --suspenders-main \\ --skip-rubocop \\ - --skip-test \ - -d=postgresql \ + --skip-test \\ + -d=postgresql \\ -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb ``` diff --git a/lib/install/web.rb b/lib/install/web.rb index e1639958..b071c4d7 100644 --- a/lib/install/web.rb +++ b/lib/install/web.rb @@ -25,7 +25,11 @@ def apply_template! if options[:database] == "postgresql" && options[:skip_test] && options[:skip_rubocop] after_bundle do gem_group :development, :test do - gem "suspenders" + if ARGV.include?("--suspenders-main") + gem "suspenders", github: "thoughtbot/suspenders", branch: "main" + else + gem "suspenders" + end end run "bundle install" @@ -41,11 +45,21 @@ def apply_template! === Please use the correct options === + # Use the latest suspenders release: rails new \\ --skip-rubocop \\ --skip-test \\ -d=postgresql \\ -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb + + # OR use the current (possibly unreleased) `main` branch of suspenders: + rails new \\ + --suspenders-main \\ + --skip-rubocop \\ + --skip-test \\ + -d=postgresql \\ + -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb + ERROR fail Rails::Generators::Error, message