Class: RakeContentFile::Task
- Inherits:
-
Rake::FileTask
- Object
- Rake::FileTask
- RakeContentFile::Task
- Defined in:
- lib/rake-file-content/task.rb
Instance Attribute Summary collapse
-
#source_file ⇒ Object
Returns the value of attribute source_file.
Instance Method Summary collapse
- #cache_file ⇒ Object
- #dependent_contents_changed? ⇒ Boolean
- #execute(args = nil) ⇒ Object
-
#initialize(task_name, app) ⇒ Task
constructor
A new instance of Task.
- #needed? ⇒ Boolean
Methods inherited from Rake::FileTask
Constructor Details
#initialize(task_name, app) ⇒ Task
Returns a new instance of Task.
7 8 9 |
# File 'lib/rake-file-content/task.rb', line 7 def initialize(task_name, app) super(task_name, app) end |
Instance Attribute Details
#source_file ⇒ Object
Returns the value of attribute source_file.
5 6 7 |
# File 'lib/rake-file-content/task.rb', line 5 def source_file @source_file end |
Instance Method Details
#cache_file ⇒ Object
29 30 31 |
# File 'lib/rake-file-content/task.rb', line 29 def cache_file name + ".content_hash" end |
#dependent_contents_changed? ⇒ Boolean
23 24 25 26 27 |
# File 'lib/rake-file-content/task.rb', line 23 def dependent_contents_changed? return true if cached_dep_list.nil? dep_list != cached_dep_list end |
#execute(args = nil) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rake-file-content/task.rb', line 15 def execute(args=nil) super File.open(cache_file, "w") do |f| f << dep_list.serialize end end |
#needed? ⇒ Boolean
11 12 13 |
# File 'lib/rake-file-content/task.rb', line 11 def needed? dependent_contents_changed? end |