ANN: RubyGems 0.9.0 Release

> I did some more testing with more gems on different
> platforms. The conclusion is twofold: a) The problem
> occurred with RubyGems 0.8.11 as well (in combination with
> RubyScript2Exe 0.4.4) and b) it doesn't occur with all gems
> (e.g. sqlite-ruby is a problem, actionmailer isn't).

Perhaps sqlite-ruby is an old format gem? It seems to be the

It seems to be the /what/?... Where is part two?... This is
where I expected the most important part of the answer... ;]

> Which libraries are required conditionally by RubyGems?

I think zlib and yaml are the only others for making require
work. It is difficult to tell with just grep.

I used a different kind of grep, called regexp.rb. It doesn't
show the line on which a pattern occurs, but it only shows the
matching part of the line. It's listed below. I used this
regexp.rb to find all libraries that /could/ be required by
RubyGems, both conditionally and unconditionally, listed in
list1.

The second list, list2, are the libraries that are actually
required after doing a "require 'rubygems'".

The differences between these lists are conditionally required
files (indicated with "-") and indirectly required files
(indicated with "+").

I'm concerned about the "-" part... ;]

(The lists may not be complete.)

Suggestions? Ideas?

gegroet,
Erik V. - http://www.erikveen.dds.nl/

···

----------------------------------------------------------------

$ find /usr/local/lib/ruby/site_ruby/1.8/rubygems*/ -type f -exec cat
{} \; | ruby regexp.rb "\brequire[\(\s]*['\"]([^'\"]*)['\"]" | sort |
uniq > list1

$ ruby -rubygems -e 'puts $".sort.join("\n")' | sed 's/\.[^\.]*$//g' >
list2

$ diff -ur list[12]
--- list1 2006-07-05 11:13:14.086994100 +0200
+++ list2 2006-07-05 11:13:16.440354600 +0200
@@ -1,43 +1,19 @@
-digest/md5
+date/format
+digest
  digest/sha2
-fileutils
-find
  forwardable
-md5
-net/ftp
-net/http
-net/https
-openssl
-optparse
-pathname
+parsedate
+rational
  rbconfig
-rdoc/rdoc
+rbconfig/datadir
  rubygems
-rubygems/command
-rubygems/dependency_list
-rubygems/format
-rubygems/format.rb
-rubygems/gem_commands
+rubygems/custom_require
  rubygems/gem_openssl
-rubygems/incremental_fetcher
-rubygems/installer
-rubygems/old_format
-rubygems/open-uri
-rubygems/package
+rubygems/rubygems_version
  rubygems/security
  rubygems/source_index
  rubygems/specification
  rubygems/user_interaction
  rubygems/version
-socket
-sources
-stringio
-tempfile
-test/unit/ui/console/testrunner
  time
-timeout
-uri
-x
-yaml
-yaml/syck
-zlib
+ubygems

----------------------------------------------------------------

chars = '^\s\r\n\`\!\(\)\[\]\{\}\<\> \,\.\/\?\\\|\=\;\:\"'

chars11 = chars + "'"

chars21 = chars + "'"
chars22 = chars
chars23 = chars + "'"

chars31 = '\w\s\r\n'

string = ARGV.shift

regexp =
case string
when string.to_i.to_s then /(^\s*#{(["[^\\s]+"] *
string.to_i).join("\\s+")}\r*$)/
when "-word" then /([#{chars11}]+)/
when "-word2" then
/([#{chars21}]([#{chars22}]*[#{chars23}])?)/
when "-word3" then /([A-Za-z]+)/
when "-text" then /([#{chars31}]+)/
when "-file" then /(\w[\w\.\-]*)/
when "-path" then /(\w[\w\.\-\/\\\\]*)/
when "-email" then /(\w[\w\-\.]+@[\w\-\.]+\w)/
when "-url" then
/(\w+:\/\/[\w\.\-]+(:\d*)?\/[\w\.\-\/\#\?\=\%]*)/
when "-ip" then /(\d+\.\d+\.\d+\.\d+)/
when "-mac" then
/(([0-9A-Fa-f]{2}[:\.\-]){5}[0-9A-Fa-f]{2})/
when "-print" then /([\w
\t\r\n\`\~\!\@\#\$\%\^\&\*\(\)\-\+\=\[\]\{\}\;\:\'\"\,\.\/\<\>
\?\\\|]+)/
when "-noprint" then /([^\w
\t\r\n\`\~\!\@\#\$\%\^\&\*\(\)\-\+\=\[\]\{\}\;\:\'\"\,\.\/\<\>
\?\\\|]+)/
when "-diff" then /(^[\-\+]([^\-\+].*)?)/
when "-md5" then /([A-Za-z0-9]{32})/
when "-quote" then /("[^"]*")/
when "-mixedquote" then /(['"][^'"]*['"])/
else
   Regexp.new(string)
end

parse =
lambda do |f|
   while (line = f.gets)
     line.chomp.scan(regexp).each do |a|
       puts a[0]
     end
   end
end

if ARGV.empty?
   parse.call($stdin)
else
   ARGV.each do |file|
     File.open(file) do |f|
       parse.call(f)
     end
   end
end

----------------------------------------------------------------

>>>RubyGems 0.9.0 doesn't work with RubyScript2Exe...
>>
>>Why?
>
>It's complaining about a missing fileutils:
>
> .../lib/rubygems/custom_require.rb:21:in `require__':
> No such file to load -- fileutils (LoadError)
>
>I did some more testing with more gems on different platforms.
>The conclusion is twofold: a) The problem occurred with
>RubyGems 0.8.11 as well (in combination with RubyScript2Exe
>0.4.4) and b) it doesn't occur with all gems (e.g. sqlite-ruby
>is a problem, actionmailer isn't).

Perhaps sqlite-ruby is an old format gem? It seems to be the

Maybe this is due to sqlite-ruby's use of the evil (and now deprecated)
#autorequire?

Marshal.load(File.read("source_cache"))["http://gems.rubyforge.org"][“cache”].entries.find{|x, *a| /sqlite-ruby/ =~ x }

=> ["sqlite-ruby-2.0.2", #<Gem::Specification:0xb741663c
@required_ruby_version=#<Gem::Version::Requirement:0xb7416434
@requirements=[[">=", #<Gem::Version:0xb74163bc @version="1.8.0">]]>,
@autorequire="sqlite", @bindir=nil, @require_paths=["lib"],

···

On Wed, Jul 05, 2006 at 12:34:03PM +0900, Eric Hodel wrote:

On Jul 3, 2006, at 6:37 AM, Erik Veenstra wrote:

===================
@rubygems_version="0.8.11", @description=nil, @dependencies=nil,
@specification_version=-1, @extensions=["ext/extconf.rb"], @platform="ruby",
@cert_chain=, @requirements=nil, @rubyforge_project=nil,
@summary="SQLite/Ruby is a module to allow Ruby scripts to interface with a
SQLite database. VERSIONS >=2.0.0 ARE BETA RELEASES. THEY ARE INTENDED FOR
TESTING ONLY, AND SHOULD NOT BE CONSIDERED PRODUCTION-WORTHY YET.",
@rdoc_options=, @extra_rdoc_files=, @version=#<Gem::Version:0xb741659c
@version="2.0.2">, @signing_key=nil,
@homepage="http://sqlite-ruby.rubyforge.org", @executables=nil, @authors=nil,
@name="sqlite-ruby", @date=Mon Sep 13 04:19:04 CEST 2004, @test_files=,
@has_rdoc=true, @files=, @email="jgb3@email.byu.edu",
@default_executable=nil>]

--
Mauricio Fernandez - http://eigenclass.org - singular Ruby

Jeff Cohen wrote:

Jeff Cohen wrote:

So I'm thinking everything's now ok?

Tried to install the latest mongrel:

c:\dev>gem install mongrel
ERROR: While executing gem ... (Gem::GemNotFoundException)
    Could not find mongrel (> 0) in the repository

However, this did work:

c:\dev>gem install mongrel
--source=http://mongrel.rubyforge.org/releases/

Any idea why the simple "gem install" didn't work?

There was a gem on rubyforge that somehow corrupted the gem index on
that site. A lot of people seemed to have downloaded the corrupted
index and it has been causing problems. The easiest way to deal with it
is to just delete your gem cache file.

Use the gem env command to find the default gem repository directory and
remove the source_cache file there.

   $ gem env gemdir
   PATH_TO_DEFAULT_GEM_REPOSITORY
   $ rm PATH_TO_DEFAULT_GEM_REPOSITORY/souce_cache
   $ rm $HOME/.gem/source_cache

The .gem cache will only exist if the default repository is not writable
from your user account. Delete both if they exist.

···

--
-- Jim Weirich

--
Posted via http://www.ruby-forum.com/\.

I did some more testing with more gems on different
platforms. The conclusion is twofold: a) The problem
occurred with RubyGems 0.8.11 as well (in combination with
RubyScript2Exe 0.4.4) and b) it doesn't occur with all gems
(e.g. sqlite-ruby is a problem, actionmailer isn't).

Perhaps sqlite-ruby is an old format gem? It seems to be the

It seems to be the /what/?... Where is part two?... This is
where I expected the most important part of the answer... ;]

Ooh, sorry, It seems to be the old format gems require fileutils but the new format ones don't. Also check out Mauricio's mail.

···

On Jul 5, 2006, at 2:28 AM, Erik Veenstra wrote:

Which libraries are required conditionally by RubyGems?

I think zlib and yaml are the only others for making require
work. It is difficult to tell with just grep.

I used a different kind of grep, called regexp.rb. It doesn't
show the line on which a pattern occurs, but it only shows the
matching part of the line. It's listed below. I used this
regexp.rb to find all libraries that /could/ be required by
RubyGems, both conditionally and unconditionally, listed in
list1.

The second list, list2, are the libraries that are actually
required after doing a "require 'rubygems'".

The differences between these lists are conditionally required
files (indicated with "-") and indirectly required files
(indicated with "+").

I'm concerned about the "-" part... ;]

(The lists may not be complete.)

Suggestions? Ideas?

gegroet,
Erik V. - http://www.erikveen.dds.nl/

----------------------------------------------------------------

$ find /usr/local/lib/ruby/site_ruby/1.8/rubygems*/ -type f -exec cat
{} \; | ruby regexp.rb "\brequire[\(\s]*['\"]([^'\"]*)['\"]" | sort |
uniq > list1

$ ruby -rubygems -e 'puts $".sort.join("\n")' | sed 's/\.[^\.]*$//g' >
list2

$ diff -ur list[12]
--- list1 2006-07-05 11:13:14.086994100 +0200
+++ list2 2006-07-05 11:13:16.440354600 +0200
@@ -1,43 +1,19 @@
-digest/md5
+date/format
+digest
  digest/sha2
-fileutils
-find
  forwardable
-md5
-net/ftp
-net/http
-net/https
-openssl
-optparse
-pathname
+parsedate
+rational
  rbconfig
-rdoc/rdoc
+rbconfig/datadir
  rubygems
-rubygems/command
-rubygems/dependency_list
-rubygems/format
-rubygems/format.rb
-rubygems/gem_commands
+rubygems/custom_require
  rubygems/gem_openssl
-rubygems/incremental_fetcher
-rubygems/installer
-rubygems/old_format
-rubygems/open-uri
-rubygems/package
+rubygems/rubygems_version
  rubygems/security
  rubygems/source_index
  rubygems/specification
  rubygems/user_interaction
  rubygems/version
-socket
-sources
-stringio
-tempfile
-test/unit/ui/console/testrunner
  time
-timeout
-uri
-x
-yaml
-yaml/syck
-zlib
+ubygems

----------------------------------------------------------------

chars = '^\s\r\n\`\!\(\)\[\]\{\}\<\> \,\.\/\?\\\|\=\;\:\"'

chars11 = chars + "'"

chars21 = chars + "'"
chars22 = chars
chars23 = chars + "'"

chars31 = '\w\s\r\n'

string = ARGV.shift

regexp =
case string
when string.to_i.to_s then /(^\s*#{(["[^\\s]+"] *
string.to_i).join("\\s+")}\r*$)/
when "-word" then /([#{chars11}]+)/
when "-word2" then
/([#{chars21}]([#{chars22}]*[#{chars23}])?)/
when "-word3" then /([A-Za-z]+)/
when "-text" then /([#{chars31}]+)/
when "-file" then /(\w[\w\.\-]*)/
when "-path" then /(\w[\w\.\-\/\\\\]*)/
when "-email" then /(\w[\w\-\.]+@[\w\-\.]+\w)/
when "-url" then
/(\w+:\/\/[\w\.\-]+(:\d*)?\/[\w\.\-\/\#\?\=\%]*)/
when "-ip" then /(\d+\.\d+\.\d+\.\d+)/
when "-mac" then
/(([0-9A-Fa-f]{2}[:\.\-]){5}[0-9A-Fa-f]{2})/
when "-print" then /([\w
\t\r\n\`\~\!\@\#\$\%\^\&\*\(\)\-\+\=\[\]\{\}\;\:\'\"\,\.\/\<\>
\?\\\|]+)/
when "-noprint" then /([^\w
\t\r\n\`\~\!\@\#\$\%\^\&\*\(\)\-\+\=\[\]\{\}\;\:\'\"\,\.\/\<\>
\?\\\|]+)/
when "-diff" then /(^[\-\+]([^\-\+].*)?)/
when "-md5" then /([A-Za-z0-9]{32})/
when "-quote" then /("[^"]*")/
when "-mixedquote" then /(['"][^'"]*['"])/
else
   Regexp.new(string)
end

parse =
lambda do |f|
   while (line = f.gets)
     line.chomp.scan(regexp).each do |a|
       puts a[0]
     end
   end
end

if ARGV.empty?
   parse.call($stdin)
else
   ARGV.each do |file|
     File.open(file) do |f|
       parse.call(f)
     end
   end
end

----------------------------------------------------------------

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

Jim Weirich wrote:

There was a gem on rubyforge that somehow corrupted the gem index on
that site. A lot of people seemed to have downloaded the corrupted
index and it has been causing problems. The easiest way to deal with it
is to just delete your gem cache file.

Awesome. Thanks a lot, Jim.

Jeff

···

--
Posted via http://www.ruby-forum.com/\.