spec/internal/lib/generators/test_app_generator.rb in blacklight-spotlight-0.0.3 vs spec/internal/lib/generators/test_app_generator.rb in blacklight-spotlight-0.1.0
- old
+ new
@@ -1,12 +1,23 @@
require 'rails/generators'
class TestAppGenerator < Rails::Generators::Base
source_root "../../spec/test_app_templates"
+ def add_gems
+ gem 'blacklight', ">= 5.4.0.rc1", "<6"
+ gem "blacklight-gallery", :github => 'projectblacklight/blacklight-gallery'
+ gem 'sir-trevor-rails', :github => 'sul-dlss/sir-trevor-rails'
+ gem 'openseadragon', :github => 'sul-dlss/openseadragon-rails'
+ gem "jettywrapper"
+ Bundler.with_clean_env do
+ run "bundle install"
+ end
+ end
+
def run_blacklight_generator
- say_status("warning", "GENERATING BL", :yellow)
+ say_status("warning", "GENERATING BL", :yellow)
generate 'blacklight:install', '--devise'
copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb", force: true
end
@@ -19,7 +30,12 @@
generate 'spotlight:install'
end
def add_rake_tasks_to_app
rakefile 'spotlight_test.rake', File.read(find_in_source_paths('spotlight_test.rake'))
+ end
+
+ def add_mailer_defaults
+ mail_config = " config.action_mailer.default_url_options = { host: \"localhost:3000\", from: \"noreply@example.com\" }\n"
+ insert_into_file 'config/application.rb', mail_config, after: "< Rails::Application\n"
end
end