Module: Docks

Defined in:
lib/docks.rb,
lib/docks/tags.rb,
lib/docks/build.rb,
lib/docks/cache.rb,
lib/docks/group.rb,
lib/docks/types.rb,
lib/docks/errors.rb,
lib/docks/parser.rb,
lib/docks/themes.rb,
lib/docks/helpers.rb,
lib/docks/ostruct.rb,
lib/docks/process.rb,
lib/docks/version.rb,
lib/docks/markdown.rb,
lib/docks/languages.rb,
lib/docks/messenger.rb,
lib/docks/templates.rb,
lib/docks/containers.rb,
lib/docks/descriptor.rb,
lib/docks/processors.rb,
lib/docks/command_line.rb,
lib/docks/tags/for_tag.rb,
lib/docks/configuration.rb,
lib/docks/tags/base_tag.rb,
lib/docks/tags/beta_tag.rb,
lib/docks/tags/link_tag.rb,
lib/docks/tags/name_tag.rb,
lib/docks/tags/type_tag.rb,
lib/docks/symbol_sources.rb,
lib/docks/tags/alias_tag.rb,
lib/docks/tags/class_tag.rb,
lib/docks/tags/group_tag.rb,
lib/docks/tags/param_tag.rb,
lib/docks/tags/since_tag.rb,
lib/docks/tags/state_tag.rb,
lib/docks/tags/title_tag.rb,
lib/docks/tags/value_tag.rb,
lib/docks/tags/access_tag.rb,
lib/docks/tags/active_tag.rb,
lib/docks/tags/author_tag.rb,
lib/docks/tags/helper_tag.rb,
lib/docks/tags/markup_tag.rb,
lib/docks/tags/member_tag.rb,
lib/docks/tags/method_tag.rb,
lib/docks/tags/object_tag.rb,
lib/docks/tags/public_tag.rb,
lib/docks/tags/set_by_tag.rb,
lib/docks/tags/source_tag.rb,
lib/docks/tags/static_tag.rb,
lib/docks/tags/throws_tag.rb,
lib/docks/tags/example_tag.rb,
lib/docks/tags/factory_tag.rb,
lib/docks/tags/pattern_tag.rb,
lib/docks/tags/private_tag.rb,
lib/docks/tags/require_tag.rb,
lib/docks/tags/returns_tag.rb,
lib/docks/tags/variant_tag.rb,
lib/docks/tags/preclude_tag.rb,
lib/docks/tags/property_tag.rb,
lib/docks/tags/subtitle_tag.rb,
lib/docks/naming_conventions.rb,
lib/docks/parsers/css_parser.rb,
lib/docks/tags/demo_type_tag.rb,
lib/docks/tags/signature_tag.rb,
lib/docks/tags/variation_tag.rb,
lib/docks/helpers/path_helper.rb,
lib/docks/parsers/base_parser.rb,
lib/docks/parsers/less_parser.rb,
lib/docks/parsers/sass_parser.rb,
lib/docks/tags/deprecated_tag.rb,
lib/docks/tags/description_tag.rb,
lib/docks/tags/symbol_type_tag.rb,
lib/docks/helpers/github_helper.rb,
lib/docks/helpers/render_helper.rb,
lib/docks/parsers/stylus_parser.rb,
lib/docks/tags/include_with_tag.rb,
lib/docks/tags/subcomponent_tag.rb,
lib/docks/languages/css_language.rb,
lib/docks/languages/erb_language.rb,
lib/docks/renderers/erb_renderer.rb,
lib/docks/tags/activate_with_tag.rb,
lib/docks/tags/compatibility_tag.rb,
lib/docks/languages/base_language.rb,
lib/docks/languages/haml_language.rb,
lib/docks/languages/html_language.rb,
lib/docks/languages/json_language.rb,
lib/docks/languages/less_language.rb,
lib/docks/languages/sass_language.rb,
lib/docks/languages/slim_language.rb,
lib/docks/languages/yaml_language.rb,
lib/docks/renderers/base_renderer.rb,
lib/docks/renderers/haml_renderer.rb,
lib/docks/renderers/slim_renderer.rb,
lib/docks/containers/base_container.rb,
lib/docks/containers/demo_container.rb,
lib/docks/languages/stylus_language.rb,
lib/docks/parsers/javascript_parser.rb,
lib/docks/containers/class_container.rb,
lib/docks/containers/mixin_container.rb,
lib/docks/containers/state_container.rb,
lib/docks/tags/javascript_action_tag.rb,
lib/docks/containers/symbol_container.rb,
lib/docks/languages/markdown_language.rb,
lib/docks/parsers/coffeescript_parser.rb,
lib/docks/containers/factory_container.rb,
lib/docks/containers/pattern_container.rb,
lib/docks/containers/variant_container.rb,
lib/docks/containers/function_container.rb,
lib/docks/containers/variable_container.rb,
lib/docks/languages/javascript_language.rb,
lib/docks/containers/component_container.rb,
lib/docks/containers/variation_container.rb,
lib/docks/languages/coffeescript_language.rb,
lib/docks/symbol_sources/mdn_symbol_source.rb,
lib/docks/symbol_sources/base_symbol_source.rb,
lib/docks/symbol_sources/sass_symbol_source.rb,
lib/docks/symbol_sources/jquery_symbol_source.rb,
lib/docks/containers/pattern_library_container.rb,
lib/docks/renderers/common_features/capturable.rb,
lib/docks/renderers/common_features/helperable.rb,
lib/docks/languages/common_types/markup_language.rb,
lib/docks/naming_conventions/bem_naming_convention.rb,
lib/docks/naming_conventions/base_naming_convention.rb,
lib/docks/naming_conventions/suit_naming_convention.rb

Defined Under Namespace

Modules: Containers, Helpers, Languages, Markdown, Messenger, NamingConventions, Parsers, Processors, Renderers, SymbolSources, Tags, Templates, Themes, Types Classes: Builder, Cache, CommandLine, Configuration, Descriptor, Grouper, NoAssetError, NoPatternError, NoTemplateError, OpenStruct, Parser, Process

Constant Summary collapse

ASSETS_DIR =
"pattern_library_assets"
CONFIG_FILE =
"docks_config.*"
VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.buildObject



302
303
304
# File 'lib/docks/build.rb', line 302

def self.build
  Builder.build
end

.component_template_pathObject



121
# File 'lib/docks/templates.rb', line 121

def self.component_template_path; Pathname.new(File.expand_path("../../template/assets/templates/components", __FILE__)) end

.configObject



177
178
179
# File 'lib/docks/configuration.rb', line 177

def self.config
  @configuration
end

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

Yields:

  • (@configuration)


209
210
211
212
213
214
215
216
217
# File 'lib/docks/configuration.rb', line 209

def self.configure
  unless block_given?
    return configure_with(CONFIG_FILE)
  end

  pre_configuration unless @configuration.configured
  yield @configuration
  post_configuration
end

.configure_with(configurer) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/docks/configuration.rb', line 181

def self.configure_with(configurer)
  if configurer.kind_of?(Hash)
    configure do |config|
      configurer.each do |key, val|
        key = "#{key}=".to_sym
        config.send(key, val) if config.respond_to?(key)
      end
    end

    return
  end

  configurer = Dir[configurer].first

  unless File.exists?(configurer)
    Messenger.error("No configuration file could be found.")
    exit
  end

  if File.extname(configurer) =~ /rb/
    self.class_eval(File.read(configurer), configurer, 0)
  else
    Languages.register_bundled_languages
    language = Languages.language_for(configurer)
    configure_with(language.load_stub(configurer)) unless language.nil?
  end
end

.current_fileObject



78
# File 'lib/docks/parser.rb', line 78

def self.current_file; @current_file end

.current_file=(file) ⇒ Object



79
# File 'lib/docks/parser.rb', line 79

def self.current_file=(file); @current_file = file end

.current_languageObject



80
# File 'lib/docks/parser.rb', line 80

def self.current_language; @current_language end

.current_language=(language) ⇒ Object



81
# File 'lib/docks/parser.rb', line 81

def self.current_language=(language); @current_language = language end

.current_parserObject



82
# File 'lib/docks/parser.rb', line 82

def self.current_parser; @current_parser end

.current_parser=(parser) ⇒ Object



83
# File 'lib/docks/parser.rb', line 83

def self.current_parser=(parser); @current_parser = parser end

.current_patternObject



84
# File 'lib/docks/parser.rb', line 84

def self.current_pattern; @current_pattern end

.current_pattern=(pattern) ⇒ Object



85
# File 'lib/docks/parser.rb', line 85

def self.current_pattern=(pattern); @current_pattern = pattern.to_s end

.current_render_destinationObject



119
# File 'lib/docks/templates.rb', line 119

def self.current_render_destination; @current_render_destination end

.current_render_destination=(destination) ⇒ Object



120
# File 'lib/docks/templates.rb', line 120

def self.current_render_destination=(destination); @current_render_destination = destination end

.current_rendererObject



62
# File 'lib/docks/renderers/base_renderer.rb', line 62

def self.current_renderer; @current_renderer end

.current_renderer=(renderer) ⇒ Object



63
# File 'lib/docks/renderers/base_renderer.rb', line 63

def self.current_renderer=(renderer); @current_renderer = renderer end

.parse(options = {}) ⇒ Object



298
299
300
# File 'lib/docks/build.rb', line 298

def self.parse(options = {})
  Builder.parse(options)
end

.pattern_id(filename = nil, &block) ⇒ Object



6
7
8
9
# File 'lib/docks/group.rb', line 6

def self.pattern_id(filename = nil, &block)
  return nil unless filename.kind_of?(String)
  @pattern_id.call(filename)
end

.pattern_id=(block) ⇒ Object



11
12
13
14
# File 'lib/docks/group.rb', line 11

def self.pattern_id=(block)
  return if block.call("foo").nil?
  @pattern_id = block
end

.template_for(id) ⇒ Object



118
# File 'lib/docks/templates.rb', line 118

def self.template_for(id); Templates.template_for(id) end