Module: Marti

Defined in:
lib/marti.rb,
lib/marti/engine.rb,
lib/marti/version.rb,
lib/marti/errors/errors.rb,
app/models/marti/marticle.rb,
app/helpers/marti/marti_helper.rb,
lib/marti/services/marticle_parser.rb,
lib/marti/services/marticle_builder.rb,
app/helpers/marti/application_helper.rb,
lib/marti/renderers/html_with_pygments.rb,
app/controllers/marti/marticles_controller.rb,
app/controllers/marti/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, Errors, MartiHelper, Renderers Classes: ApplicationController, Config, Engine, Marticle, MarticleBuilder, MarticleParser, MarticlesController

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/marti.rb', line 5

def config
  @config
end

Class Method Details

.article_directoryObject



13
14
15
16
# File 'lib/marti.rb', line 13

def article_directory
  configured_check!
  config.article_directory || '.'
end

.article_not_found_procObject



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

def article_not_found_proc
  configured_check!
  config.article_not_found_proc || proc { raise ActionController::RoutingError.new('Article not found') }
end

.cache_storeObject



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

def cache_store
  configured_check!
  config.cache_store || ActiveSupport::Cache::NullStore.new
end

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

Yields:



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

def configure
  @config ||= Config.new
  yield(config)
end

.expires_inObject



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

def expires_in
  configured_check!
  config.expires_in || 1.day
end

.layoutObject



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

def layout
  configured_check!
  config.layout || "application"
end