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