Sha256: 4202c8e592652360850e3abfb2a5a763181297f229f94a304b675bb4846f6760

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

module Milkshake
  module RailsExtentions
    module Configuration
      
      def self.included(base)
        %w( default_gems default_i18n default_load_paths ).each do |m|
          base.send :alias_method, "#{m}_without_milkshake", m
          base.send :alias_method, m, "#{m}_with_milkshake"
        end
      end
      
      # inject gem dependecies
      def default_gems_with_milkshake
        default_gems = default_gems_without_milkshake
        default_gems.concat(Milkshake.environment.gem_dependencies)
        default_gems
      end
      
      # inject locales from gem dependecies
      def default_i18n_with_milkshake
        default_i18n = default_i18n_without_milkshake
        default_i18n.load_path.concat(Milkshake.environment.locale_paths)
        default_i18n.load_path.uniq!
        default_i18n
      end
      
      # inject fallback application controller
      def default_load_paths_with_milkshake
        path = File.expand_path(File.join(File.dirname(__FILE__), *%w( .. rails_fallbacks )))
        default_load_paths_without_milkshake.push(path)
      end
      
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
milkshake-0.1.6 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.1.5 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.1.4 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.1.3 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.1.2 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.1.1 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.0.2 lib/milkshake/rails_extentions/configuration.rb
milkshake-0.0.1 lib/milkshake/rails_extentions/configuration.rb