Skip to content

Commit e36f736

Browse files
Allow running against suspenders main
Co-authored-by: Steve Polito <[email protected]>
1 parent 1f13e7b commit e36f736

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Unreleased
22

33
* Require `--skip-rubocop` in favor of our [linting configuration][]
44
* Fixed: [Specify a tag when installing capybara_accessible_selectors](https://github.com/thoughtbot/suspenders/issues/1228)
5+
* Fixed: [Issue 1229: How do we want to handle un-released versions?](https://github.com/thoughtbot/suspenders/issues/1229)
56

67
[linting configuration]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting
78

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,21 @@ PostgreSQL][] as our database.
3535

3636
We skip [RuboCop rules by default][] in favor of our [holistic linting rules][].
3737

38+
#### Use the latest suspenders release:
39+
40+
```
41+
rails new app_name \
42+
--skip_rubocop \
43+
--skip-test \
44+
-d=postgresql \
45+
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
46+
```
47+
48+
#### OR use the current (possibly unreleased) `main` branch of suspenders:
49+
3850
```
3951
rails new app_name \
52+
--suspenders_main \
4053
--skip_rubocop \
4154
--skip-test \
4255
-d=postgresql \

lib/install/web.rb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ def apply_template!
2424
end
2525
if options[:database] == "postgresql" && options[:skip_test] && options[:skip_rubocop]
2626
after_bundle do
27-
gem_group :development, :test do
28-
gem "suspenders"
27+
if ARGV.include?("--suspenders_main")
28+
gem_group :development, :test do
29+
gem "suspenders", github: "thoughtbot/suspenders", branch: "main"
30+
end
31+
else
32+
gem_group :development, :test do
33+
gem "suspenders"
34+
end
2935
end
3036

3137
run "bundle install"
@@ -41,12 +47,22 @@ def apply_template!
4147
4248
=== Please use the correct options ===
4349
50+
# Use the latest suspenders release:
4451
rails new <app_name> \\
4552
--skip-rubocop \\
4653
--skip-test \\
4754
-d=postgresql \\
4855
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
49-
ERROR
56+
57+
# OR use the current (possibly unreleased) `main` branch of suspenders:
58+
rails new <app_name> \\
59+
--suspenders_main \\
60+
--skip-rubocop \\
61+
--skip-test \\
62+
-d=postgresql \\
63+
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
64+
65+
ERROR
5066

5167
fail Rails::Generators::Error, message
5268
end

0 commit comments

Comments
 (0)