wtf-doc 0.1.1 → 0.1.2

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: 3a67ee9b4f3d6ebfdb5eeb9604ea1d18c7edf399
4
- data.tar.gz: 1bde6d6ab921c48dc7693a2753e164b170bf0535
3
+ metadata.gz: 398b74aea3f3460273038c346516d11ee67c2365
4
+ data.tar.gz: 5263c1dfb5a5f60fc0c52ab278704b271b7eba4d
5
5
  SHA512:
6
- metadata.gz: 2c2716ad647baecf8d9390a13f62aa4e95c67312ca51deb710585cd293edf88fd5481f6bea95d419ac14cbfaf16b734e1125a535cffb278e257f1946a030e9fd
7
- data.tar.gz: 755dcc64b2df43e48dcef4aed5b49b3d3f454e8959e5f43ddc8165ebf1b50ccf604e8429d14d520587b310a06737e0b7e499d862613aa6b4834453650c9e560c
6
+ metadata.gz: 7d60d66f14819d8a069a862b1fcadece4f98511943491df532169bf6bc81e2e0da2b47ffd43f8843e89f08a8ca7e70a1d6fa23c2385dbb433b1ceb72b6597357
7
+ data.tar.gz: a5c3f1d502911ab286f284eed72bf40c3690ad67ba63811320a988de02d220019f4d7a978d56b1522f6d597211c2a38d41650c8bd7d4a8fa486f0922d68eb9eb
data/README.md CHANGED
@@ -17,7 +17,6 @@ Iinstall it yourself as:
17
17
  $ wtf doc -c "some description" # to add the description of the current folder
18
18
 
19
19
 
20
-
21
20
  ## Contributing
22
21
 
23
22
  Bug reports and pull requests are welcome on GitHub at https://github.com/lorenzosinisi/wtf.
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
- content = options[:c] + " " + args.join(" ") if options[:c]
19
- Wtf::Core.new.write(content) if options[:c]
20
- puts "Folder documentation added:"
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?(current_path + wtf_file)
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(current_path + wtf_file)
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(current_path + '/.wtf', 'w') {|f| f.write(data) }
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(current_path + wtf_file)
38
+ data = File.read(wtf_file)
39
39
  data
40
40
  else
41
41
  puts not_documented
data/lib/wtf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wtf
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorenzo Sinisi