-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests with
rails generate super_scaffold
and add deprecation…
… warning (#1203) * Use Rails generators for Super Scaffolding in test setup * Add deprecation warning for bin/super-scaffold * Add deprecation warning for bin/super-scaffold * Run rails g super_scaffold inside bin/super-scaffold * Remove crud argument when unneeded * Run bin/super-scaffold with spring
- Loading branch information
Showing
2 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
#!/usr/bin/env ruby | ||
require "active_support/deprecation" | ||
|
||
# We redirect this script to a rake task because I don't know a better way to boot the Rails environment for this script. | ||
exec "#{"spring" if ENV["SPRING"]} rake \"bullet_train:super_scaffolding[#{ARGV.join(" ").gsub(",", "\\,")}]\"" | ||
ActiveSupport::Deprecation.new.warn( | ||
"`bin/super-scaffold` is deprecated. Please use `rails generate super_scaffold` instead.\n" \ | ||
"You can see which options are available in the Super Scaffolding documentation: https://bullettrain.co/docs/super-scaffolding" | ||
) | ||
|
||
scaffolding_type = case ARGV.first | ||
when "crud" | ||
ARGV.shift | ||
nil | ||
when "crud-field" | ||
"field" | ||
when "incoming-webhooks" | ||
"incoming_webhooks" | ||
when "join-model" | ||
"join_model" | ||
when "oauth-provider" | ||
"oauth_provider" | ||
else | ||
nil | ||
end | ||
|
||
if scaffolding_type | ||
exec "#{"spring" if ENV["SPRING"]} rails generate super_scaffold:#{scaffolding_type} #{ARGV.join(" ")}" | ||
else | ||
exec "#{"spring" if ENV["SPRING"]} rails generate super_scaffold #{ARGV.join(" ")}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters