Sha256: ee0d5fcce63addeb1ce22d2ba90a1c279c0ae5832f1ba54a165817908725cdf3

Contents?: true

Size: 998 Bytes

Versions: 50

Compression:

Stored size: 998 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

        if pry_rails_before_0_1_6?
          warn "ActiveAdmin is not compatible with pry-rails < 0.1.6. Please upgrade pry-rails."
        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

      def pry_rails_before_0_1_6?
        begin
          PryRails::VERSION < "0.1.6"
        rescue NameError
          false
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/lib/active_admin/dependency_checker.rb