Top Level Namespace

Defined Under Namespace

Modules: Mongoid, Rails Classes: BugTest, Person, Post

Instance Method Summary collapse

Methods included from Mongoid::Extensions::Set::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::Date::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::Hash::ClassMethods

mongoize, resizable?

Methods included from Mongoid::Extensions::Time::ClassMethods

configured, demongoize, mongoize

Methods included from Mongoid::Extensions::Array::ClassMethods

__mongoize_fk__, mongoize, resizable?

Methods included from Mongoid::Extensions::Float::ClassMethods

mongoize

Methods included from Mongoid::Extensions::Range::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::Object::ClassMethods

__mongoize_fk__, demongoize, mongoize

Methods included from Mongoid::Extensions::Regexp::ClassMethods

mongoize

Methods included from Mongoid::Extensions::String::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::Symbol::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::Integer::ClassMethods

mongoize

Methods included from Mongoid::Extensions::DateTime::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::ObjectId::ClassMethods

evolve, mongoize

Methods included from Mongoid::Extensions::Decimal128::ClassMethods

evolve

Methods included from Mongoid::Extensions::BigDecimal::ClassMethods

demongoize, mongoize

Methods included from Mongoid::Extensions::TimeWithZone::ClassMethods

demongoize, mongoize

Instance Method Details

#count_queries(&block) ⇒ Object



12
13
14
15
16
# File 'build/mongoid-master/examples/mongoid_test.rb', line 12

def count_queries(&block)
  query_counter = Mongoid::QueryCounter.new
  query_counter.instrument(&block)
  query_counter.events.size
end

#invalid_version?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
# File 'build/mongoid-master/lib/support/ruby_version.rb', line 12

def invalid_version?
  RUBY_VERSION =~ /([\d]+)\.([\d]+)\.([\d]+)/
  major, minor, revision = $1.to_i, $2.to_i, $3.to_i
  if defined?(JRUBY_VERSION)
    major <= 1 && minor <= 9 && revision <= 1
  else
    major <= 1 && minor <= 9 && revision <= 2
  end
end

#raise_version_error(message) ⇒ Object

Go ahead and fail if not using Ruby 1.9.3, no since in letting people squarm for answers



6
7
8
9
10
# File 'build/mongoid-master/lib/support/ruby_version.rb', line 6

def raise_version_error(message)
  puts message
  Rails.logger.info(message) if defined?(Rails) && Rails.logger
  raise
end

#standard_dependenciesObject



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'build/mongoid-master/gemfiles/standard.rb', line 1

def standard_dependencies
  gem 'rake'

  group :development do
    gem 'yard'
  end

  group :development, :test do
    gem 'rspec-core', '~> 3.7'

    platform :mri do
      gem 'byebug'
    end

    platform :jruby do
      gem 'ruby-debug'
    end
  end

  group :test do
    gem 'timecop'
    gem 'rspec-retry'
    gem 'benchmark-ips'
    gem 'rspec-expectations', '~> 3.7', '>= 3.8.4'
    gem 'rspec-mocks-diag', '~> 3.0'
    gem 'fuubar'
    gem 'rfc'
    gem 'childprocess'

    platform :mri do
      gem 'timeout-interrupt'
    end
  end
end