require "tempfile" require "net/http" # Add jobshop to the application `Gemfile`. gem "jobshop", "~> 0.0.11" def template_body(uri) uri = URI.parse(uri) Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(Net::HTTP::Get.new(uri)) end.body end # The generated config/secrets.yml file uses hardcoded values for # test/development environments. Generate secrets pragmatically. SECRETS_YML_URI = "https://raw.githubusercontent.com/" + "jobshop/jobshop/" + "master/lib/jobshop/templates/secrets.yml.erb" secrets_tempfile = Tempfile.new(["secrets", ".yml.erb"]) secrets_tempfile.write(template_body(SECRETS_YML_URI)) secrets_tempfile.close remove_file "config/secrets.yml" template secrets_tempfile.path, "config/secrets.yml" secrets_tempfile.unlink after_bundle do route %Q(mount Jobshop::Engine => "/") end