Sha256: f22c505dcea206e9baff3032caccdb8c0972faea9d788e622c6682db425eb06f

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

%w(configuration_defaults installer).each do |lib|
  require "compass/app_integration/rails/#{lib}"
end

require 'compass/app_integration/rails/runtime' if defined?(ActionController::Base)


module Compass
  module AppIntegration
    module Rails

      extend self

      def installer(*args)
        Installer.new(*args)
      end

      def configuration
        Compass::Configuration::Data.new('rails').
          extend(ConfigurationDefaults)
      end

      def env
        if rails_env = (defined?(::Rails) ? ::Rails.env : (defined?(RAILS_ENV) ? RAILS_ENV : nil))
          rails_env.production? ? :production : :development
        end
      end

      def root
        if defined?(::Rails)
          ::Rails.root
        elsif defined?(RAILS_ROOT)
          RAILS_ROOT
        end
      end

      def initialize!
        config_file = Compass.detect_configuration_file(root)
        Compass.add_project_configuration(config_file)
        Compass.discover_extensions!
        Compass.configure_sass_plugin!
        Compass.handle_configuration_change!
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
compass-0.11.alpha.4 lib/compass/app_integration/rails.rb
compass-0.11.alpha.3 lib/compass/app_integration/rails.rb
compass-0.11.alpha.1 lib/compass/app_integration/rails.rb
compass-0.11.alpha.0 lib/compass/app_integration/rails.rb
compass-0.10.6 lib/compass/app_integration/rails.rb
compass-0.10.6.pre.1 lib/compass/app_integration/rails.rb
compass-0.10.5 lib/compass/app_integration/rails.rb
compass-0.10.5.pre.1 lib/compass/app_integration/rails.rb
compass-0.10.4 lib/compass/app_integration/rails.rb
compass-0.10.4.pre.4 lib/compass/app_integration/rails.rb
compass-0.10.4.pre.3 lib/compass/app_integration/rails.rb