Sha256: 23ef82a66056f2d477b53ffd694b537a85b3af830db21f29beeeaf8c869b17c5

Contents?: true

Size: 467 Bytes

Versions: 2

Compression:

Stored size: 467 Bytes

Contents

module DisqusApi
  class Railtie < Rails::Railtie
    initializer 'disqus_api.initialize' do
      config_path = Rails.root.join('config', 'disqus_api.yml')

      if config_path.exist?
        DisqusApi.config = YAML.load(ERB.new(config_path.read).result)[Rails.env]
      else
        unless Rails.env.test?
          puts "WARNING: No config/disqus_api.yml provided for Disqus API. Make sure to set configuration manually."
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
disqus_api-0.0.8 lib/disqus_api/railtie.rb
disqus_api-0.0.7 lib/disqus_api/railtie.rb