rubygems-update 0.8.11 → 0.9.0

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 (114) hide show
  1. data/ChangeLog +199 -1
  2. data/README +6 -4
  3. data/Rakefile +46 -14
  4. data/bin/gem +6 -0
  5. data/bin/gem_mirror +7 -1
  6. data/bin/gem_server +3 -5
  7. data/bin/gemlock +127 -0
  8. data/bin/gemri +24 -0
  9. data/bin/gemwhich +39 -11
  10. data/bin/index_gem_repository.rb +280 -0
  11. data/bin/update_rubygems +6 -0
  12. data/doc/makedoc.rb +7 -1
  13. data/examples/application/lib/somefunctionality.rb +6 -0
  14. data/lib/gemconfigure.rb +6 -0
  15. data/lib/rbconfig/datadir.rb +24 -0
  16. data/lib/rubygems.rb +90 -24
  17. data/lib/rubygems/builder.rb +6 -0
  18. data/lib/rubygems/cmd_manager.rb +36 -30
  19. data/lib/rubygems/command.rb +90 -29
  20. data/lib/rubygems/config_file.rb +45 -2
  21. data/lib/rubygems/custom_require.rb +12 -6
  22. data/lib/rubygems/dependency_list.rb +6 -0
  23. data/lib/rubygems/doc_manager.rb +79 -34
  24. data/lib/rubygems/format.rb +6 -0
  25. data/lib/rubygems/gem_commands.rb +209 -88
  26. data/lib/rubygems/gem_openssl.rb +12 -0
  27. data/lib/rubygems/gem_runner.rb +25 -10
  28. data/lib/rubygems/incremental_fetcher.rb +136 -0
  29. data/lib/rubygems/installer.rb +103 -28
  30. data/lib/rubygems/loadpath_manager.rb +6 -0
  31. data/lib/rubygems/old_format.rb +6 -0
  32. data/lib/rubygems/open-uri.rb +231 -79
  33. data/lib/rubygems/package.rb +5 -3
  34. data/lib/rubygems/remote_installer.rb +89 -52
  35. data/lib/rubygems/rubygems_version.rb +1 -1
  36. data/lib/rubygems/security.rb +6 -0
  37. data/lib/rubygems/source_index.rb +115 -52
  38. data/lib/rubygems/specification.rb +92 -76
  39. data/lib/rubygems/timer.rb +6 -0
  40. data/lib/rubygems/user_interaction.rb +88 -4
  41. data/lib/rubygems/validator.rb +6 -0
  42. data/lib/rubygems/version.rb +6 -0
  43. data/lib/ubygems.rb +6 -0
  44. data/post-install.rb +6 -0
  45. data/scripts/buildtests.rb +6 -0
  46. data/scripts/gemdoc.rb +6 -0
  47. data/scripts/runtest.rb +6 -0
  48. data/scripts/specdoc.rb +6 -0
  49. data/scripts/upload_gemdoc.rb +6 -0
  50. data/test/bogussources.rb +6 -2
  51. data/test/data/PostMessage-0.0.1.gem +0 -0
  52. data/test/data/a-0.0.1.gem +0 -0
  53. data/test/data/a-0.0.2.gem +0 -0
  54. data/test/data/b-0.0.2.gem +0 -0
  55. data/test/data/c-1.2.gem +0 -0
  56. data/test/data/gemhome/cache/a-0.0.1.gem +0 -0
  57. data/test/data/gemhome/cache/a-0.0.2.gem +0 -0
  58. data/test/data/gemhome/cache/b-0.0.2.gem +0 -0
  59. data/test/data/gemhome/cache/c-1.2.gem +0 -0
  60. data/test/data/gemhome/gems/a-0.0.1/lib/code.rb +6 -0
  61. data/test/data/gemhome/gems/a-0.0.2/lib/code.rb +6 -0
  62. data/test/data/gemhome/gems/b-0.0.2/lib/code.rb +6 -0
  63. data/test/data/gemhome/gems/c-1.2/lib/code.rb +6 -0
  64. data/test/data/gemhome/specifications/a-0.0.1.gemspec +1 -1
  65. data/test/data/gemhome/specifications/a-0.0.2.gemspec +1 -1
  66. data/test/data/gemhome/specifications/b-0.0.2.gemspec +1 -1
  67. data/test/data/gemhome/specifications/c-1.2.gemspec +1 -1
  68. data/test/data/lib/code.rb +6 -0
  69. data/test/data/one/lib/one.rb +6 -0
  70. data/test/data/one/one-0.0.1.gem +0 -0
  71. data/test/data/post_install.gemspec +19 -0
  72. data/test/fake_certlib/openssl.rb +6 -0
  73. data/test/functional.rb +15 -1
  74. data/test/functional_generate_yaml_index.rb +101 -0
  75. data/test/gemenvironment.rb +8 -0
  76. data/test/gemutilities.rb +18 -2
  77. data/test/insure_session.rb +6 -0
  78. data/test/mock/gems/gems/sources-0.0.1/lib/sources.rb +6 -0
  79. data/test/mockgemui.rb +6 -0
  80. data/test/onegem.rb +12 -0
  81. data/test/simple_gem.rb +6 -0
  82. data/test/test_builder.rb +6 -0
  83. data/test/test_cached_fetcher.rb +6 -0
  84. data/test/test_check_command.rb +6 -0
  85. data/test/test_command.rb +6 -0
  86. data/test/test_configfile.rb +6 -0
  87. data/test/test_datadir.rb +32 -0
  88. data/test/test_dependency_list.rb +6 -0
  89. data/test/test_file_list.rb +6 -0
  90. data/test/test_format.rb +6 -0
  91. data/test/test_gemloadpaths.rb +6 -0
  92. data/test/test_gempaths.rb +11 -1
  93. data/test/test_incremental_fetcher.rb +175 -0
  94. data/test/test_installer.rb +30 -3
  95. data/test/test_loadmanager.rb +6 -0
  96. data/test/test_local_cache.rb +8 -2
  97. data/test/test_package.rb +6 -0
  98. data/test/test_parse_commands.rb +8 -2
  99. data/test/test_process_commands.rb +31 -0
  100. data/test/test_remote_fetcher.rb +47 -5
  101. data/test/test_remote_installer.rb +6 -0
  102. data/test/test_require_gem.rb +6 -0
  103. data/test/test_source_index.rb +27 -0
  104. data/test/test_specific_extras.rb +6 -0
  105. data/test/test_specification.rb +30 -0
  106. data/test/test_validator.rb +6 -0
  107. data/test/test_version_comparison.rb +6 -0
  108. data/test/testgem.rc +1 -0
  109. data/test/user_capture.rb +6 -0
  110. data/test/yaml_data.rb +8 -4
  111. metadata +187 -173
  112. data/bin/generate_yaml_index.rb +0 -78
  113. data/lib/rubygems/deployment.rb +0 -267
  114. data/test/test_deployment.rb +0 -93
data/ChangeLog CHANGED
@@ -1,3 +1,201 @@
1
+ 2006-06-14 Jim Weirich <jim@weirichhouse.org>
2
+
3
+ * Rakefile (announce): Added 1.9 hack for ENV['CERT_DIR']. Remove
4
+ this in the future if 1.9 behavior changes.
5
+
6
+ 2006-06-13 Jim Weirich <jim@weirichhouse.org>
7
+
8
+ * Rakefile: ENV['CERT_DIR'] is now '' rather than nil.
9
+
10
+ * lib/rubygems/specification.rb (Gem::Specification::initialize):
11
+ Eric added some 1.9 compatibility code (funcall vs send).
12
+
13
+ * lib/rubygems/package.rb (TarOutput::self): Eric added some 1.9
14
+ compatibility code (funcall vs send).
15
+
16
+ * experimental/deployment.rb (Gem::Deployment): Moved the
17
+ deployment code out of the live code base into the experimental
18
+ directory. The code wasn't used and the tests were not all
19
+ passing.
20
+
21
+ 2006-06-11 Jim Weirich <jim@weirichhouse.org>
22
+
23
+ * bin/gemri: Added gemri to bin directory.
24
+
25
+ * lib/rubygems/custom_require.rb (Gem::GemPathSearcher::find):
26
+ Added .rbw to suffix pattern in custom_require.
27
+
28
+ 2006-06-07 Jim Weirich <jim@weirichhouse.org>
29
+
30
+ * lib/rubygems.rb: Added copyright notices to all Ruby files.
31
+
32
+ 2006-04-07 Jim Weirich <jim@weirichhouse.org>
33
+
34
+ * lib/rubygems/gem_commands.rb (Gem::RDocCommand::execute): Added
35
+ RI option to the rdoc subcommand.
36
+
37
+ 2006-04-05 Jim Weirich <jim@weirichhouse.org>
38
+
39
+ * test/test_parse_commands.rb
40
+ (TestParseCommands::test_parsing_update_options): Fixed unit tests
41
+ to assert that the install dir is expanded.
42
+
43
+ * lib/rubygems/doc_manager.rb (Gem::DocManager::generate_ri):
44
+ Break out from generate_rdoc to support installing all RI docs
45
+ first.
46
+
47
+ * lib/rubygems/gem_commands.rb
48
+ (Gem::InstallUpdateOptions::add_install_update_options): Expanded
49
+ repository directory to absolute path.
50
+ (Gem::InstallCommand::execute): Make sure that *all* of the RI
51
+ documents are generated before generating any RDocs (due to a bug
52
+ in the RDoc library).
53
+
54
+ * lib/rubygems/installer.rb (Gem::ExtExtConfBuilder::self): Fixed
55
+ typo in ExtExtConfBuilder that prevented C based gems to install.
56
+ (Gem::ExtExtConfBuilder::self): Installed patch to prevent the
57
+ overriding of target_prefix in native extensions (thanks to Aaron
58
+ Patterson for the patch).
59
+
60
+ 2006-04-04 Jim Weirich <jim@weirichhouse.org>
61
+
62
+ * lib/rubygems/rubygems_version.rb (Gem): Bumped to version
63
+ 0.8.11.10.
64
+
65
+ * lib/rubygems/incremental_fetcher.rb
66
+ (Gem::IncrementalFetcher::update_cache): Now falls back to bulk
67
+ updates if the number of gems if over 50.
68
+
69
+ * lib/rubygems/remote_installer.rb
70
+ (Gem::RemoteSourceFetcher::source_index): Added "bulk" to the
71
+ update message to differentiate it from the incremental message.
72
+
73
+ * lib/rubygems/specification.rb
74
+ (Gem::Specification::Specification): Modified to add dashes to
75
+ gemspecs generated under Ruby 1.8.3. This makes it easier to run
76
+ RubyGems on a 1.8.2 system.
77
+
78
+ 2006-04-01 Jim Weirich <jim@weirichhouse.org>
79
+
80
+ * lib/rubygems/doc_manager.rb (Gem::DocManager::run_rdoc): Changed
81
+ exception handler to print error message if document generation
82
+ fails, but then to continue with the rest of the installation.
83
+ Permission errors still terminate the install because if one
84
+ install fails because of permission problems, chances are that all
85
+ will fail.
86
+ (Gem::DocManager::install_ri): Removed wrapping of exceptions with
87
+ DocumentError. Most exceptions now don't propagate out of
88
+ run_rdoc.
89
+ (Gem::DocManager::install_rdoc): Removed wrapping of exceptions
90
+ with DocumentError. Most exceptions now don't propagate out of
91
+ run_rdoc.
92
+
93
+ 2006-02-23 Jim Weirich <jim@weirichhouse.org>
94
+
95
+ * bin/index_gem_repository.rb (MasterIndexBuilder::cleanup): Fixed
96
+ bug where we were trying to read the index file (to compress it)
97
+ before it was closed, often leading to a truncated index file.
98
+
99
+ Tue Jan 24 16:26:13 2006 Chad Fowler <chad@chadfowler.com>
100
+ * lib/rubygems/config_file.rb
101
+ Luca Pireddu reported a fatal error when permissions on
102
+ .gemrc were too restrictive. Fixed.
103
+
104
+ Tue Dec 6 14:51:13 2005 Jim Weirich <jim@tardis>
105
+
106
+ * lib/rubygems/source_index.rb
107
+ (Gem::SourceIndex::load_specification): Added an untaint call to
108
+ make the code run in SAFE=1 mode under 1.8.3.
109
+ (Gem::SourceIndex::load_gems_in): Untaint here too.
110
+
111
+ * lib/rubygems/installer.rb (Gem::Installer::install): Untaint
112
+ here too.
113
+ (Gem::Installer::extract_files): Untaint here too.
114
+
115
+ * lib/rubygems/custom_require.rb
116
+ (Gem::GemPathSearcher::matching_file): Untaint here too.
117
+
118
+ * test/gemenvironment.rb: Added $SAFE=1 to the test environment to
119
+ make sure we can run in $SAFE mode.
120
+
121
+ 2005-12-03 Jim Weirich <jim@tardis>
122
+
123
+ * lib/rubygems/rubygems_version.rb (Gem): Bumped version to
124
+ 0.8.11.6'
125
+
126
+ * lib/rubygems/user_interaction.rb
127
+ (Gem::StreamUI::SimpleProgressReporter::done): Added several new
128
+ progress reporters.
129
+
130
+ * lib/rubygems/command.rb
131
+ (Gem::Command::specific_extra_args_hash): Added --verbose
132
+ processing.
133
+
134
+ * lib/rubygems/config_file.rb (Gem::ConfigFile::handle_arguments):
135
+ Added --traceback as alias for --backtrace (I always get them
136
+ confused).
137
+ (Gem::ConfigFile::initialize): Added a verbose option.
138
+
139
+ 2005-11-28 Jim Weirich <jim@tardis>
140
+
141
+ * lib/rubygems/remote_installer.rb
142
+ (Gem::SourceInfoCacheEntry::replace_source_index): Fixed the
143
+ SourceIndexCacheEntry so that it will manufacture an empty source
144
+ index if given a nil value for the +si+ value.
145
+
146
+ 2005-11-08 Chad Fowler <chad@chadfowler.com>
147
+ * lib/rubygems.rb: Ara Howard's fix to allow 0.0.0 to be a valid gem
148
+ version.
149
+
150
+ 2005-11-08 Chad Fowler <chad@chadfowler.com>
151
+ * lib/rubygems/gem_commands.rb: Fixed bug in gem unpack. It was
152
+ sorting incorrectly, resulting in the wrong version being unpacked in
153
+ some edge cases. Thanks to Jakob Skjerning for the detailed bug report.
154
+
155
+ 2005-11-03 Chad Fowler <chad@chadfowler.com>
156
+ * lib/rubygems/installer.rb: Fixed bug that would cause the executables
157
+ from the wrong gem to be uninstalled if the names matched the same
158
+ regex. Thanks Eric Hodel.
159
+
160
+ 2005-11-01 Jim Weirich <jim@tardis>
161
+ * lib/rubygems/gem_commands.rb (Gem::UpdateCommand::initialize):
162
+ Upgrade => Update change.
163
+ (Gem::UpdateCommand::execute): Upgrade => Update change.
164
+ (Gem::UpdateCommand::execute): Upgrade => Update change.
165
+
166
+ 2005-11-01 Chad Fowler <chad@chadfowler.com>
167
+ * lib/rubygems/gem_commands.rb: Allow gem unpack to accept a gem file
168
+ path instead of gem name: gem unpack mygem-1.0.0.gem.
169
+
170
+ 2005-10-31 Chad Fowler <chad@chadfowler.com>
171
+ * lib/rubygems/installer.rb: Tilman Sauerbeck's patch to support
172
+ extensions built with Rake!
173
+
174
+ 2005-09-13 Jim Weirich <jim@weirichhouse.org>
175
+
176
+ * lib/rubygems/package.rb (TarInput::initialize): Removed
177
+ requirement for SSL when signatures are found in a gem. Only
178
+ require SSL if the security policy requires checking the
179
+ signatures.
180
+
181
+ * lib/rubygems/custom_require.rb (Kernel::require): Disabled
182
+ autorequire during custom require.
183
+
184
+ 2005-09-07 Jim Weirich <jim@weirichhouse.org>
185
+
186
+ * lib/rubygems/gem_openssl.rb (Gem::ensure_ssl_available): Added a
187
+ test in gem_openssl to make sure the ruby portion of ssl is also
188
+ loaded.
189
+
190
+ 2005-08-31 Jim Weirich <jim@weirichhouse.org>
191
+
192
+ * Rakefile (install): Changed the rake install task to use setup.rb.
193
+
194
+ 2005-07-08 Chad Fowler <chad@chadfowler.com>
195
+
196
+ * lib/rubygems/remote_installer.rb: Applied Daniel Roux's patch
197
+ to make RubyGems work with authenticating proxies.
198
+
1
199
  2005-07-08 Jim Weirich <jim@weirichhouse.org>
2
200
 
3
201
  * Preparing for release 0.8.11.
@@ -68,7 +266,7 @@
68
266
 
69
267
  * lib/rubygems/gem_commands.rb
70
268
  (Gem::UpdateCommand::do_rubygems_update): Update --system now runs
71
- the ruby command directly rather than trying to load teh
269
+ the ruby command directly rather than trying to load the
72
270
  update-rubygems command. There were too many things to go wrong
73
271
  with the old way.
74
272
 
data/README CHANGED
@@ -15,14 +15,14 @@ For more details and other options, see:
15
15
  == For User Documentation, see
16
16
 
17
17
  * {RubyGems User Guide}[http://docs.rubygems.org/read/book/1]
18
+ * {Frequently Asked Questions}[http://docs.rubygems.org/read/book/3]
18
19
 
19
20
  == For developer docs see
20
21
 
21
- * {Create a Gem in Ten Minutes}[http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemInTenMinutes]
22
- * {Developers Guide}[http://rubygems.rubyforge.org/wiki/wiki.pl?DeveloperGuide]
23
- * {GEM Specification}[http://rubygems.rubyforge.org/wiki/wiki.pl?GemSpecification]
22
+ * {Creating Gems}[http://docs.rubygems.org/read/chapter/5]
23
+ * {GEM Specification}[http://docs.rubygems.org/read/chapter/20]
24
24
 
25
- == The home page of the RubyGems wiki
25
+ == The home page of the RubyGems Documentation
26
26
 
27
27
  * {RubyGems Home}[http://rubygems.rubyforge.org]
28
28
 
@@ -55,6 +55,8 @@ RubyGems was originally developed at RubyConf 2003 by:
55
55
  * Dave Glasser -- glasser(at)mit.edu
56
56
  * Paul Duncan -- pabs(at)pablotron.org
57
57
  * Ville Aine -- vaine(at)cs.helsinki.fi
58
+ * Ryan Davis --
59
+ * Eric Hodel -- drbrain(at)segment7.net
58
60
 
59
61
 
60
62
  (If your name is missing, PLEASE let us know!)
data/Rakefile CHANGED
@@ -1,5 +1,11 @@
1
1
  # Rakefile for RubyGems -*- ruby -*-
2
2
 
3
+ #--
4
+ # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
5
+ # All rights reserved.
6
+ # See LICENSE.txt for permissions.
7
+ #++
8
+
3
9
  require 'rubygems'
4
10
  require 'rake/clean'
5
11
  require 'rake/testtask'
@@ -11,6 +17,9 @@ def announce(msg='')
11
17
  STDERR.puts msg
12
18
  end
13
19
 
20
+ # Disable certs for now.
21
+ ENV.delete('CERT_DIR')
22
+
14
23
  PKG_NAME = 'rubygems'
15
24
  def package_version
16
25
  `ruby -Ilib bin/gem environment packageversion`.chomp
@@ -29,7 +38,7 @@ CLOBBER.include(
29
38
  "test/data/one/one-*0.0.1.gem",
30
39
  "test/temp",
31
40
  'test/data/gemhome',
32
- 'test/data/*.gem',
41
+ 'test/data/[a-z]*.gem',
33
42
  'scripts/*.hieraki',
34
43
  'data__',
35
44
  'html',
@@ -40,16 +49,17 @@ CLOBBER.include(
40
49
  )
41
50
 
42
51
  task :default => [:test]
52
+ task :test => [:test_units]
43
53
 
44
- Rake::TestTask.new(:test) do |t|
54
+ Rake::TestTask.new(:test_units) do |t|
45
55
  t.test_files = FileList['test/test*.rb']
46
56
  end
47
57
 
48
- Rake::TestTask.new(:functional) do |t|
58
+ Rake::TestTask.new(:test_functional) do |t|
49
59
  t.test_files = FileList['test/functional*.rb']
50
60
  end
51
61
 
52
- Rake::TestTask.new(:alltests) do |t|
62
+ Rake::TestTask.new(:test_all) do |t|
53
63
  t.test_files = FileList['test/{test,functional}*.rb']
54
64
  end
55
65
 
@@ -72,9 +82,9 @@ task :build_tests do
72
82
  end
73
83
 
74
84
  # Shortcuts for test targets
75
- task :tf => [:functional]
76
- task :tu => [:test]
77
- task :ta => [:alltests]
85
+ task :tf => [:test_functional]
86
+ task :tu => [:test_units]
87
+ task :ta => [:test_all]
78
88
 
79
89
  task :gemtest do
80
90
  ruby %{-Ilib -rscripts/runtest -e 'run_tests("test/test_gempaths.rb", true)'}
@@ -87,7 +97,7 @@ desc "Make a new release"
87
97
  task :release => [
88
98
  :prerelease,
89
99
  :clobber,
90
- :alltests,
100
+ :test_all,
91
101
  :update_version,
92
102
  :package,
93
103
  :tag] do
@@ -149,7 +159,7 @@ task :update_version => [:prerelease] do
149
159
  if ENV['RELTEST']
150
160
  announce "Release Task Testing, skipping commiting of new version"
151
161
  else
152
- sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb}
162
+ sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rubygems/rubygems_version.rb} # "
153
163
  end
154
164
  end
155
165
  end
@@ -165,6 +175,26 @@ task :tag => [:prerelease] do
165
175
  end
166
176
  end
167
177
 
178
+ # --------------------------------------------------------------------
179
+
180
+ begin
181
+ require 'rcov/rcovtask'
182
+ HAVE_RCOV = true
183
+ rescue LoadError
184
+ HAVE_RCOV = false
185
+ end
186
+
187
+ if HAVE_RCOV
188
+ Rcov::RcovTask.new do |t|
189
+ t.libs << "test"
190
+ t.rcov_opts = ['-xRakefile', '-xrakefile', '-xpublish.rf', '--text-report']
191
+ t.test_files = FileList[
192
+ 'test/test*.rb'
193
+ ]
194
+ t.verbose = true
195
+ end
196
+ end
197
+
168
198
  # --------------------------------------------------------------------
169
199
  # Create a task to build the RDOC documentation tree.
170
200
 
@@ -173,13 +203,11 @@ rd = Rake::RDocTask.new("rdoc") { |rdoc|
173
203
  rdoc.rdoc_dir = 'html'
174
204
  rdoc.title = "RubyGems"
175
205
  rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
176
- rdoc.rdoc_files.include('README', 'TODO', 'Releases')
206
+ rdoc.rdoc_files.include('README', 'TODO', 'Releases', 'LICENSE.txt', 'GPL.txt')
177
207
  rdoc.rdoc_files.include('lib/**/*.rb')
178
208
  # rdoc.rdoc_files.include('test/**/*.rb')
179
209
  }
180
210
 
181
- file "html/index.html" => [:rdoc]
182
-
183
211
  desc "Publish the RDOCs on RubyForge"
184
212
  task :publish_rdoc => ["html/index.html"] do
185
213
  # NOTE: This task assumes that you have an SSH alias setup for rubyforge.
@@ -250,7 +278,7 @@ installation of RubyGems before this update can be applied.
250
278
  }
251
279
  s.files = PKG_FILES.to_a
252
280
  s.require_path = 'lib'
253
- s.author = "RubyGems Team"
281
+ s.authors = ['Jim Weirich', 'Chad Fowler']
254
282
  s.email = "rubygems-developers@rubyforge.org"
255
283
  s.homepage = "http://rubygems.rubyforge.org"
256
284
  s.rubyforge_project = "rubygems"
@@ -280,7 +308,9 @@ end
280
308
 
281
309
  desc "Install RubyGems"
282
310
  task :install do
283
- ruby 'install.rb'
311
+ ruby 'setup.rb config'
312
+ ruby 'setup.rb setup'
313
+ ruby 'setup.rb install'
284
314
  end
285
315
 
286
316
  # Run 'gem' (using local bin and lib directories).
@@ -324,3 +354,5 @@ task :rubyfiles do
324
354
  puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
325
355
  puts Dir['bin/*'].reject { |fn| fn =~ /CVS|(~$)|(\.rb$)/ }
326
356
  end
357
+
358
+ task :rf => :rubyfiles
data/bin/gem CHANGED
@@ -1,4 +1,10 @@
1
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
+
2
8
 
3
9
  require 'rubygems'
4
10
  Gem.manage_gems
@@ -1,4 +1,10 @@
1
- #! /usr/bin/ruby
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
+
2
8
 
3
9
  # sample ~/.gemmirrorc:
4
10
  #---
@@ -122,7 +122,7 @@ h2,h3,h4 { margin-top: 1em; }
122
122
  a { background: #eef; color: #039; text-decoration: none; }
123
123
  a:hover { background: #039; color: #eef; }
124
124
 
125
- /* Override the base stylesheet's Anchor inside a table cell */
125
+ /* Override the base stylesheets Anchor inside a table cell */
126
126
  td > a {
127
127
  background: transparent;
128
128
  color: #039;
@@ -316,8 +316,6 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
316
316
  RDOCCSS
317
317
 
318
318
 
319
-
320
- ##
321
319
  # gem_server and gem_server.cgi are equivalent programs that allow
322
320
  # users to serve gems for consumption by `gem --remote-install`.
323
321
  #
@@ -355,7 +353,7 @@ if __FILE__ == $0
355
353
  fn = File.join(options[:gemdir] || Gem.dir, "specifications")
356
354
  res['content-type'] = 'text/plain'
357
355
  res['date'] = File.stat(fn).mtime
358
- res.body << Gem::SourceIndex.from_installed_gems(fn).to_yaml
356
+ res.body << Gem::SourceIndex.from_gems_in(fn).to_yaml
359
357
  }
360
358
 
361
359
  s.mount_proc("/rdoc-style.css") { |req, res|
@@ -369,7 +367,7 @@ if __FILE__ == $0
369
367
  specs = []
370
368
  specifications_dir = File.join(options[:gemdir] || Gem.dir, "specifications")
371
369
  total_file_count = 0
372
- Gem::SourceIndex.from_installed_gems(specifications_dir).each do |path, spec|
370
+ Gem::SourceIndex.from_gems_in(specifications_dir).each do |path, spec|
373
371
  total_file_count += spec.files.size
374
372
  deps = spec.dependencies.collect { |dep|
375
373
  {
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- ruby -*-
3
+ #--
4
+ # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
5
+ # All rights reserved.
6
+ # See LICENSE.txt for permissions.
7
+ #++
8
+
9
+
10
+ # gemlock -- Generate a lockdown list of a set of gems
11
+ #
12
+ # Usage: gemlock gem_name-version...
13
+ #
14
+ # gemlock will generate a list of require_gem statements that will
15
+ # lock down the versions for the gem given in the command line. It
16
+ # will specify exact versions in the requirements list to ensure that
17
+ # the gems loaded will always be consistent. A full recursive search
18
+ # of all effected gems will be generated.
19
+ #
20
+ # Example:
21
+ #
22
+ # gemlock rails-1.0.0 >lockdown.rb
23
+ #
24
+ # will produce in lockdown.rb:
25
+ #
26
+ # require "rubygems"
27
+ # gem 'rails', '= 1.0.0'
28
+ # gem 'rake', '= 0.7.0.1'
29
+ # gem 'activesupport', '= 1.2.5'
30
+ # gem 'activerecord', '= 1.13.2'
31
+ # gem 'actionpack', '= 1.11.2'
32
+ # gem 'actionmailer', '= 1.1.5'
33
+ # gem 'actionwebservice', '= 1.0.0'
34
+ #
35
+ # Just load lockdown.rb from your application to ensure that the
36
+ # current versions are loaded. Make sure that lockdown.rb is loaded
37
+ # *before* any other require statements.
38
+ #
39
+ # Notice that rails 1.0.0 only requires that rake 0.6.2 or better be
40
+ # used. Rake-0.7.0.1 is the most recent version installed that
41
+ # satisfies that, so we lock it down to the exact version.
42
+
43
+ require 'rubygems'
44
+ require 'ostruct'
45
+ require 'optparse'
46
+ require 'yaml'
47
+
48
+ Gem.manage_gems
49
+
50
+ def handle_options(args)
51
+ options = OpenStruct.new
52
+ options.verbose = false
53
+ options.strict = false
54
+ opts = OptionParser.new do |opts|
55
+ opts.banner = "Usage: #$0 [options] GEM_NAME-VERSION..."
56
+ opts.separator ""
57
+ opts.separator "Where options are:"
58
+
59
+ opts.on('--verbose', '-v', 'Verbose output') do |value|
60
+ options.verbose = value
61
+ end
62
+
63
+ opts.on('--[no-]strict', '-s',
64
+ 'Fail if unable to satisfy a dependency') do |value|
65
+ options.strict = value
66
+ end
67
+
68
+ opts.on_tail('--help', '-h', 'Show this message') do
69
+ puts opts
70
+ exit
71
+ end
72
+
73
+ opts.on_tail('--version', '-V', 'Show version') do
74
+ puts "gemlock (#{Gem::RubyGemsVersion})"
75
+ exit
76
+ end
77
+ end
78
+ options.usage = opts
79
+
80
+ opts.parse!(args)
81
+ options
82
+ end
83
+
84
+ def spec_path(gem_full_name)
85
+ File.join(Gem.path, "specifications", gem_full_name + ".gemspec")
86
+ end
87
+
88
+ def complain(message, options)
89
+ if options.strict
90
+ fail message
91
+ else
92
+ puts "# #{message}"
93
+ end
94
+ end
95
+
96
+ def lock_down(pending, options)
97
+ puts 'require "rubygems"'
98
+ locked = {}
99
+ while ! pending.empty?
100
+ full_name = pending.shift
101
+ spec = Gem::SourceIndex.load_specification(spec_path(full_name))
102
+ puts "gem '#{spec.name}', '= #{spec.version}'" unless locked[spec.name]
103
+ locked[spec.name] = true
104
+ spec.dependencies.each do |dep|
105
+ next if locked[dep.name]
106
+ candidates = Gem.source_index.search(dep.name, dep.requirement_list)
107
+ if candidates.empty?
108
+ complain(
109
+ "Unable to satisfy '#{dep}' from currently installed gems.",
110
+ options)
111
+ else
112
+ pending << candidates.last.full_name
113
+ end
114
+ end
115
+ end
116
+ end
117
+
118
+ if __FILE__ == $0 then
119
+ options = handle_options(ARGV)
120
+ if ARGV.empty?
121
+ puts options.usage
122
+ exit(1)
123
+ else
124
+ lock_down(ARGV, options)
125
+ end
126
+ end
127
+