wtf-doc 0.1.5 → 0.1.6
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/lib/wtf/cli/{here.rb → application.rb} +4 -4
- data/lib/wtf/doc.rb +48 -0
- data/lib/wtf/version.rb +1 -1
- data/lib/wtf.rb +2 -2
- metadata +3 -3
- data/lib/wtf/core.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83e361b70b69334d1358cb9d9148c84803a82c09
|
4
|
+
data.tar.gz: ee5e0e494c2a595effe3d66c0a43d83ba047b568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e750f93db25cfafadb4bee2c483831c77e89c5807eb36dedf939542fde9b4642049fe176912b209f8c855a4dee8bd075a3840318c002d6b134aac906a583a1b
|
7
|
+
data.tar.gz: ef894af4a702c9027ea54c80c34e2f097513257cab1053e05af4289e7b5fc2c773a42bc1223f5ce8cc79c0e1eccf657db2ca0df1c9819f8a32660d5f873baf6a
|
@@ -6,7 +6,7 @@ module Wtf
|
|
6
6
|
|
7
7
|
desc "here","This will read you the description of this folder"
|
8
8
|
def here
|
9
|
-
puts "DOC ==> " + Wtf::
|
9
|
+
puts "DOC ==> " + Wtf::Doc.content.to_s
|
10
10
|
end
|
11
11
|
|
12
12
|
default_task :here
|
@@ -18,9 +18,9 @@ module Wtf
|
|
18
18
|
def doc(*args)
|
19
19
|
if options[:c]
|
20
20
|
content = options[:c] + " " + args.join(" ")
|
21
|
-
Wtf::
|
21
|
+
Wtf::Doc.write(content)
|
22
22
|
puts "Folder documentation added:"
|
23
|
-
puts "Doc ==> " + Wtf::
|
23
|
+
puts "Doc ==> " + Wtf::Doc.content
|
24
24
|
else
|
25
25
|
puts "Please provide some text with -c"
|
26
26
|
end
|
@@ -29,7 +29,7 @@ module Wtf
|
|
29
29
|
desc "clean", "This will clean the .wtf file from the current folder"
|
30
30
|
option :clean
|
31
31
|
def clean
|
32
|
-
Wtf::
|
32
|
+
Wtf::Doc.clean
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
data/lib/wtf/doc.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
module Wtf
|
2
|
+
class Doc
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def current_path
|
6
|
+
Dir.pwd
|
7
|
+
end
|
8
|
+
|
9
|
+
def has_documentation?
|
10
|
+
File.exist?(wtf_file)
|
11
|
+
end
|
12
|
+
|
13
|
+
alias :is_documented? :has_documentation?
|
14
|
+
|
15
|
+
def wtf_file
|
16
|
+
current_path + '/.wtf'
|
17
|
+
end
|
18
|
+
|
19
|
+
def clean
|
20
|
+
if is_documented?
|
21
|
+
File.delete(wtf_file)
|
22
|
+
true
|
23
|
+
else
|
24
|
+
puts not_documented
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def not_documented
|
29
|
+
"This folder is not documented yet. Add a documentation by running: \n\n wtf doc -c 'a description of the folder'"
|
30
|
+
end
|
31
|
+
|
32
|
+
def write(data)
|
33
|
+
File.open(wtf_file, 'w') {|f| f.write(data) }
|
34
|
+
end
|
35
|
+
|
36
|
+
def content
|
37
|
+
if is_documented?
|
38
|
+
data = File.read(wtf_file)
|
39
|
+
data
|
40
|
+
else
|
41
|
+
puts not_documented
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
alias :read_documentation :content
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/wtf/version.rb
CHANGED
data/lib/wtf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wtf-doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorenzo Sinisi
|
@@ -98,8 +98,8 @@ files:
|
|
98
98
|
- bin/setup
|
99
99
|
- bin/wtf
|
100
100
|
- lib/wtf.rb
|
101
|
-
- lib/wtf/cli/
|
102
|
-
- lib/wtf/
|
101
|
+
- lib/wtf/cli/application.rb
|
102
|
+
- lib/wtf/doc.rb
|
103
103
|
- lib/wtf/version.rb
|
104
104
|
- wtf.gemspec
|
105
105
|
homepage: https://github.com/lorenzosinisi/wtf
|
data/lib/wtf/core.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
module Wtf
|
2
|
-
class Core
|
3
|
-
|
4
|
-
def current_path
|
5
|
-
Dir.pwd
|
6
|
-
end
|
7
|
-
|
8
|
-
def has_documentation?
|
9
|
-
File.exist?(wtf_file)
|
10
|
-
end
|
11
|
-
|
12
|
-
alias :is_documented? :has_documentation?
|
13
|
-
|
14
|
-
def wtf_file
|
15
|
-
current_path + '/.wtf'
|
16
|
-
end
|
17
|
-
|
18
|
-
def clean
|
19
|
-
if is_documented?
|
20
|
-
File.delete(wtf_file)
|
21
|
-
true
|
22
|
-
else
|
23
|
-
puts not_documented
|
24
|
-
nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def not_documented
|
29
|
-
"This folder is not documented yet. Add a documentation by running: \n\n wtf doc -c 'a description of the folder'"
|
30
|
-
end
|
31
|
-
|
32
|
-
def write(data)
|
33
|
-
File.open(wtf_file, 'w') {|f| f.write(data) }
|
34
|
-
end
|
35
|
-
|
36
|
-
def content
|
37
|
-
if is_documented?
|
38
|
-
data = File.read(wtf_file)
|
39
|
-
data
|
40
|
-
else
|
41
|
-
puts not_documented
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
alias :read_documentation :content
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|