Class: Docks::Configuration
- Inherits:
-
Object
- Object
- Docks::Configuration
- Includes:
- Singleton
- Defined in:
- lib/docks/configuration.rb
Constant Summary collapse
- ROOT_DEPENDENT_PATHS =
[ :sources, :destination, :cache_location, :templates ]
Instance Attribute Summary collapse
-
#asset_folders ⇒ Object
Locations.
-
#cache_location ⇒ Object
Locations.
-
#compiled_assets ⇒ Object
Random assortment of other stuff.
-
#configured ⇒ Object
readonly
Stateful stuff.
-
#destination ⇒ Object
Key details — these are required.
-
#github_repo ⇒ Object
Random assortment of other stuff.
-
#helpers ⇒ Object
Random assortment of other stuff.
-
#mount_at ⇒ Object
Random assortment of other stuff.
-
#naming_convention ⇒ Object
Random assortment of other stuff.
-
#paginate ⇒ Object
Random assortment of other stuff.
-
#pattern_id(*args) ⇒ Object
Random assortment of other stuff.
-
#root ⇒ Object
Locations.
-
#sources ⇒ Object
Key details — these are required.
-
#templates ⇒ Object
Locations.
-
#theme ⇒ Object
Key details — these are required.
Instance Method Summary collapse
- #custom_languages {|Languages| ... } ⇒ Object
- #custom_parsers {|Parser| ... } ⇒ Object
- #custom_symbol_sources {|SymbolSources| ... } ⇒ Object
- #custom_tags {|Tags| ... } ⇒ Object
- #custom_templates {|Templates| ... } ⇒ Object
- #custom_templates=(custom_templates) ⇒ Object
- #finalize ⇒ Object
- #has_theme? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #paginate? ⇒ Boolean
- #restore_defaults ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
35 36 37 |
# File 'lib/docks/configuration.rb', line 35 def initialize restore_defaults end |
Instance Attribute Details
#asset_folders ⇒ Object
Locations
26 27 28 |
# File 'lib/docks/configuration.rb', line 26 def asset_folders @asset_folders end |
#cache_location ⇒ Object
Locations
26 27 28 |
# File 'lib/docks/configuration.rb', line 26 def cache_location @cache_location end |
#compiled_assets ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def compiled_assets @compiled_assets end |
#configured ⇒ Object (readonly)
Stateful stuff
33 34 35 |
# File 'lib/docks/configuration.rb', line 33 def configured @configured end |
#destination ⇒ Object
Key details — these are required
23 24 25 |
# File 'lib/docks/configuration.rb', line 23 def destination @destination end |
#github_repo ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def github_repo @github_repo end |
#helpers ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def helpers @helpers end |
#mount_at ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def mount_at @mount_at end |
#naming_convention ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def naming_convention @naming_convention end |
#paginate ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def paginate @paginate end |
#pattern_id(*args) ⇒ Object
Random assortment of other stuff
29 30 31 |
# File 'lib/docks/configuration.rb', line 29 def pattern_id @pattern_id end |
#sources ⇒ Object
Key details — these are required
23 24 25 |
# File 'lib/docks/configuration.rb', line 23 def sources @sources end |
#templates ⇒ Object
Locations
26 27 28 |
# File 'lib/docks/configuration.rb', line 26 def templates @templates end |
#theme ⇒ Object
Key details — these are required
23 24 25 |
# File 'lib/docks/configuration.rb', line 23 def theme @theme end |
Instance Method Details
#custom_languages {|Languages| ... } ⇒ Object
86 87 88 |
# File 'lib/docks/configuration.rb', line 86 def custom_languages yield Languages end |
#custom_parsers {|Parser| ... } ⇒ Object
106 107 108 |
# File 'lib/docks/configuration.rb', line 106 def custom_parsers yield Parser end |
#custom_symbol_sources {|SymbolSources| ... } ⇒ Object
102 103 104 |
# File 'lib/docks/configuration.rb', line 102 def custom_symbol_sources yield SymbolSources end |
#custom_tags {|Tags| ... } ⇒ Object
90 91 92 |
# File 'lib/docks/configuration.rb', line 90 def yield Tags end |
#custom_templates {|Templates| ... } ⇒ Object
94 95 96 |
# File 'lib/docks/configuration.rb', line 94 def custom_templates yield Templates end |
#custom_templates=(custom_templates) ⇒ Object
98 99 100 |
# File 'lib/docks/configuration.rb', line 98 def custom_templates=(custom_templates) Templates.register(custom_templates) end |
#finalize ⇒ Object
82 83 84 |
# File 'lib/docks/configuration.rb', line 82 def finalize @configured = true end |
#has_theme? ⇒ Boolean
70 71 72 |
# File 'lib/docks/configuration.rb', line 70 def has_theme? !!@theme end |
#paginate? ⇒ Boolean
66 67 68 |
# File 'lib/docks/configuration.rb', line 66 def paginate? !!@paginate end |
#restore_defaults ⇒ Object
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# 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 |