<NME> omniauth.rb
<BEF> Rails.application.config.middleware.use OmniAuth::Builder do
  provider :developer unless Rails.env.production?
  provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: "repo:status,public_repo"
      def name
        "github_limited"
      end
    end
  end
end

if Rails.env.development?
  missing = %w(GITHUB_KEY GITHUB_SECRET GITHUB_LIMITED_KEY GITHUB_LIMITED_SECRET).select do |key|
    ENV[key].blank?
  end
  raise "Provide #{missing.to_sentence}" if missing.any?
end

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :developer unless Rails.env.production?
  provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: "user:email,repo:status,admin:repo_hook,admin:org_hook,read:org"
  provider :github_limited, ENV['GITHUB_LIMITED_KEY'], ENV['GITHUB_LIMITED_SECRET'], scope: "(no scope)"
end

<MSG> Ensure GitHub oauth keys on boot
<DFF> @@ -1,3 +1,5 @@
+raise "Provide ENV['GITHUB_KEY'] and ENV['GITHUB_SECRET']" unless Rails.env.test? || (ENV['GITHUB_KEY'] && ENV['GITHUB_SECRET'])
+
 Rails.application.config.middleware.use OmniAuth::Builder do
   provider :developer unless Rails.env.production?
   provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: "repo:status,public_repo"

Ensure GitHub oauth keys on boot