Sha256: 25a9a2e4326b727d81627c93586bbd7abd4d5bb523722b2fe468e50c6230dd77

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

module RubySkynet #:nodoc:
  class Railtie < Rails::Railtie #:nodoc:

    # Exposes RubySkynet configuration to the Rails application configuration.
    #
    # @example Set up configuration in the Rails app.
    #   module MyApplication
    #     class Application < Rails::Application
    #       config.ruby_skynet.region = "Development"
    #     end
    #   end
    config.ruby_skynet = ::RubySkynet

    rake_tasks do
      load "ruby_skynet/railties/ruby_skynet.rake"
    end

    # Load RubySkynet Configuration once rails has started
    initializer 'ruby_skynet.initialize' do
      unless ::RubySkynet.configured?
        config_file = Rails.root.join("config", "ruby_skynet.yml")
        if config_file.file?
          ::RubySkynet.configure!(config_file, Rails.env)
        else
          puts "\nRuby Skynet config not found."
          puts "To generate one for the first time: rails generate ruby_skynet:config\n\n"
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_skynet-2.0.0 lib/ruby_skynet/railtie.rb