Sha256: 97391e421dd837f952a9d31fce77ba7b4f35f19c8e563557e9a4433d58d44ad7
Contents?: true
Size: 1.55 KB
Versions: 5
Compression:
Stored size: 1.55 KB
Contents
def source_paths [ File.expand_path(File.dirname(__FILE__)) ] end # The generated config/boot.rb file references a Gemfile in the dummy app # directory so use one that references the parent app. remove_file "config/boot.rb" copy_file "boot.rb.tt", "config/boot.rb" # The generated config/secrets.yml file uses hardcoded values for # test/development environments. Generate secrets pragmatically. remove_file "config/secrets.yml" template "secrets.yml.erb", "config/secrets.yml" # Comment out username, password from production group. gsub_file "config/database.yml", /^([ ]*[^#])(username: .*|password: .*)$/, '\1# \2' # The db/migrate folder never gets created for the dummy_app so do it manually. unless Dir.exist?("db/migrate") say_status :create, "db/migrate" Dir.mkdir("db/migrate") end # Mailer previews don't really play nice with Engines so in the dummy app we # create an initializer to expose them properly. initializer "jobshop_expose_mailer_previews.rb", <<-INITIALIZER.strip_heredoc if Rails.env.development? || Rails.env.test? Rails.application.configure do config.action_mailer.preview_path = "\#{Jobshop::Engine.root}/spec/mailers" end end INITIALIZER # This allows us to easily use the localhost hostname in development. initializer "jobshop_tld_length.rb", <<-INITIALIZER.strip_heredoc if Rails.env.development? || Rails.env.test? Rails.application.configure do config.action_dispatch.tld_length = 0 end end INITIALIZER route "mount Jobshop::Engine => \"/\"" rake "db:drop:all" rake "db:create" rake "db:migrate"
Version data entries
5 entries across 5 versions & 1 rubygems