Sha256: 71cbcf05851912e4251fd1690575bea7817dd14f3a0ceb0bb0899e3be552f46b

Contents?: true

Size: 701 Bytes

Versions: 10

Compression:

Stored size: 701 Bytes

Contents

require 'rails/version'

module ActiveAdmin
  module DependencyChecker
    class << self
      def check!
        if rails_3_1?
          unless meta_search_1_1? && sass_rails_3_1?
            warn "ActiveAdmin requires meta_search >= 1.1.0.pre and sass-rails ~> 3.1.0.rc to work with rails >= 3.1.0"
          end
        end
      end

      def rails_3_1?
        Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 1
      end

      def meta_search_1_1?
        Gem.loaded_specs['meta_search'].version.to_s >= "1.1"
      end

      def sass_rails_3_1?
        require 'sass/rails/version'
        Sass::Rails::VERSION >= "3.1"
      rescue LoadError
        false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
activeadmin-0.4.1 lib/active_admin/dependency_checker.rb
activeadmin-0.4.0 lib/active_admin/dependency_checker.rb
andrewroth_activeadmin-0.3.4.4 lib/active_admin/dependency_checker.rb
andrewroth_activeadmin-0.3.4.3 lib/active_admin/dependency_checker.rb
andrewroth_activeadmin-0.3.4.2 lib/active_admin/dependency_checker.rb
andrewroth_activeadmin-0.3.4.1 lib/active_admin/dependency_checker.rb
andrewroth_activeadmin-0.3.4 lib/active_admin/dependency_checker.rb
activeadmin-0.3.4 lib/active_admin/dependency_checker.rb
activeadmin-0.3.3 lib/active_admin/dependency_checker.rb
activeadmin-0.3.2 lib/active_admin/dependency_checker.rb