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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e219579c54499000cdf2fcde89a7294a29526888
4
- data.tar.gz: f20108134d05ed1731a5c17b464723a3fead4051
3
+ metadata.gz: 83e361b70b69334d1358cb9d9148c84803a82c09
4
+ data.tar.gz: ee5e0e494c2a595effe3d66c0a43d83ba047b568
5
5
  SHA512:
6
- metadata.gz: 07526c3422750a22b0fd6163cbff6d7bc974ab5b9804b6171de938e3ac25d56aeaeda696ed442b0c91734af1d0fad3413217dff2dc6c6409eaafc5164e178868
7
- data.tar.gz: 3e1d00d87e03ff78b2d4af461c660f22633f9b14dc59417becb51afd60fea0f75ce9b01e7a1d1192d4d631b7307e6d602b4f7a7543ccd0cc35c8b24752b1da1e
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::Core.new.content.to_s
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::Core.new.write(content)
21
+ Wtf::Doc.write(content)
22
22
  puts "Folder documentation added:"
23
- puts "Doc ==> " + Wtf::Core.new.content
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::Core.new.clean
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
@@ -1,3 +1,3 @@
1
1
  module Wtf
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/wtf.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "wtf/version"
2
- require "wtf/core"
3
- require "wtf/cli/here"
2
+ require "wtf/doc"
3
+ require "wtf/cli/application"
4
4
 
5
5
  module Wtf
6
6
  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.5
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/here.rb
102
- - lib/wtf/core.rb
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