class Docks::Configuration

Constants

ROOT_DEPENDENT_PATHS

Attributes

asset_folders[RW]

Locations

cache_location[RW]

Locations

compiled_assets[RW]

Random assortment of other stuff

configured[R]

Stateful stuff

destination[RW]

Key details — these are required

github_repo[RW]

Random assortment of other stuff

helpers[RW]

Random assortment of other stuff

mount_at[RW]

Random assortment of other stuff

naming_convention[RW]

Random assortment of other stuff

paginate[RW]

Random assortment of other stuff

pattern_id[RW]

Random assortment of other stuff

root[RW]

Locations

sources[RW]

Key details — these are required

templates[RW]

Locations

theme[RW]

Key details — these are required

Public Class Methods

new() click to toggle source
# File lib/docks/configuration.rb, line 35
def initialize
  restore_defaults
end

Public Instance Methods

asset_folders=(new_asset_folders) click to toggle source
# File lib/docks/configuration.rb, line 43
def asset_folders=(new_asset_folders)
  new_asset_folders.each do |type, dir|
    @asset_folders.send("#{type}=".to_sym, dir)
  end

  @asset_folders
end
custom_languages() { |Languages| ... } click to toggle source
# File lib/docks/configuration.rb, line 86
def custom_languages
  yield Languages
end
custom_parsers() { |Parser| ... } click to toggle source
# File lib/docks/configuration.rb, line 106
def custom_parsers
  yield Parser
end
custom_symbol_sources() { |SymbolSources| ... } click to toggle source
# File lib/docks/configuration.rb, line 102
def custom_symbol_sources
  yield SymbolSources
end
custom_tags() { |Tags| ... } click to toggle source
# File lib/docks/configuration.rb, line 90
def custom_tags
  yield Tags
end
custom_templates() { |Templates| ... } click to toggle source
# File lib/docks/configuration.rb, line 94
def custom_templates
  yield Templates
end
custom_templates=(custom_templates) click to toggle source
# File lib/docks/configuration.rb, line 98
def custom_templates=(custom_templates)
  Templates.register(custom_templates)
end
finalize() click to toggle source
# File lib/docks/configuration.rb, line 82
def finalize
  @configured = true
end
has_theme?() click to toggle source
# File lib/docks/configuration.rb, line 70
def has_theme?
  !!@theme
end
naming_convention=(new_naming_convention) click to toggle source
# File lib/docks/configuration.rb, line 51
def naming_convention=(new_naming_convention)
  @naming_convention = NamingConventions.for(new_naming_convention)
  @naming_convention
end
paginate?() click to toggle source
# File lib/docks/configuration.rb, line 66
def paginate?
  !!@paginate
end
pattern_id=(block) click to toggle source
# File lib/docks/configuration.rb, line 78
def pattern_id=(block)
  Docks.pattern_id = block
end
restore_defaults() click to toggle source
# File lib/docks/configuration.rb, line 133
def restore_defaults
  @configured = false
  @sources = [
    "styles/**/*.{css,scss,sass,less,styl}",
    "scripts/**/*.{js,coffee,coffeescript}"
  ]
  @compiled_assets = []
  @github_repo = ""
  @naming_convention = NamingConventions::BEM.instance
  @helpers = []

  @theme = false
  @paginate = false

  @root = Pathname.pwd
  @cache_location = ".#{Docks::Cache::DIR}"

  @templates = "#{Docks::ASSETS_DIR}/templates"
  @custom_templates = {
    fallback: "pattern",
    demo: "demo"
  }

  @destination = "public"
  @asset_folders = OpenStruct.new(scripts: "scripts", styles: "styles")

  @mount_at = "pattern-library"
end
root=(new_root) click to toggle source
# File lib/docks/configuration.rb, line 39
def root=(new_root)
  @root = new_root.kind_of?(Pathname) ? new_root : Pathname.new(new_root)
end
theme=(new_theme) click to toggle source
# File lib/docks/configuration.rb, line 56
def theme=(new_theme)
  @theme = Themes.for(new_theme)
  @theme
end

Private Instance Methods

make_path_absolute(path) click to toggle source
# File lib/docks/configuration.rb, line 164
def make_path_absolute(path)
  pathname = path.kind_of?(Pathname) ? path : Pathname.new(path)
  if pathname.absolute?
    pathname
  else
    @root + pathname
  end
end