Module: Ore::Template
- Defined in:
- lib/ore/template/markup.rb,
lib/ore/template/helpers.rb,
lib/ore/template/template.rb,
lib/ore/template/directory.rb,
lib/ore/template/helpers/rdoc.rb,
lib/ore/template/interpolations.rb,
lib/ore/template/helpers/textile.rb,
lib/ore/template/helpers/markdown.rb,
lib/ore/template/exceptions/invalid_template.rb
Defined Under Namespace
Modules: Helpers, Interpolations, Markup Classes: Directory, InvalidTemplate
Class Method Summary collapse
-
.register(path) ⇒ Symbol
Registers a template with the generator.
-
.template?(name) ⇒ Boolean
Determines whether a template was registered.
-
.templates ⇒ Hash{Symbol => String}
The templates registered with the generator.
Class Method Details
.register(path) ⇒ Symbol
Registers a template with the generator.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ore/template/template.rb', line 50 def self.register(path) unless File.directory?(path) raise(StandardError,"#{path.dump} is must be a directory") end name = File.basename(path).sub(/^ore-/,'').to_sym self.templates[name] = path return name end |
.template?(name) ⇒ Boolean
Determines whether a template was registered.
30 31 32 |
# File 'lib/ore/template/template.rb', line 30 def self.template?(name) self.templates.has_key?(name.to_sym) end |
.templates ⇒ Hash{Symbol => String}
The templates registered with the generator.
13 14 15 |
# File 'lib/ore/template/template.rb', line 13 def self.templates @@templates ||= {} end |