rubygems-update 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (128) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +24 -0
  3. data/.document +4 -3
  4. data/ChangeLog +382 -1
  5. data/Manifest.txt +214 -0
  6. data/README +1 -49
  7. data/Rakefile +124 -191
  8. data/bin/gem +1 -4
  9. data/cruise_config.rb +22 -0
  10. data/doc/release_notes/rel_1_3_1.rdoc +3 -3
  11. data/doc/release_notes/rel_1_3_2.rdoc +119 -0
  12. data/lib/gauntlet_rubygems.rb +50 -0
  13. data/lib/rubygems.rb +250 -25
  14. data/lib/rubygems/builder.rb +62 -60
  15. data/lib/rubygems/command.rb +421 -319
  16. data/lib/rubygems/command_manager.rb +153 -125
  17. data/lib/rubygems/commands/check_command.rb +12 -7
  18. data/lib/rubygems/commands/cleanup_command.rb +11 -2
  19. data/lib/rubygems/commands/contents_command.rb +42 -18
  20. data/lib/rubygems/commands/generate_index_command.rb +91 -15
  21. data/lib/rubygems/commands/install_command.rb +33 -47
  22. data/lib/rubygems/commands/query_command.rb +36 -20
  23. data/lib/rubygems/commands/rdoc_command.rb +62 -68
  24. data/lib/rubygems/commands/search_command.rb +26 -32
  25. data/lib/rubygems/commands/setup_command.rb +353 -0
  26. data/lib/rubygems/commands/sources_command.rb +5 -0
  27. data/lib/rubygems/commands/specification_command.rb +23 -3
  28. data/lib/rubygems/commands/uninstall_command.rb +71 -61
  29. data/lib/rubygems/commands/unpack_command.rb +14 -12
  30. data/lib/rubygems/commands/update_command.rb +26 -5
  31. data/lib/rubygems/defaults.rb +16 -3
  32. data/lib/rubygems/dependency.rb +38 -7
  33. data/lib/rubygems/dependency_installer.rb +7 -4
  34. data/lib/rubygems/digest/digest_adapter.rb +42 -33
  35. data/lib/rubygems/digest/sha1.rb +6 -1
  36. data/lib/rubygems/digest/sha2.rb +5 -0
  37. data/lib/rubygems/doc_manager.rb +31 -11
  38. data/lib/rubygems/ext/ext_conf_builder.rb +2 -1
  39. data/lib/rubygems/ext/rake_builder.rb +6 -2
  40. data/lib/rubygems/format.rb +63 -63
  41. data/lib/rubygems/gem_openssl.rb +14 -2
  42. data/lib/rubygems/gem_path_searcher.rb +7 -3
  43. data/lib/rubygems/gem_runner.rb +59 -39
  44. data/lib/rubygems/indexer.rb +450 -109
  45. data/lib/rubygems/install_update_options.rb +13 -1
  46. data/lib/rubygems/installer.rb +25 -22
  47. data/lib/rubygems/local_remote_options.rb +5 -3
  48. data/lib/rubygems/old_format.rb +124 -120
  49. data/lib/rubygems/package/tar_header.rb +25 -3
  50. data/lib/rubygems/package/tar_input.rb +5 -5
  51. data/lib/rubygems/package/tar_output.rb +2 -0
  52. data/lib/rubygems/package/tar_reader.rb +19 -0
  53. data/lib/rubygems/package/tar_reader/entry.rb +43 -0
  54. data/lib/rubygems/package/tar_writer.rb +65 -3
  55. data/lib/rubygems/package_task.rb +117 -0
  56. data/lib/rubygems/platform.rb +12 -8
  57. data/lib/rubygems/remote_fetcher.rb +43 -24
  58. data/lib/rubygems/require_paths_builder.rb +14 -12
  59. data/lib/rubygems/requirement.rb +15 -6
  60. data/lib/rubygems/rubygems_version.rb +14 -1
  61. data/lib/rubygems/source_index.rb +38 -16
  62. data/lib/rubygems/source_info_cache_entry.rb +2 -2
  63. data/lib/rubygems/spec_fetcher.rb +43 -20
  64. data/lib/rubygems/specification.rb +1122 -947
  65. data/lib/rubygems/text.rb +30 -0
  66. data/lib/rubygems/timer.rb +14 -11
  67. data/lib/rubygems/uninstaller.rb +25 -5
  68. data/lib/rubygems/user_interaction.rb +294 -264
  69. data/lib/rubygems/validator.rb +70 -36
  70. data/lib/rubygems/version.rb +97 -33
  71. data/lib/rubygems/version_option.rb +1 -0
  72. data/setup.rb +11 -306
  73. data/test/foo/discover.rb +0 -0
  74. data/test/gem_installer_test_case.rb +22 -11
  75. data/test/gem_package_tar_test_case.rb +0 -14
  76. data/test/gemutilities.rb +89 -8
  77. data/test/mockgemui.rb +2 -1
  78. data/test/rubygems_plugin.rb +16 -0
  79. data/test/test_gem.rb +107 -36
  80. data/test/test_gem_command.rb +3 -13
  81. data/test/test_gem_command_manager.rb +1 -14
  82. data/test/test_gem_commands_cert_command.rb +1 -1
  83. data/test/test_gem_commands_contents_command.rb +63 -0
  84. data/test/test_gem_commands_environment_command.rb +1 -1
  85. data/test/test_gem_commands_generate_index_command.rb +104 -1
  86. data/test/test_gem_commands_install_command.rb +95 -0
  87. data/test/test_gem_commands_pristine_command.rb +3 -3
  88. data/test/test_gem_commands_query_command.rb +46 -0
  89. data/test/test_gem_commands_sources_command.rb +9 -5
  90. data/test/test_gem_commands_specification_command.rb +31 -0
  91. data/test/test_gem_commands_uninstall_command.rb +3 -2
  92. data/test/test_gem_commands_unpack_command.rb +3 -2
  93. data/test/test_gem_commands_update_command.rb +12 -7
  94. data/test/test_gem_dependency.rb +62 -11
  95. data/test/test_gem_dependency_installer.rb +18 -5
  96. data/test/test_gem_dependency_list.rb +6 -6
  97. data/test/test_gem_doc_manager.rb +7 -1
  98. data/test/test_gem_ext_configure_builder.rb +8 -10
  99. data/test/test_gem_ext_ext_conf_builder.rb +14 -8
  100. data/test/test_gem_gem_path_searcher.rb +1 -1
  101. data/test/test_gem_gem_runner.rb +11 -0
  102. data/test/test_gem_indexer.rb +398 -21
  103. data/test/test_gem_install_update_options.rb +20 -6
  104. data/test/test_gem_installer.rb +22 -14
  105. data/test/test_gem_local_remote_options.rb +2 -1
  106. data/test/test_gem_package_tar_header.rb +3 -3
  107. data/test/test_gem_package_tar_input.rb +3 -3
  108. data/test/test_gem_package_tar_output.rb +2 -2
  109. data/test/test_gem_package_task.rb +70 -0
  110. data/test/test_gem_platform.rb +12 -6
  111. data/test/test_gem_remote_fetcher.rb +23 -1
  112. data/test/test_gem_source_index.rb +32 -21
  113. data/test/test_gem_spec_fetcher.rb +77 -5
  114. data/test/test_gem_specification.rb +274 -1
  115. data/test/test_gem_uninstaller.rb +34 -4
  116. data/test/test_gem_version.rb +94 -4
  117. data/test/test_gem_version_option.rb +13 -0
  118. data/test/test_kernel.rb +4 -4
  119. data/util/CL2notes +56 -0
  120. data/util/gem_prelude.rb.template +251 -0
  121. metadata +30 -20
  122. metadata.gz.sig +3 -4
  123. data/TODO +0 -1
  124. data/scripts/buildtests.rb +0 -31
  125. data/scripts/gemdoc.rb +0 -67
  126. data/scripts/runtest.rb +0 -40
  127. data/scripts/specdoc.rb +0 -171
  128. data/scripts/upload_gemdoc.rb +0 -140
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -32,11 +32,16 @@ cert_chain:
32
32
  x52qPcexcYZR7w==
33
33
  -----END CERTIFICATE-----
34
34
 
35
- date: 2008-10-25 00:00:00 -07:00
35
+ date: 2009-04-15 00:00:00 -07:00
36
36
  default_executable:
37
37
  dependencies: []
38
38
 
39
- description: RubyGems is a package management framework for Ruby. This Gem is a update for the base RubyGems software. You must have a base installation of RubyGems before this update can be applied.
39
+ description: |
40
+ RubyGems is a package management framework for Ruby.
41
+
42
+ This gem is an update for the RubyGems software. You must have an
43
+ installation of RubyGems before this update can be applied.
44
+
40
45
  email: rubygems-developers@rubyforge.org
41
46
  executables:
42
47
  - update_rubygems
@@ -45,15 +50,17 @@ extensions: []
45
50
  extra_rdoc_files: []
46
51
 
47
52
  files:
53
+ - .autotest
48
54
  - .document
49
55
  - ChangeLog
50
56
  - GPL.txt
51
57
  - LICENSE.txt
58
+ - Manifest.txt
52
59
  - README
53
60
  - Rakefile
54
- - TODO
55
61
  - bin/gem
56
62
  - bin/update_rubygems
63
+ - cruise_config.rb
57
64
  - doc/release_notes/docs-rubygems-announce.rdoc
58
65
  - doc/release_notes/rel_0_2_0.rdoc
59
66
  - doc/release_notes/rel_0_3_0.rdoc
@@ -81,7 +88,10 @@ files:
81
88
  - doc/release_notes/rel_1_2_0.rdoc
82
89
  - doc/release_notes/rel_1_3_0.rdoc
83
90
  - doc/release_notes/rel_1_3_1.rdoc
91
+ - doc/release_notes/rel_1_3_2.rdoc
92
+ - lib/gauntlet_rubygems.rb
84
93
  - lib/rbconfig/datadir.rb
94
+ - lib/rubygems.rb
85
95
  - lib/rubygems/builder.rb
86
96
  - lib/rubygems/command.rb
87
97
  - lib/rubygems/command_manager.rb
@@ -105,6 +115,7 @@ files:
105
115
  - lib/rubygems/commands/rdoc_command.rb
106
116
  - lib/rubygems/commands/search_command.rb
107
117
  - lib/rubygems/commands/server_command.rb
118
+ - lib/rubygems/commands/setup_command.rb
108
119
  - lib/rubygems/commands/sources_command.rb
109
120
  - lib/rubygems/commands/specification_command.rb
110
121
  - lib/rubygems/commands/stale_command.rb
@@ -124,11 +135,11 @@ files:
124
135
  - lib/rubygems/digest/sha2.rb
125
136
  - lib/rubygems/doc_manager.rb
126
137
  - lib/rubygems/exceptions.rb
138
+ - lib/rubygems/ext.rb
127
139
  - lib/rubygems/ext/builder.rb
128
140
  - lib/rubygems/ext/configure_builder.rb
129
141
  - lib/rubygems/ext/ext_conf_builder.rb
130
142
  - lib/rubygems/ext/rake_builder.rb
131
- - lib/rubygems/ext.rb
132
143
  - lib/rubygems/format.rb
133
144
  - lib/rubygems/gem_openssl.rb
134
145
  - lib/rubygems/gem_path_searcher.rb
@@ -138,14 +149,15 @@ files:
138
149
  - lib/rubygems/installer.rb
139
150
  - lib/rubygems/local_remote_options.rb
140
151
  - lib/rubygems/old_format.rb
152
+ - lib/rubygems/package.rb
141
153
  - lib/rubygems/package/f_sync_dir.rb
142
154
  - lib/rubygems/package/tar_header.rb
143
155
  - lib/rubygems/package/tar_input.rb
144
156
  - lib/rubygems/package/tar_output.rb
145
- - lib/rubygems/package/tar_reader/entry.rb
146
157
  - lib/rubygems/package/tar_reader.rb
158
+ - lib/rubygems/package/tar_reader/entry.rb
147
159
  - lib/rubygems/package/tar_writer.rb
148
- - lib/rubygems/package.rb
160
+ - lib/rubygems/package_task.rb
149
161
  - lib/rubygems/platform.rb
150
162
  - lib/rubygems/remote_fetcher.rb
151
163
  - lib/rubygems/require_paths_builder.rb
@@ -159,30 +171,22 @@ files:
159
171
  - lib/rubygems/spec_fetcher.rb
160
172
  - lib/rubygems/specification.rb
161
173
  - lib/rubygems/test_utilities.rb
174
+ - lib/rubygems/text.rb
162
175
  - lib/rubygems/timer.rb
163
176
  - lib/rubygems/uninstaller.rb
164
177
  - lib/rubygems/user_interaction.rb
165
178
  - lib/rubygems/validator.rb
166
179
  - lib/rubygems/version.rb
167
180
  - lib/rubygems/version_option.rb
168
- - lib/rubygems.rb
169
181
  - lib/ubygems.rb
170
- - pkgs/sources
171
- - pkgs/sources/lib
172
182
  - pkgs/sources/lib/sources.rb
173
183
  - pkgs/sources/sources.gemspec
174
- - scripts/buildtests.rb
175
- - scripts/gemdoc.rb
176
- - scripts/runtest.rb
177
- - scripts/specdoc.rb
178
- - scripts/upload_gemdoc.rb
179
184
  - setup.rb
180
185
  - test/bogussources.rb
181
- - test/data
182
186
  - test/data/gem-private_key.pem
183
187
  - test/data/gem-public_cert.pem
184
- - test/fake_certlib
185
188
  - test/fake_certlib/openssl.rb
189
+ - test/foo/discover.rb
186
190
  - test/functional.rb
187
191
  - test/gem_installer_test_case.rb
188
192
  - test/gem_package_tar_test_case.rb
@@ -191,6 +195,7 @@ files:
191
195
  - test/mockgemui.rb
192
196
  - test/private_key.pem
193
197
  - test/public_cert.pem
198
+ - test/rubygems_plugin.rb
194
199
  - test/simple_gem.rb
195
200
  - test/test_config.rb
196
201
  - test/test_gem.rb
@@ -241,6 +246,7 @@ files:
241
246
  - test/test_gem_package_tar_reader.rb
242
247
  - test/test_gem_package_tar_reader_entry.rb
243
248
  - test/test_gem_package_tar_writer.rb
249
+ - test/test_gem_package_task.rb
244
250
  - test/test_gem_platform.rb
245
251
  - test/test_gem_remote_fetcher.rb
246
252
  - test/test_gem_requirement.rb
@@ -256,8 +262,12 @@ files:
256
262
  - test/test_gem_version.rb
257
263
  - test/test_gem_version_option.rb
258
264
  - test/test_kernel.rb
265
+ - util/CL2notes
266
+ - util/gem_prelude.rb.template
259
267
  has_rdoc: false
260
268
  homepage: http://rubygems.rubyforge.org
269
+ licenses: []
270
+
261
271
  post_install_message:
262
272
  rdoc_options: []
263
273
 
@@ -278,9 +288,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
288
  requirements: []
279
289
 
280
290
  rubyforge_project: rubygems
281
- rubygems_version: 1.3.0
291
+ rubygems_version: 1.3.1.2162
282
292
  signing_key:
283
- specification_version: 2
284
- summary: RubyGems Update GEM
293
+ specification_version: 3
294
+ summary: RubyGems update gem
285
295
  test_files: []
286
296
 
metadata.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- |��Ht��{�����8�;�����m�*eD����*�j-���y&N����ޡ;���M{ P����� O�
2
- ����xp
3
- �^��� �$�ZwjV��OV��'�+����%{Ha.k����m��ǒ���R���q����-~<�n����<z{���Fqpt��
4
- +f���_�u�qE�i}�5^�K�i�~�k�z�c���*�� ���i��o��͵-�PG�὚�w�"��I�.�n�Y
1
+ >9Ĝ��yX�I�!l8͝"��,�/Jץ)���i���d�����S�K2�
2
+ ���R��-��`�{��nW�k���7чӘ�؜Ӹ�g�} �WKC
3
+ ���j���1$�����>�UF�/��<�^�/RNJL�9��2�^����}�r�/L�2�Ň-��/��fɾ�d�cw#�P��b��qz ��K�/LA����rj�c�]�>�k���<9��x���_Y=��<�Y�-ce 8|p��D3
data/TODO DELETED
@@ -1 +0,0 @@
1
- * optional dependencies: "semitar can use REXML, but it works better if you have the ruby raptor library installed", or not so optional as in: "you need Ruby/RSS > = 1.0 OR rss > 0.91 for this library to work"
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #--
3
- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
4
- # All rights reserved.
5
- # See LICENSE.txt for permissions.
6
- #++
7
-
8
-
9
- require 'fileutils'
10
- require 'rubygems'
11
- require 'test/unit/testsuite'
12
- require 'test/unit/ui/reporter/reporter'
13
- require 'test/unit/ui/console/testrunner'
14
-
15
- fail "Missing Test Results Directory" if ARGV.empty?
16
- html_dir = ARGV.shift
17
-
18
- FileUtils.rm_r html_dir rescue nil
19
- FileUtils.mkdir_p html_dir
20
-
21
- Dir['test/test*.rb'].each do |fn|
22
- load fn
23
- end
24
-
25
- suite = Test::Unit::TestSuite.new
26
- ObjectSpace.each_object(Class) do |cls|
27
- next if cls == Test::Unit::TestCase
28
- suite << cls.suite if cls.respond_to?(:suite)
29
- end
30
-
31
- Test::Unit::UI::Reporter::Reporter.run(suite, html_dir)
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #--
3
- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
4
- # All rights reserved.
5
- # See LICENSE.txt for permissions.
6
- #++
7
-
8
-
9
- require 'rubygems'
10
- require 'rubygems/user_interaction'
11
-
12
- include Gem::DefaultUserInteraction
13
-
14
- $gm = Gem::CommandManager.instance
15
-
16
- class CaptureSay
17
- attr_reader :string
18
- def initialize
19
- @string = ''
20
- end
21
- def say(msg)
22
- @string << msg << "\n"
23
- end
24
- end
25
-
26
- def pre(cmd, opts)
27
- puts "<pre>"
28
- cmd.invoke opts
29
- puts "</pre>"
30
- end
31
-
32
- def table_of_contents
33
- cs = CaptureSay.new
34
- use_ui(cs) do
35
- $gm['help'].invoke 'commands'
36
- end
37
- # We're only interested in the lines that actually describe a command.
38
- out = cs.string.grep(/^\s+(\w+)\s+(.*)$/).join("\n")
39
- # Add a link to the relevant section in the margin.
40
- out.gsub(/^\s+(\w+)/) {
41
- cmd_name = $1
42
- " [http://rubygems.rubyforge.org/wiki/wiki.pl?GemReference##{cmd_name} -] #{cmd_name}"
43
- }
44
- end
45
-
46
- while line = gets
47
- if line =~ /^!/
48
- cmd, arg = line.split
49
- case cmd
50
- when "!usage"
51
- begin
52
- cmdobj = $gm[arg]
53
- pre(cmdobj, "--help")
54
- rescue NoMethodError
55
- puts "Usage of command #{arg} failed"
56
- end
57
- when "!toc"
58
- puts table_of_contents()
59
- when "!toc-link"
60
- puts "\"Table of Contents\":http://docs.rubygems.org/read/chapter/10#toc"
61
- when "!version"
62
- puts Gem::RubyGemsPackageVersion
63
- end
64
- else
65
- puts line
66
- end
67
- end
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #--
3
- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
4
- # All rights reserved.
5
- # See LICENSE.txt for permissions.
6
- #++
7
-
8
-
9
- require 'test/unit'
10
- require 'pp'
11
-
12
- def run_tests(pattern='test/test*.rb', log_enabled=false)
13
- Dir["#{pattern}"].each { |fn|
14
- puts fn if log_enabled
15
- begin
16
- load fn
17
- rescue Exception => ex
18
- puts "Error in #{fn}: #{ex.message}"
19
- puts ex.backtrace
20
- assert false
21
- end
22
- }
23
- end
24
-
25
- # You can run the unit tests by running this file directly, providing a pattern. For example,
26
- #
27
- # ruby scripts/runtests.rb spec
28
- #
29
- # will load just the "test/test_specification.rb" unit test (unless others match as well).
30
-
31
- if $0 == __FILE__
32
- $:.unshift 'lib' # Must run this from the root directory.
33
- pattern = ARGV.shift
34
- if pattern
35
- pattern = "test/*#{pattern}*.rb"
36
- run_tests(pattern, true)
37
- else
38
- run_tests
39
- end
40
- end
@@ -1,171 +0,0 @@
1
- #--
2
- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
3
- # All rights reserved.
4
- # See LICENSE.txt for permissions.
5
- #++
6
-
7
- require 'yaml'
8
- require 'ostruct'
9
- require 'rubygems'
10
-
11
- SEPSTRING = ' .. '
12
-
13
- # Taken from 'extensions' RubyForge project.
14
- module Enumerable
15
- def partition_by
16
- result = {}
17
- self.each do |e|
18
- value = yield e
19
- (result[value] ||= []) << e
20
- end
21
- result
22
- end
23
- end
24
-
25
- # Returns a link to the given anchor on the page.
26
- def _link(attribute, text=nil)
27
- link = "##{attribute}"
28
- %{<a href="#{link}">#{text || attribute}</a>}
29
- end
30
-
31
- def _themed_toc_more_vspace
32
- SECTIONS.each do |s|
33
- puts "\n* *#{s['name']}*"
34
- puts s['attributes'].collect { |a|
35
- ": #{_link(a, '#')} #{a}"
36
- }
37
- end
38
- end
39
-
40
- def _themed_toc_less_vspace
41
- SECTIONS.each do |s|
42
- puts "\n* *#{s['name']}:* "
43
- puts s['attributes'].collect { |a| _link(a) }.join(SEPSTRING)
44
- end
45
- end
46
-
47
- def timestamp
48
- puts "p(((. <em>Last generated: #{Time.now.strftime '%Y-%m-%d %H:%M:%S %Z (%A)'}</em>"
49
- end
50
-
51
- # Prints a thematic table of contents, drawing from the structure in the YAML file.
52
- def themed_toc
53
- _themed_toc_less_vspace
54
- end
55
-
56
- # Prints an alphabetical table of contents in a fairly compact yet readable way, with all
57
- # Wiki formatting included.
58
- def alpha_toc
59
- attributes = SECTIONS.collect { |s| s['attributes'] }.flatten
60
- # -> ['author', 'autorequire', ...]
61
- attr_map = attributes.partition_by { |a| a[0,1] }
62
- # -> { 'a' => ['author', ...], 'b' => ... }
63
- attributes = attr_map.collect { |letter, attrs|
64
- [letter.upcase, attrs.sort]
65
- }.sort_by { |l, _| l }
66
- # -> [ ['A', ['author', ...], ...]
67
- attributes = attributes.collect { |letter, attrs|
68
- "* *#{letter}* " << attrs.collect { |a| _link(a) }.join(SEPSTRING)
69
- } # -> [ 'A author | autorequire', 'B bindir', ...]
70
- puts attributes.join("\n")
71
- end
72
-
73
- # Print the "important" table of contents, which consists of the attributes given as
74
- # arguments.
75
- def important_toc(*attributes)
76
- puts attributes.collect { |a| _link(a) }.join(SEPSTRING)
77
- end
78
-
79
- # Returns text like "Optional; default = 'bin'", with Wiki formatting.
80
- def _metadata(attribute)
81
- type = attribute.klass || "Unknown"
82
- required =
83
- case attribute.mandatory
84
- when nil, false
85
- '<em>Optional</em>'
86
- else
87
- '<em>Required</em>'
88
- end
89
- default_str =
90
- case attribute.default
91
- when nil then ''
92
- when 'nil' then 'nil'
93
- when '...' then '(see below)'
94
- else attribute.default.inspect
95
- end
96
- default_str = "; default = #{default_str}" unless default_str.empty?
97
- result = sprintf "<em>Type: %s; %s%s</em>", type, required, default_str
98
- # result.gsub(/ /, '&nbsp;')
99
- end
100
-
101
- # Turns 'L(section)' into a link to that section.
102
- def _resolve_links(text)
103
- text.gsub(/L\((\w+)\)/) { _link($1) }
104
- end
105
-
106
- # For each attribute ('extra_rdoc_files', 'bindir', etc.), prints a section containing:
107
- # * a heading
108
- # * a line describing the attribute's type, mandatoriness, and default
109
- # * the description, usage, and notes for that attribute
110
- # * a link to the table of contents
111
- def attribute_survey
112
- heading = proc { |str| %{\n\nh3. <a name="#{str}">#{str}</a>\n\n} }
113
- subheading = proc { |str| "\n\nh4. #{str}\n\n" }
114
- pre = proc { |str| "<pre>\n#{str}\n</pre>\n" }
115
- para = proc { |str| str.gsub(/\n/, "\n\n") }
116
- toclink = "\n<em>Goto #{_link('toc', 'Table of Contents')}</em>"
117
- ATTRIBUTES.sort_by { |a| a['name'] }.each do |a|
118
- a = OpenStruct.new(a)
119
- puts "\n----\n"
120
- puts heading[a.name]
121
- puts _metadata(a)
122
- puts subheading['Description']
123
- puts _resolve_links(a.description)
124
- puts subheading['Usage']
125
- puts pre[a.usage.strip.gsub(/^/, ' ')]
126
- if a.notes
127
- puts subheading['Notes']
128
- puts _resolve_links(para[a.notes.strip])
129
- end
130
- puts toclink
131
- end
132
- end
133
-
134
- # Checks to see that all the attributes are documented. Warn on STDERR of any
135
- # discrepencies.
136
- def _check_attribute_completeness
137
- documented_attributes = ATTRIBUTES.collect { |a| a['name'].to_s }
138
- # ^ The attributes documented in specdoc.yaml.
139
- coded_attributes = Gem::Specification.attribute_names.collect { |a| a.to_s }
140
- # ^ The attributes defined in specification.rb.
141
- missing = coded_attributes - documented_attributes
142
- unless missing.empty?
143
- STDERR.puts "Defined attributes that are not documented:"
144
- STDERR.puts ' ' + missing.join(', ')
145
- end
146
- missing = documented_attributes - coded_attributes
147
- unless missing.empty?
148
- STDERR.puts "Documented attributes that are not defined:"
149
- STDERR.puts ' ' + missing.join(', ')
150
- end
151
- end
152
-
153
- # # # M A I N # # #
154
-
155
- data = YAML.load(File.read('specdoc.yaml'))
156
- SECTIONS = data['SECTIONS']
157
- ATTRIBUTES = data['ATTRIBUTES'].reject { |a| a['name'] == '...' }
158
-
159
- _check_attribute_completeness
160
-
161
- IO.foreach('specdoc.data') do |line|
162
- case line
163
- when /^!(\S+)/
164
- # A line beginning with a ! is a command. We call the method of that name.
165
- cmd, *args = line[1..-1].split
166
- self.send(cmd, *args)
167
- else
168
- puts line.chomp
169
- end
170
- end
171
-