Module: Marfa

Defined in:
lib/marfa.rb,
lib/marfa/cache.rb,
lib/marfa/version.rb,
lib/marfa/exceptions.rb,
lib/marfa/controllers.rb,
lib/marfa/css_version.rb,
lib/marfa/helpers/scss.rb,
lib/marfa/configuration.rb,
lib/marfa/helpers/email.rb,
lib/marfa/helpers/style.rb,
lib/marfa/file_templates.rb,
lib/marfa/models/base_dto.rb,
lib/marfa/models/db_model.rb,
lib/marfa/models/api_model.rb,
lib/marfa/blocks/base_block.rb,
lib/marfa/helpers/http/rest.rb,
lib/marfa/helpers/http/vary.rb,
lib/marfa/helpers/controller.rb,
lib/marfa/controllers/css_controller.rb,
lib/marfa/controllers/base_controller.rb

Overview

Extending Marfa

Defined Under Namespace

Modules: Blocks, Controllers, Exceptions, FileTemplates, Helpers, Models Classes: Cache

Constant Summary collapse

VERSION =

The version constant for the current version of Marfa

'0.10.2'.freeze

Class Method Summary collapse

Class Method Details

.cacheObject



84
85
86
# File 'lib/marfa/cache.rb', line 84

def self.cache
  @cache ||= Marfa::Cache.new
end

.configObject

Configuration



10
11
12
# File 'lib/marfa/configuration.rb', line 10

def self.config
  @config ||= OpenStruct.new
end

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

Configure Marfa in block

Yields:



25
26
27
28
# File 'lib/marfa/configuration.rb', line 25

def self.configure
  config if @config.nil?
  yield @config
end

.configure_appObject

Configure BaseController - configure Sinatra



15
16
17
18
19
20
21
22
# File 'lib/marfa/configuration.rb', line 15

def self.configure_app
  return if @config.to_h.empty?

  _configure_settings(Marfa::Controllers::BaseController)
  _configure_settings(Marfa::Controllers::CssController) if Marfa.config.use_css_build
  _configure_ext_modules(Marfa::Controllers::BaseController)
  _configure_logger
end

.css_versionObject

return css version



4
5
6
# File 'lib/marfa/css_version.rb', line 4

def self.css_version
  @css_version ||= Time.now.to_i.to_s
end

.versionString

The current Marfa version.

Returns:

  • (String)

    The version number



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

def self.version
  VERSION
end