Class: SdocAll::BaseTask
- Inherits:
-
Object
- Object
- SdocAll::BaseTask
- Defined in:
- lib/sdoc_all/task.rb
Instance Method Summary collapse
- #clobber? ⇒ Boolean
- #config_hash ⇒ Object
- #config_hash_path ⇒ Object
- #created_rid_path ⇒ Object
- #last_build_time ⇒ Object
- #run_if_clobber ⇒ Object
Instance Method Details
#clobber? ⇒ Boolean
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sdoc_all/task.rb', line 21 def clobber? full_doc_path = Base.docs_path + doc_path return true unless full_doc_path.exist? created_hash = config_hash_path.read rescue nil if created_hash != config_hash puts "#{title}: config changed, rebuilding".red return true end end |
#config_hash ⇒ Object
5 6 7 |
# File 'lib/sdoc_all/task.rb', line 5 def config_hash Digest::SHA1.hexdigest(for_hash.inspect) end |
#config_hash_path ⇒ Object
9 10 11 |
# File 'lib/sdoc_all/task.rb', line 9 def config_hash_path Base.docs_path + doc_path + 'config.hash' end |
#created_rid_path ⇒ Object
13 14 15 |
# File 'lib/sdoc_all/task.rb', line 13 def created_rid_path Base.docs_path + doc_path + 'created.rid' end |
#last_build_time ⇒ Object
17 18 19 |
# File 'lib/sdoc_all/task.rb', line 17 def last_build_time Time.parse(created_rid_path.read) rescue nil end |