Class: Rails::Generators::DevcontainerGenerator
- Defined in:
- lib/rails/generators/rails/devcontainer/devcontainer_generator.rb
Overview
:nodoc:
Instance Method Summary collapse
- #create_devcontainer ⇒ Object
- #update_application_system_test_case ⇒ Object
- #update_database_yml ⇒ Object
Methods inherited from Base
base_root, class_option, default_source_root, desc, exit_on_failure?, hide!, hook_for, inherited, namespace, remove_hook_for, source_root
Methods included from Actions
#add_source, #environment, #gem, #gem_group, #generate, #git, #github, #initialize, #initializer, #lib, #rails_command, #rake, #rakefile, #readme, #route, #vendor
Instance Method Details
#create_devcontainer ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/rails/generators/rails/devcontainer/devcontainer_generator.rb', line 31 def create_devcontainer empty_directory ".devcontainer" template "devcontainer/devcontainer.json", ".devcontainer/devcontainer.json" template "devcontainer/Dockerfile", ".devcontainer/Dockerfile" template "devcontainer/compose.yaml", ".devcontainer/compose.yaml" end |
#update_application_system_test_case ⇒ Object
39 40 41 42 43 44 |
# File 'lib/rails/generators/rails/devcontainer/devcontainer_generator.rb', line 39 def update_application_system_test_case return unless [:system_test] return unless File.exist?("test/application_system_test_case.rb") gsub_file("test/application_system_test_case.rb", /^\s*driven_by\b.*/, system_test_configuration) end |
#update_database_yml ⇒ Object
46 47 48 49 50 51 |
# File 'lib/rails/generators/rails/devcontainer/devcontainer_generator.rb', line 46 def update_database_yml # Only postgresql has devcontainer specific configuration, so only update database.yml if we are using postgres return unless [:database] == "postgresql" template("config/databases/#{[:database]}.yml", "config/database.yml") end |