Module: NoBrainer

Extended by:
Autoload
Defined in:
lib/nobrainer.rb,
lib/no_brainer/document/store.rb,
lib/no_brainer/profiler/logger.rb,
lib/no_brainer/document/types/array.rb,
lib/no_brainer/profiler/slow_queries.rb

Defined Under Namespace

Modules: Autoload, Config, ConnectionManager, Document, Error, Fork, Generators, Geo, Loader, Profiler, QueryRunner, RQL, SymbolDecoration, System Classes: Array, Binary, Boolean, Connection, Criteria, Enum, Lock, Railtie, ReentrantLock, Text, TypedArray

Class Method Summary collapse

Methods included from Autoload

autoload, autoload_and_include, eager_autoload, eager_load!, extended

Class Method Details

.eager_load!Object



52
53
54
55
56
57
58
# File 'lib/nobrainer.rb', line 52

def eager_load!
  # XXX This forces all the NoBrainer code to be loaded in memory.
  # Not to be confused with eager_load() that operates on documents.
  # We assume that NoBrainer is already configured at this point.
  super
  NoBrainer::QueryRunner.stack # load the code for the current stack
end

.jruby?Boolean

Returns:



36
37
38
# File 'lib/nobrainer.rb', line 36

def jruby?
  RUBY_PLATFORM == 'java'
end

.rails4?Boolean

Returns:



40
41
42
# File 'lib/nobrainer.rb', line 40

def rails4?
  Gem.loaded_specs['activesupport'].version >= Gem::Version.new('4.0.0')
end

.rails5?Boolean

Returns:



44
45
46
# File 'lib/nobrainer.rb', line 44

def rails5?
  Gem.loaded_specs['activesupport'].version >= Gem::Version.new('5.0.0.beta')
end

.rails6?Boolean

Returns:



48
49
50
# File 'lib/nobrainer.rb', line 48

def rails6?
  Gem.loaded_specs['activesupport'].version >= Gem::Version.new('6.0.0')
end