Sha256: 994fe682677a09dd2b72ee3c0240daca002be2033e048dc4adc5932a1a7de39f
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
require 'npmdc/core/string_strip_heredoc' module Npmdc class Railtie < Rails::Railtie # :nodoc: using StringStripHeredoc # Make config accessible through application config config.npmdc = Npmdc.config initializer "npmdc.initialize" do Npmdc.config.path = Rails.root unless Npmdc.config.path? end initializer "npmdc.environment_check" do next unless defined?(Rails::Server) unless config.npmdc.environments.include?(Rails.env) abort <<-END.strip_heredoc Npmdc is trying to be activated in the #{Rails.env} environment. Probably, this is a mistake. To ensure it's only activated in development mode, move it to the development group of your Gemfile: gem 'npmdc', group: :development If you still want to run it in the #{Rails.env} environment (and know what you are doing), put this in your Rails application configuration: config.npmdc.environments = ['development', '#{Rails.env}'] END end end initializer "npmdc.call" do Npmdc.call if defined?(Rails::Server) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
npmdc-0.5.1 | lib/npmdc/railtie.rb |