Module: SearchCraft

Extended by:
SearchCraft
Included in:
SearchCraft
Defined in:
lib/searchcraft.rb,
lib/searchcraft/railtie.rb,
lib/searchcraft/version.rb,
lib/searchcraft/configuration.rb

Defined Under Namespace

Modules: Annotate, DependsOn, DumpSchema, Model, TextSearch Classes: Builder, Configuration, Error, Railtie, ViewHashStore

Constant Summary collapse

VERSION =
"0.5.2"

Instance Method Summary collapse

Instance Method Details

#configObject



12
13
14
# File 'lib/searchcraft.rb', line 12

def config
  @config ||= Configuration.new
end

#configure {|config| ... } ⇒ Object

Yields:



8
9
10
# File 'lib/searchcraft.rb', line 8

def configure
  yield(config)
end

#database_ready?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/searchcraft.rb', line 16

def database_ready?
  ActiveRecord::Base.connection.table_exists?("schema_migrations")
rescue
  false
end

#debug?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/searchcraft.rb', line 28

def debug?
  config.debug
end

#dependencies_ready?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/searchcraft.rb', line 22

def dependencies_ready?
  Builder.builders_to_rebuild.all? do |builder_class|
    builder_class.new.dependencies_ready?
  end
end

#load_tasksObject



32
33
34
35
36
37
38
39
40
# File 'lib/searchcraft.rb', line 32

def load_tasks
  return if @tasks_loaded

  Dir[File.join(File.dirname(__FILE__), "tasks", "**/*.rake")].each do |rake|
    load rake
  end

  @tasks_loaded = true
end