Sha256: ad3294acb585befc7950e3e3c01d116c2c10164957ffda72bff84c64a3ff3104

Contents?: true

Size: 1.39 KB

Versions: 20

Compression:

Stored size: 1.39 KB

Contents

module Riveter
  module Rails
    class Railtie < ::Rails::Railtie
      initializer 'riveter.initialize' do
        require 'riveter/form_builder_extensions'
        require 'riveter/command_routes'
        require 'riveter/enquiry_routes'
      end

      initializer 'riveter.set_autoload_paths', :before => :set_autoload_paths do |app|
        config = app.config

        # add paths to auto load path
        %w{
          commands
          enquiries
          enums
          presenters
          queries
          query_filters
          services
        }.each do |path|
          config.autoload_paths += %W(#{config.root}/app/#{path})
          config.autoload_paths += %W(#{config.root}/app/#{path}/concerns)
        end
      end

      initializer "riveter.load_services" do |app|
        ActiveSupport.on_load :after_initialize do |app|
          #
          # services need to be loaded manually since they aren't referenced
          # directly and therefore cannot be autoloaded
          #
          # also, when the class is loaded, it registers itself as the service for a command
          #
          Dir[File.join(app.config.root, 'app', 'services', '**/*_service.rb')].each {|file| require file }
        end
      end

      console do
        # TODO
      end

      rake_tasks do
        Dir[File.join(File.dirname(__FILE__), 'tasks/*.rake')].each { |file|  load file }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
riveter-0.8.3 lib/riveter/rails/railtie.rb
riveter-0.8.2 lib/riveter/rails/railtie.rb
riveter-0.8.1 lib/riveter/rails/railtie.rb
riveter-0.8.0 lib/riveter/rails/railtie.rb
riveter-0.7.0 lib/riveter/rails/railtie.rb
riveter-0.6.0 lib/riveter/rails/railtie.rb
riveter-0.3.0 lib/riveter/rails/railtie.rb
riveter-0.2.1 lib/riveter/rails/railtie.rb
riveter-0.2.0 lib/riveter/rails/railtie.rb
riveter-0.1.1 lib/riveter/rails/railtie.rb
riveter-0.0.15 lib/riveter/rails/railtie.rb
riveter-0.0.14 lib/riveter/rails/railtie.rb
riveter-0.0.13 lib/riveter/rails/railtie.rb
riveter-0.0.12 lib/riveter/rails/railtie.rb
riveter-0.0.11 lib/riveter/rails/railtie.rb
riveter-0.0.10 lib/riveter/rails/railtie.rb
riveter-0.0.9 lib/riveter/rails/railtie.rb
riveter-0.0.8 lib/riveter/rails/railtie.rb
riveter-0.0.7 lib/riveter/rails/railtie.rb
riveter-0.0.6 lib/riveter/rails/railtie.rb