Class: Wtf::Doc
- Inherits:
-
Object
- Object
- Wtf::Doc
- Defined in:
- lib/wtf/doc.rb
Class Method Summary collapse
- .clean ⇒ Object
- .content ⇒ Object (also: read_documentation)
- .current_path ⇒ Object
- .has_documentation? ⇒ Boolean (also: is_documented?)
- .not_documented ⇒ Object
- .write(data) ⇒ Object
- .wtf_file ⇒ Object
Class Method Details
.clean ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/wtf/doc.rb', line 19 def clean if is_documented? File.delete(wtf_file) true else puts not_documented end end |
.content ⇒ Object Also known as: read_documentation
36 37 38 39 40 41 42 43 |
# File 'lib/wtf/doc.rb', line 36 def content if is_documented? data = File.read(wtf_file) data else puts not_documented end end |
.current_path ⇒ Object
5 6 7 |
# File 'lib/wtf/doc.rb', line 5 def current_path Dir.pwd end |
.has_documentation? ⇒ Boolean Also known as: is_documented?
9 10 11 |
# File 'lib/wtf/doc.rb', line 9 def has_documentation? File.exist?(wtf_file) end |
.not_documented ⇒ Object
28 29 30 |
# File 'lib/wtf/doc.rb', line 28 def not_documented "This folder is not documented yet." end |
.write(data) ⇒ Object
32 33 34 |
# File 'lib/wtf/doc.rb', line 32 def write(data) File.open(wtf_file, 'w') {|f| f.write(data) } end |
.wtf_file ⇒ Object
15 16 17 |
# File 'lib/wtf/doc.rb', line 15 def wtf_file current_path + '/.wtf' end |