Module: Pubba

Defined in:
lib/pubba.rb,
lib/pubba/page.rb,
lib/pubba/site.rb,
lib/pubba/errors.rb,
lib/pubba/locale.rb,
lib/pubba/monitor.rb,
lib/pubba/version.rb,
lib/pubba/html/helpers.rb,
lib/pubba/assets/handler.rb,
lib/pubba/assets/minifier.rb,
lib/pubba/assets/yui_minifier.rb,
lib/pubba/assets/configuration.rb,
lib/pubba/assets/sprockets_handler.rb

Defined Under Namespace

Modules: Assets, HTML, Monitor, Site Classes: ConfigurationError, Locale, Page

Constant Summary collapse

VERSION =

Pubba version string

'0.8.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.asset_folderObject

Returns the value of attribute asset_folder.



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

def asset_folder
  @asset_folder
end

.asset_handlerObject

Returns the value of attribute asset_handler.



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

def asset_handler
  @asset_handler
end

.asset_hostObject

Returns the value of attribute asset_host.



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

def asset_host
  @asset_host
end

.asset_minifierObject

Returns the value of attribute asset_minifier.



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

def asset_minifier
  @asset_minifier
end

.config_fileObject

Returns the value of attribute config_file.



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

def config_file
  @config_file
end

.public_folderObject

Returns the value of attribute public_folder.



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

def public_folder
  @public_folder
end

.r18n_folderObject

Returns the value of attribute r18n_folder.



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

def r18n_folder
  @r18n_folder
end

.r18n_localeObject

Returns the value of attribute r18n_locale.



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

def r18n_locale
  @r18n_locale
end

.script_folderObject

Returns the value of attribute script_folder.



11
12
13
# File 'lib/pubba.rb', line 11

def script_folder
  @script_folder
end

.style_folderObject

Returns the value of attribute style_folder.



11
12
13
# File 'lib/pubba.rb', line 11

def style_folder
  @style_folder
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Pubba)

    the object that the method was called on



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

def configure
  yield self
  validate_settings
  Site.configure
end

.init_asset_hostObject



31
32
33
# File 'lib/pubba.rb', line 31

def init_asset_host
  @asset_host     = -> asset {asset}
end

.set_defaultsObject



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

def set_defaults
  @asset_handler  = Pubba::Assets::SprocketsHandler
  @asset_minifier = Pubba::Assets::YUIMinifier
  @script_folder  = 'js'
  @style_folder   = 'css'

  init_asset_host
end

.validate_settingsObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/pubba.rb', line 35

def validate_settings
  missing_settings = []
  missing_settings << ":public_folder has not been set!" unless Pubba.public_folder
  missing_settings << ":asset_folder has not been set!" unless Pubba.asset_folder

  if missing_settings.length > 0
    messages = missing_settings.join("\n")
    raise Pubba::ConfigurationError.new("Missing configuration options:\n#{messages}")
  end
end