diff --git a/Rakefile b/Rakefile index 333bdd4e45..1c8b73abaf 100644 --- a/Rakefile +++ b/Rakefile @@ -27,7 +27,7 @@ namespace :generate do # Rails 4 cannot use a `rails` binstub generated by Bundler sh "rm -f #{bindir}/rails" - sh "bundle exec rails new ./tmp/example_app --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=templates/generate_app.rb" + sh "bundle exec rails new ./tmp/example_app --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=example_app_generator/generate_app.rb" if test 'd', bindir in_example_app do @@ -51,7 +51,7 @@ namespace :generate do desc "generate a bunch of stuff with generators" task :stuff do - in_example_app "bin/rake rails:template LOCATION='../../templates/generate_stuff.rb'" + in_example_app "bin/rake rails:template LOCATION='../../example_app_generator/generate_stuff.rb'" end end @@ -83,7 +83,7 @@ end desc "run a variety of specs against the generated app" task :smoke do - in_example_app "LOCATION='../../templates/run_specs.rb' bin/rake rails:template --backtrace" + in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rake rails:template --backtrace" end namespace :smoke do @@ -124,7 +124,7 @@ namespace :no_active_record do desc "run a vairety of specs against a non-ActiveRecord generated app" task :smoke do - in_example_app "LOCATION='../../templates/run_specs.rb' bin/rake rails:template --backtrace", + in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rake rails:template --backtrace", :app_dir => example_app_dir end @@ -151,7 +151,7 @@ namespace :no_active_record do # Rails 4 cannot use a `rails` binstub generated by Bundler sh "rm -f #{bindir}/rails" - sh "bundle exec rails new #{example_app_dir} --skip-active-record --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=templates/generate_app.rb" + sh "bundle exec rails new #{example_app_dir} --skip-active-record --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=example_app_generator/generate_app.rb" if test 'd', bindir in_example_app(:app_dir => example_app_dir) do @@ -175,7 +175,7 @@ namespace :no_active_record do desc "generate a bunch of stuff with generators" task :stuff do - in_example_app "bin/rake rails:template LOCATION='../../templates/generate_stuff.rb'", + in_example_app "bin/rake rails:template LOCATION='../../example_app_generator/generate_stuff.rb'", :app_dir => example_app_dir end end diff --git a/templates/generate_app.rb b/example_app_generator/generate_app.rb similarity index 91% rename from templates/generate_app.rb rename to example_app_generator/generate_app.rb index 161856d2f7..07f4c0b0dc 100644 --- a/templates/generate_app.rb +++ b/example_app_generator/generate_app.rb @@ -3,7 +3,11 @@ rails_dependencies_gemfile = File.join(rspec_rails_repo_path, 'Gemfile-rails-dependencies') bundle_install_path = File.join(rspec_rails_repo_path, '..', 'bundle') maintenance_branch_file = File.join(rspec_rails_repo_path, 'maintenance-branch') -travis_retry_script = File.join(rspec_rails_repo_path, 'templates', 'travis_retry_bundle_install.sh') +travis_retry_script = File.join( + rspec_rails_repo_path, + 'example_app_generator', + 'travis_retry_bundle_install.sh' +) function_script_file = File.join(rspec_rails_repo_path, 'script/functions.sh') in_root do diff --git a/templates/generate_stuff.rb b/example_app_generator/generate_stuff.rb similarity index 100% rename from templates/generate_stuff.rb rename to example_app_generator/generate_stuff.rb diff --git a/templates/no_active_record/app/models/in_memory/model.rb b/example_app_generator/no_active_record/app/models/in_memory/model.rb similarity index 100% rename from templates/no_active_record/app/models/in_memory/model.rb rename to example_app_generator/no_active_record/app/models/in_memory/model.rb diff --git a/templates/no_active_record/lib/rails/generators/in_memory/model/model_generator.rb b/example_app_generator/no_active_record/lib/rails/generators/in_memory/model/model_generator.rb similarity index 100% rename from templates/no_active_record/lib/rails/generators/in_memory/model/model_generator.rb rename to example_app_generator/no_active_record/lib/rails/generators/in_memory/model/model_generator.rb diff --git a/templates/no_active_record/lib/rails/generators/in_memory/model/templates/model.rb.erb b/example_app_generator/no_active_record/lib/rails/generators/in_memory/model/templates/model.rb.erb similarity index 100% rename from templates/no_active_record/lib/rails/generators/in_memory/model/templates/model.rb.erb rename to example_app_generator/no_active_record/lib/rails/generators/in_memory/model/templates/model.rb.erb diff --git a/templates/no_active_record/spec/verify_no_active_record_spec.rb b/example_app_generator/no_active_record/spec/verify_no_active_record_spec.rb similarity index 100% rename from templates/no_active_record/spec/verify_no_active_record_spec.rb rename to example_app_generator/no_active_record/spec/verify_no_active_record_spec.rb diff --git a/templates/run_specs.rb b/example_app_generator/run_specs.rb similarity index 100% rename from templates/run_specs.rb rename to example_app_generator/run_specs.rb diff --git a/templates/spec/verify_active_record_spec.rb b/example_app_generator/spec/verify_active_record_spec.rb similarity index 100% rename from templates/spec/verify_active_record_spec.rb rename to example_app_generator/spec/verify_active_record_spec.rb diff --git a/templates/travis_retry_bundle_install.sh b/example_app_generator/travis_retry_bundle_install.sh similarity index 100% rename from templates/travis_retry_bundle_install.sh rename to example_app_generator/travis_retry_bundle_install.sh