Module: Adalog

Defined in:
lib/adalog.rb,
lib/adalog/web.rb,
lib/adalog/entry.rb,
lib/adalog/version.rb,
lib/adalog/pstore_repo.rb,
lib/adalog/configuration.rb,
lib/adalog/in_memory_repo.rb,
lib/adalog/active_record_repo.rb,
lib/adalog/mock_logging_adapter.rb,
lib/adalog/stub_logging_adapter.rb,
lib/adalog/simple_logging_adapter.rb

Defined Under Namespace

Modules: MockLoggingAdapter, RepoConvenienceMethods, SimpleLoggingAdapter, StubLoggingAdapter Classes: ActiveRecordRepo, Configuration, Entry, InMemoryRepo, PStoreRepo, Web

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.configurationObject



7
8
9
# File 'lib/adalog.rb', line 7

def self.configuration
  @configuration || ((configure! { :defaults }) && @configuration)
end

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

Yields:

  • (config)


12
13
14
15
16
17
18
19
20
# File 'lib/adalog.rb', line 12

def self.configure
  config = Adalog::Configuration.new
  yield(config)
  config.validate!
  config.freeze
  @configuration = config
  post_configuration(@configuration)
  :ok
end

.post_configuration(config) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/adalog.rb', line 23

def self.post_configuration(config)
  if config.singleton
    self.extend(RepoConvenienceMethods)
  end
  if config.html_erb
    Tilt.register(Tilt::ERBTemplate, 'html.erb')
  end
end