class_docu_shower 1.0.1 → 1.0.3

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjUwM2QwODFhMGY0YzAwZWVlYTNhMjNmZjY2N2JhNTViYjdiYTZjNA==
5
- data.tar.gz: !binary |-
6
- ZGY2ZWQ1ODY0YjIyYTMzZDg1NjZlZjExMTM1ZjljZGE2YjI3NTRiNw==
2
+ SHA1:
3
+ metadata.gz: 706a06d9164f89d3cf5a600bdbc0e1eb65bb839f
4
+ data.tar.gz: 6c58b78d9404c2e5e0983a983befcd6fe1196a96
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MzZiNWFjNWI0NTFjMjI2NTEzODFmZDIyYmM3NTU2NGVhNzEyMGIyM2VlMDBk
10
- ZDdjM2FiNjA0OWU1OTRhMDc1ODQzNzYxOGY5MTc0MGUwM2I2NmY5YjYyNTVh
11
- NWNjZGJlODE4MWQ1MmMyOGQ5N2NlZGFlYTk1YWJjNzgzN2QwMjU=
12
- data.tar.gz: !binary |-
13
- ZmExNWMxNzdmNmRmYzgzNTMzOTljNDdlZWYxNzFiNmMyNTcxMzIxZDVlOWYw
14
- ODY0OTE2NjMyZjQwMjRlZDgxMTcyNDk3OWVlZmNhNmM1YjNjZmZlMTY3NzAw
15
- MTZjYzEwOTIwNjM2YTI1NjczZGNjZmIzNTMyNjg0N2Q5NGEwOTQ=
6
+ metadata.gz: a85869271e95c374ecdc4cf39cf2d9c19f141068d92c47d9e0da93930452682c46041b73fc487541af2da247293c8e8fa193c649cfb270130b0db08f3cd489c5
7
+ data.tar.gz: 445e7ac50e3b53e8413835c35413b87f145aabc6814404bb1b7125a5562cb8d8c32d2e29107292876f7f7223a009606d5b77d0e11699ac778bbee66e29441758
@@ -4,29 +4,57 @@
4
4
  Gem::Specification.new { |s|
5
5
 
6
6
  s.name = 'class_docu_shower'
7
- s.version = '1.0.1'
7
+ s.version = '1.0.3'
8
8
  s.date = Time.now.strftime('%Y-%m-%d')
9
9
 
10
10
  s.summary = <<-EOF
11
+
12
+ It will display the header of a .rb file in question.
13
+ For this to properly function, you should use 3 =
14
+ followed by the name of the class, and delimited
15
+ in # ===== entries.
16
+
17
+ Example:
18
+
19
+ === Menu
20
+
11
21
  If you have specific suggestions to make this gem more
12
22
  useful for others, please drop me an email at:
13
23
  shevegen@gmail.com
14
24
  Thank you.
25
+
15
26
  EOF
16
27
 
17
28
  s.description = <<-EOF
18
- This library is called class_docu_shower
29
+
30
+ This library is called class_docu_shower.
31
+
32
+ It will display the header of a .rb file in question.
33
+ For this to properly function, you should use 3 =
34
+ followed by the name of the class, and delimited
35
+ in # ===== entries.
36
+
37
+ Example:
38
+
39
+ === Menu
40
+
41
+ If you have specific suggestions to make this gem more
42
+ useful for others, please drop me an email at:
43
+ shevegen@gmail.com
44
+ Thank you.
45
+
19
46
  EOF
20
47
 
21
- s.extra_rdoc_files = %w()
48
+ s.extra_rdoc_files = %w( USAGE.md )
22
49
 
23
50
  s.authors = ['Robert A. Heiler']
24
51
  s.email = 'shevegen@gmail.com'
25
52
  s.files = Dir['**/*']
26
53
  s.files << 'USAGE.md'
27
54
  s.license = 'GPL 2'
28
- s.required_ruby_version = '>= 1.8.7'
55
+ s.required_ruby_version = '>= 1.9.2'
29
56
  s.homepage = 'http://rubygems.org/gems/class_docu_shower'
57
+
30
58
  s.rubygems_version = '2.1.11'
31
59
 
32
60
  s.add_dependency 'colours', '>= 0.0.12'
@@ -1,6 +1,8 @@
1
1
  #!/System/Executables/ruby -w
2
2
  # Encoding: ASCII-8BIT
3
3
  # =========================================================================== #
4
+ # === ClassDocuShower
5
+ #
4
6
  # This file will extract the comment from a class and return a
5
7
  # string about the docu. That comment must be padded inside lines
6
8
  # with '# ====' lines, like this file here.
@@ -17,14 +19,18 @@ class ClassDocuShower # require 'class_docu_shower'; ClassDocuShower.new
17
19
 
18
20
  include Colours
19
21
 
20
- attr_reader :file
22
+ attr_reader :files
21
23
 
22
24
  DEFAULT_FILE = '/Users/x/DATA/PROGRAMMING_LANGUAGES/RUBY/SRC/TOOLS/show_available_users.rb'
23
25
  FORBIDDEN_CHARACTERS = '# ===='
24
26
 
25
- def initialize(i = nil, run_already = true)
27
+ def initialize(
28
+ i = nil,
29
+ run_already = true
30
+ )
31
+ be_silent
26
32
  reset
27
- set_file(i)
33
+ set_files(i)
28
34
  if run_already.is_a? Hash # Intercept hash here.
29
35
  if run_already.has_key? :verbose
30
36
  @be_verbose = run_already[:verbose]
@@ -37,36 +43,31 @@ class ClassDocuShower # require 'class_docu_shower'; ClassDocuShower.new
37
43
  run if run_already
38
44
  end
39
45
  def reset # (reset tag)
40
- be_silent
46
+ @data = nil
41
47
  @usher = Usher.new
48
+ end
49
+ def reset_usher_object
50
+ @usher.reset
42
51
  @usher.allow_n_changes = 1
43
52
  end
44
53
  def be_verbose; @be_verbose = true; end
45
54
  def be_silent; @be_verbose = false; end
46
- def set_file(i = DEFAULT_FILE)
47
- i = i[0] if i.is_a? Array
55
+ def set_files(i = DEFAULT_FILE)
56
+ # i = i[0] if i.is_a? Array
48
57
  i = DEFAULT_FILE if i.nil?
49
- i = i.to_s.dup if i
50
- @file = i
58
+ # i = i.to_s.dup if i
59
+ i = [i] unless i.is_a? Array # Must always be an Array.
60
+ i = i.flatten # But keep it flattened.
61
+ @files = i
51
62
  end
52
- def read_in_file
53
- if File.exist? @file
54
- @data = File.readlines(@file)
63
+ def read_in_file(this_file = @file)
64
+ if File.exist? this_file
65
+ @data = File.readlines(this_file)
55
66
  else # We should report.
56
- opn; e 'We could not find a file at '+@file+','
67
+ opn; e 'We could not find a file at '+sfile(this_file)+','
57
68
  opn; e 'thus can not check whether it has an documentation.'
58
69
  end
59
70
  end
60
- def process_dataset
61
- @data.each {|entry|
62
- if entry.include? FORBIDDEN_CHARACTERS
63
- @usher.toggle
64
- else
65
- @usher << entry.delete('#').lstrip
66
- end
67
- }
68
- @result = @usher._
69
- end
70
71
  def show_result
71
72
  if @be_verbose # We will be chatty here.
72
73
  opn; e 'From the file '+sfile(@file)+' we '
@@ -77,13 +78,34 @@ class ClassDocuShower # require 'class_docu_shower'; ClassDocuShower.new
77
78
  def show_the_result
78
79
  e @result
79
80
  end
81
+ def process_dataset
82
+ reset_usher_object
83
+ @data.each {|entry| # @data is an Array.
84
+ if entry.include? FORBIDDEN_CHARACTERS
85
+ @usher.toggle
86
+ else
87
+ # Else add the entry. We should not use .lstrip
88
+ # on it because that way we can preserve
89
+ # indent.
90
+ @usher << entry.delete('#') # .lstrip
91
+ end
92
+ }
93
+ @result = @usher._
94
+ end
95
+ def show_file_header(i)
96
+ e 'From file '+sfile(i)+':'+N+N
97
+ end
80
98
  def process
81
- read_in_file
82
- process_dataset
99
+ @files.each {|file|
100
+ show_file_header(file)
101
+ read_in_file(file)
102
+ process_dataset
103
+ show_result
104
+ e
105
+ }
83
106
  end
84
107
  def run # (run tag)
85
108
  process
86
- show_result
87
109
  end
88
110
 
89
111
  end
metadata CHANGED
@@ -1,64 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: class_docu_shower
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert A. Heiler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-08 00:00:00.000000000 Z
11
+ date: 2014-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colours
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.0.12
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opn
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: usher
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.0.6
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.0.6
55
- description: ! ' This library is called class_docu_shower
56
-
57
- '
55
+ description: "\n This library is called class_docu_shower.\n \n It will display
56
+ the header of a .rb file in question.\n For this to properly function, you should
57
+ use 3 =\n followed by the name of the class, and delimited\n in # ===== entries.\n
58
+ \ \n Example:\n \n === Menu\n\n If you have specific suggestions to
59
+ make this gem more\n useful for others, please drop me an email at:\n shevegen@gmail.com\n
60
+ \ Thank you.\n\n"
58
61
  email: shevegen@gmail.com
59
62
  executables: []
60
63
  extensions: []
61
- extra_rdoc_files: []
64
+ extra_rdoc_files:
65
+ - USAGE.md
62
66
  files:
63
67
  - USAGE.md
64
68
  - class_docu_shower.gemspec
@@ -74,12 +78,12 @@ require_paths:
74
78
  - lib
75
79
  required_ruby_version: !ruby/object:Gem::Requirement
76
80
  requirements:
77
- - - ! '>='
81
+ - - ">="
78
82
  - !ruby/object:Gem::Version
79
- version: 1.8.7
83
+ version: 1.9.2
80
84
  required_rubygems_version: !ruby/object:Gem::Requirement
81
85
  requirements:
82
- - - ! '>='
86
+ - - ">="
83
87
  - !ruby/object:Gem::Version
84
88
  version: '0'
85
89
  requirements: []
@@ -87,6 +91,10 @@ rubyforge_project:
87
91
  rubygems_version: 2.2.2
88
92
  signing_key:
89
93
  specification_version: 4
90
- summary: ! 'If you have specific suggestions to make this gem more useful for others,
91
- please drop me an email at: shevegen@gmail.com Thank you.'
94
+ summary: 'It will display the header of a .rb file in question. For this to properly
95
+ function, you should use 3 = followed by the name of the class, and delimited in
96
+ # ===== entries. Example: === Menu If you have specific suggestions to make this
97
+ gem more useful for others, please drop me an email at: shevegen@gmail.com Thank
98
+ you.'
92
99
  test_files: []
100
+ has_rdoc: