Module: Commento

Extended by:
Commento, Forwardable
Included in:
Commento
Defined in:
lib/commento.rb,
lib/commento/dsl.rb,
lib/commento/report.rb,
lib/commento/helpers.rb,
lib/commento/railtie.rb,
lib/commento/version.rb,
lib/commento/reports/html.rb,
lib/commento/configuration.rb,
lib/commento/scrapers/ruby.rb,
lib/commento/adapters/active_record.rb,
lib/generators/commento/active_record_generator.rb

Defined Under Namespace

Modules: Adapters, Generators, Helpers, Reports, Scrapers Classes: Configuration, DSL, Railtie, Report

Constant Summary collapse

VERSION =
'0.2.0'

Instance Method Summary collapse

Instance Method Details

#configurationObject

Public: Returns Commento::Configuration instance.



34
35
36
# File 'lib/commento.rb', line 34

def configuration
  @configuration ||= Configuration.new
end

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

Public: Configure commento.

Commento.configure do |config|
  config.adapter = Commento::Adapters::ActiveRecord.new
end

Yields:



29
30
31
# File 'lib/commento.rb', line 29

def configure
  yield configuration
end

#instanceObject

Public: Default per thread commento instance if configured. Returns Commento::DSL instance.



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

def instance
  Thread.current[:commento_instance] ||= new(configuration.adapter)
end

#new(adapter) ⇒ Object

Public: Given an adapter returns a handy DSL to all the commento goodness.



19
20
21
# File 'lib/commento.rb', line 19

def new(adapter)
  DSL.new(adapter)
end