documentize 1.0.0 → 1.0.1

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: 57965ec4586ab232786be61504d5fd0df5a7e535
4
- data.tar.gz: b370f41a42b553ff961b96b1f572e01c8b51b75d
3
+ metadata.gz: 888019f660861cc6db18917c81375a7e495f1a1b
4
+ data.tar.gz: b259449ec2026642a6f6bde488312581a03d97a0
5
5
  SHA512:
6
- metadata.gz: e5df7647a8775c153dc7380d759135907524cd1fef87873688b7274c81c2c4dc2d664e70b164b9750a98845399dc59a63e089bd4a7bbb8d4cfd9d6fd4ee59190
7
- data.tar.gz: a9b4995a2a0b259f7ffcf4ddf08e3053782ab72916dd87c6782ee944fd6fb962d8ec05f5ae4566c705c60a1d4f76f6635e6a848b0c3d7658a857fce6909f27ad
6
+ metadata.gz: 8272f2547f0d19bdb87965a29dfad83c2070db117c467eeaa5d70b980affd0180a3d3611bb602e0e1280774a9ecbf6e4d8f8af0293e0249bd9a959efd9042964
7
+ data.tar.gz: 765338837f9f40523981705b390ad6a445bc7c07a8b220d8b3ec8846ee13896d16ebd9458233bf72280fa76391dec9b758d2bf44f996ac8a5bbac250dc95c21b
data/lib/documentize.rb CHANGED
@@ -31,7 +31,8 @@ module Documentize
31
31
  @tree, @header = collector.run(@file)
32
32
  informator.gen_info(tree)
33
33
  informator.clear_screen
34
- Printer.print_with_docs(tree)
34
+
35
+ Printer.print_with_docs(tree, header)
35
36
  end
36
37
 
37
38
  private
@@ -6,14 +6,14 @@ module Documentize
6
6
  do_block: /\sdo[\s\|.*]/
7
7
  }
8
8
 
9
- def self.build_docs(branch)
9
+ def self.build_docs(branch, indent = 0)
10
10
  doc_str = ""
11
- doc_str << "# Public: #{branch[:desc]}\n#\n"
11
+ doc_str << "#{' '*indent}# Public: #{branch[:desc]}\n#{' '*indent}#\n"
12
12
  if branch[:args]
13
13
  branch[:args].each do |arg|
14
- doc_str << "# #{arg[:name]} - #{arg[:type]}: #{arg[:desc]}\n"
14
+ doc_str << "#{' '*indent}# #{arg[:name]} - #{arg[:type]}: #{arg[:desc]}\n"
15
15
  end
16
- doc_str << "# \n"
16
+ doc_str << "#{' '*indent}# \n"
17
17
  end
18
18
  doc_str
19
19
  end
@@ -32,7 +32,7 @@ module Documentize
32
32
 
33
33
  def self.build_code(code, indent = 0)
34
34
  str = ""
35
- str << build_docs(code) if code[:doc]
35
+ str << build_docs(code, indent) if code[:doc]
36
36
  str << " "*indent
37
37
  str << "#{code[:type]} #{code[:name]}"
38
38
  str << build_args(code[:args]) if code[:args]
@@ -1,6 +1,7 @@
1
1
  module Documentize
2
2
  class Printer
3
- def self.print_with_docs(tree)
3
+ def self.print_with_docs(tree, header)
4
+ puts header
4
5
  tree.each do |branch|
5
6
  puts Builder.build_code(branch)
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module Documentize
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley