wtf-doc 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/wtf/cli/here.rb +5 -3
- data/lib/wtf/core.rb +6 -6
- data/lib/wtf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398b74aea3f3460273038c346516d11ee67c2365
|
4
|
+
data.tar.gz: 5263c1dfb5a5f60fc0c52ab278704b271b7eba4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d60d66f14819d8a069a862b1fcadece4f98511943491df532169bf6bc81e2e0da2b47ffd43f8843e89f08a8ca7e70a1d6fa23c2385dbb433b1ceb72b6597357
|
7
|
+
data.tar.gz: a5c3f1d502911ab286f284eed72bf40c3690ad67ba63811320a988de02d220019f4d7a978d56b1522f6d597211c2a38d41650c8bd7d4a8fa486f0922d68eb9eb
|
data/README.md
CHANGED
data/lib/wtf/cli/here.rb
CHANGED
@@ -15,9 +15,11 @@ module Wtf
|
|
15
15
|
\n\n wtf doc -c 'my documentation'"
|
16
16
|
option :c
|
17
17
|
def doc(*args)
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
if options[:c]
|
19
|
+
content = options[:c] + " " + args.join(" ")
|
20
|
+
Wtf::Core.new.write(content)
|
21
|
+
puts "Folder documentation added:"
|
22
|
+
end
|
21
23
|
puts Wtf::Core.new.content
|
22
24
|
end
|
23
25
|
|
data/lib/wtf/core.rb
CHANGED
@@ -6,18 +6,18 @@ module Wtf
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def has_documentation?
|
9
|
-
File.exist?(
|
9
|
+
File.exist?(wtf_file)
|
10
10
|
end
|
11
11
|
|
12
12
|
alias :is_documented? :has_documentation?
|
13
13
|
|
14
14
|
def wtf_file
|
15
|
-
'/.wtf'
|
15
|
+
current_path + '/.wtf'
|
16
16
|
end
|
17
17
|
|
18
18
|
def clean
|
19
19
|
if is_documented?
|
20
|
-
File.delete(
|
20
|
+
File.delete(wtf_file)
|
21
21
|
true
|
22
22
|
else
|
23
23
|
puts not_documented
|
@@ -26,16 +26,16 @@ module Wtf
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def not_documented
|
29
|
-
"This folder is not documented."
|
29
|
+
"This folder is not documented yet. Add a documentation by running: \n\n wtf -c 'a description of the folder'"
|
30
30
|
end
|
31
31
|
|
32
32
|
def write(data)
|
33
|
-
File.open(
|
33
|
+
File.open(wtf_file, 'w') {|f| f.write(data) }
|
34
34
|
end
|
35
35
|
|
36
36
|
def content
|
37
37
|
if is_documented?
|
38
|
-
data = File.read(
|
38
|
+
data = File.read(wtf_file)
|
39
39
|
data
|
40
40
|
else
|
41
41
|
puts not_documented
|
data/lib/wtf/version.rb
CHANGED