wtf-doc 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83e361b70b69334d1358cb9d9148c84803a82c09
4
- data.tar.gz: ee5e0e494c2a595effe3d66c0a43d83ba047b568
3
+ metadata.gz: 2cf134a51aae1edbb5c5f635e06beba1e9f714b9
4
+ data.tar.gz: 8d7404959798a92f357e35797a4dd6a1a0ac2e0b
5
5
  SHA512:
6
- metadata.gz: 3e750f93db25cfafadb4bee2c483831c77e89c5807eb36dedf939542fde9b4642049fe176912b209f8c855a4dee8bd075a3840318c002d6b134aac906a583a1b
7
- data.tar.gz: ef894af4a702c9027ea54c80c34e2f097513257cab1053e05af4289e7b5fc2c773a42bc1223f5ce8cc79c0e1eccf657db2ca0df1c9819f8a32660d5f873baf6a
6
+ metadata.gz: f783bbf3e4eb6f328d3b43c6372501e6674b1bfb428540f2e13b33bfba9f978c50fec2d8498d4e620ff60e649453f9eedab83aa4409b6fb251943840cba374a8
7
+ data.tar.gz: a8e43ea76f7d7a914acdbb12bf1e49b352a437bf60f5168df58baab8678388be20e6f8aeb619ed4491a5a5727cce4aec12686bdf19d93783baea8dd2f736bb39
@@ -6,30 +6,33 @@ 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::Doc.content.to_s
10
- end
11
-
12
- default_task :here
13
-
14
- desc "doc", "This will write the description of the current folder.
15
- \n\n Usage:
16
- \n\n wtf doc -c 'my documentation'"
17
- option :c
18
- def doc(*args)
19
- if options[:c]
20
- content = options[:c] + " " + args.join(" ")
21
- Wtf::Doc.write(content)
22
- puts "Folder documentation added:"
23
- puts "Doc ==> " + Wtf::Doc.content
9
+ if Wtf::Doc.content
10
+ say "DOC ==> " + Wtf::Doc.content.to_s, :green
24
11
  else
25
- puts "Please provide some text with -c"
12
+ doc if yes?("Do you want to add a documentation for this folder?")
26
13
  end
27
14
  end
15
+ default_task :here
28
16
 
17
+
18
+ desc "doc", "This will write the description of the current folder. \n\n Usage: \n\n wtf doc"
19
+ def doc
20
+ content = ask("What others should know about this folder? \n\n").to_s
21
+ Wtf::Doc.write(content)
22
+ say "\n\n Folder documentation added: \n\n"
23
+ say Wtf::Doc.content.to_s + "\n\n", :green
24
+ end
25
+
29
26
  desc "clean", "This will clean the .wtf file from the current folder"
30
- option :clean
31
27
  def clean
32
- Wtf::Doc.clean
28
+ if Wtf::Doc.has_documentation?
29
+ if yes?("Are you sure to cleanup the documentation for this folder?")
30
+ Wtf::Doc.clean
31
+ say :cleaned, :green
32
+ end
33
+ else
34
+ say "This directory doesn't have any .wtf file", :yellow
35
+ end
33
36
  end
34
37
 
35
38
  end
data/lib/wtf/doc.rb CHANGED
@@ -26,7 +26,7 @@ module Wtf
26
26
  end
27
27
 
28
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'"
29
+ "This folder is not documented yet."
30
30
  end
31
31
 
32
32
  def write(data)
data/lib/wtf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wtf
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.8"
3
3
  end
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.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorenzo Sinisi