Class: RevealCK::Builders::CreationTask
- Inherits:
-
Object
- Object
- RevealCK::Builders::CreationTask
- Defined in:
- lib/reveal-ck/builders/creation_task.rb
Overview
Works within the context of Rake to setup a task for a given name
Direct Known Subclasses
CopyFilesTask, CreateIndexHtml, CreateSlidesHtml, SlidesBuilder
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#things_to_create ⇒ Object
readonly
Returns the value of attribute things_to_create.
Instance Method Summary collapse
-
#initialize(args) ⇒ CreationTask
constructor
A new instance of CreationTask.
- #name ⇒ Object
- #prepare ⇒ Object
- #setup ⇒ Object
Methods included from RakeAware
#copy_file, #create_directory, #task
Methods included from Retrieve
Constructor Details
#initialize(args) ⇒ CreationTask
Returns a new instance of CreationTask.
10 11 12 13 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 10 def initialize(args) @application = retrieve(:application, args) @things_to_create = Set.new end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
8 9 10 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 8 def application @application end |
#things_to_create ⇒ Object (readonly)
Returns the value of attribute things_to_create.
8 9 10 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 8 def things_to_create @things_to_create end |
Instance Method Details
#name ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 19 def name full_class_name = self.class.to_s class_name = full_class_name.gsub(/.*::/, '') add_underscores = class_name.gsub(/([A-Z])/, '_\1') trim_first_underscore = add_underscores[1..add_underscores.size] trim_first_underscore.downcase end |
#prepare ⇒ Object
27 28 29 30 31 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 27 def prepare setup task(name => things_to_create.to_a) name end |
#setup ⇒ Object
15 16 17 |
# File 'lib/reveal-ck/builders/creation_task.rb', line 15 def setup fail('setup must be implemented by subclasses') end |