We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30c2d9f commit 364e2c9Copy full SHA for 364e2c9
lib/install/web.rb
@@ -1,3 +1,30 @@
1
+def enforce_options!
2
+ if incorrect_database? && default_test_suite?
3
+ message = <<~ERROR
4
+
5
6
+ === Please use use the correct options ===
7
8
+ rails new <app_name> \
9
+ --skip-test \
10
+ -d=postgresql \
11
+ -m=https://raw.githubusercontent.com/thoughtbot/suspenders/suspenders-3-0-0-web-generator/lib/install/web.rb
12
+ ERROR
13
14
+ fail Rails::Generators::Error, message
15
+ end
16
+end
17
18
+def incorrect_database?
19
+ options[:database] != "postgresql"
20
21
22
+def default_test_suite?
23
+ !options[:skip_test]
24
25
26
+enforce_options!
27
28
after_bundle do
29
gem_group :development, :test do
30
gem "suspenders", github: "thoughtbot/suspenders", branch: "suspenders-3-0-0-web-generator"
0 commit comments