require issue

2010-08-15 Thread Tobi
Hi!

There seems to be an issue with the latest ruby1.9.1 causing a bunch auf
auto-bugs by Lucas' latest rebuild:

While this works:

$ touch /tmp/test.rb ; ruby1.9.1 -e require '/tmp/test'

This doesn't:

$ touch test.rb ; ruby1.9.1 -e require 'test'
internal:lib/rubygems/custom_require:29:in `require': no such file to
load -- rubygems (LoadError)
from internal:lib/rubygems/custom_require:29:in `require'
from internal:gem_prelude:167:in `load_full_rubygems_library'
from internal:gem_prelude:217:in `try_activate'
from internal:lib/rubygems/custom_require:32:in `rescue in require'
from internal:lib/rubygems/custom_require:29:in `require'
from -e:1:in `main'

It's seems ruby has an issue with requiring from a relative path and then
falling back to rubygems. And the cause of this seems to be, that '.' is
missing from the load path:

$ ruby1.8 -e p $:.include?('.')
true

$ ruby1.9.1 -e p $:.include?('.')
false

Tobias


-- 
To UNSUBSCRIBE, email to debian-ruby-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4c67e796.10...@e-tobi.net



Re: require issue

2010-08-15 Thread Tobi
Lucas Nussbaum wrote:

 That is caused by the magic in ruby 1.9.* which tries to fallback to
 using rubygems if a normal require fails. I'm not sure yet where we
 should go about that.

It might avoid trouble with unpackaged code, if this rubygems fallback is
kept. But there should at least be a useful error message. Currently it
just complains about the missing rubygems, not the library it tried to
load in the first place.

Attached is small patch that updates NEWS/README.Debian for the LOAD_PATH
changes.

Tobias
Index: debian/changelog
===
--- debian/changelog	(Revision 468)
+++ debian/changelog	(Arbeitskopie)
@@ -1,3 +1,10 @@
+ruby1.9.1 (1.9.2~svn28788-2) unstable; urgency=low
+
+  * Updated documentation refering to $LOAD_PATH
+  * 
+
+ -- Tobias Grimm et...@debian.org  Sun, 15 Aug 2010 18:29:48 +0200
+
 ruby1.9.1 (1.9.2~svn28788-1) unstable; urgency=low
 
   * New release based on upstream snapshot from the 1.9.2 branch,
Index: debian/NEWS
===
--- debian/NEWS	(Revision 468)
+++ debian/NEWS	(Arbeitskopie)
@@ -1,3 +1,23 @@
+ruby1.9.1 (1.9.2~svn28788-1) unstable; urgency=low
+
+  $LOAD_PATH is changed in Ruby 1.9.1-p0 as the following:
+
+[/usr/local/lib/site_ruby/1.9.1,
+ /usr/local/lib/site_ruby/1.9.1/i486-linux,
+ /usr/local/lib/site_ruby,
+ /usr/lib/ruby/vendor_ruby/1.9.1,
+ /usr/lib/ruby/vendor_ruby/1.9.1/i486-linux,
+ /usr/lib/ruby/vendor_ruby,
+ /usr/lib/ruby/1.9.1,
+ /usr/lib/ruby/1.9.1/i486-linux]
+
+  Please note that . is no longer part of the $LOAD_PATH, so you might need to
+  change require statements using relative paths.
+
+  This changes was introduced by the upstream author.
+
+ -- Tobias Grimm et...@debian.org  Sun, 15 Aug 2010 18:01:51 +0200
+
 ruby1.9 (1.9.1.0-1) experimental; urgency=low
 
   $LOAD_PATH is changed in Ruby 1.9.1-p0 as the following:
Index: debian/README.Debian
===
--- debian/README.Debian	(Revision 468)
+++ debian/README.Debian	(Arbeitskopie)
@@ -1,14 +1,14 @@
-Ruby 1.9 for Debian GNU/Linux
--
+Ruby 1.9.1 for Debian GNU/Linux
+---
 
-This is Ruby 1.9 package for Debian GNU/Linux.
+This is Ruby 1.9.1 package for Debian GNU/Linux.
 
 Ruby is the interpreted scripting language for quick and easy
 object-oriented programming.  It has many features to process text files and
 to do system management tasks (as in perl).  It is simple, straight-forward,
 and extensible.
 
-Ruby 1.9.0 is the development version of Ruby.
+Ruby 1.9.1 is the current version of the Ruby 1.9 series.
 
 Homepage of Ruby is:
 
@@ -21,39 +21,36 @@
 
 For Debian users:
 
- * You can use /usr/bin/ruby1.9.
+ * You can use /usr/bin/ruby1.9.1
 
  * ``sitedir'' is /usr/local/lib/site_ruby, so ``$:'' (or ``$LOAD_PATH'')
contains the following:
 
-[/usr/local/lib/site_ruby/1.9.0,
- /usr/local/lib/site_ruby/1.9.0/i486-linux,
- /usr/local/lib/site_ruby/1.9/i386-linux,
+[/usr/local/lib/site_ruby/1.9.1,
+ /usr/local/lib/site_ruby/1.9.1/i486-linux,
  /usr/local/lib/site_ruby,
- /usr/lib/ruby/vendor_ruby/1.9.0,
- /usr/lib/ruby/vendor_ruby/1.9.0/i486-linux,
+ /usr/lib/ruby/vendor_ruby/1.9.1,
+ /usr/lib/ruby/vendor_ruby/1.9.1/i486-linux,
  /usr/lib/ruby/vendor_ruby,
- /usr/lib/ruby/1.9.0,
- /usr/lib/ruby/1.9.0/i486-linux,
- /usr/lib/ruby/1.9/i386-linux,
- .]
+ /usr/lib/ruby/1.9.1,
+ /usr/lib/ruby/1.9.1/i486-linux]
 
-   (1.9.0 means #{major}.#{minor}.#{teeny} and i486-linux means #{arch}-#{os}.)
+   (1.9.1 means #{major}.#{minor}.#{teeny} and i486-linux means #{arch}-#{os}.)
 
  * Debian ruby policy is available in /usr/share/doc/ruby/ruby-policy.txt.gz
(ruby package) 
 
  * Some libraries are in sub-packages.
- * irb1.9 - irb program and libraries
- * ri1.9 - ri program
- * rdoc1.9 - rdoc program and libraries
- * libdbm-ruby1.9 - dbm.so
- * libdbm-gruby1.9 - gdbm.so
- * libreadline-ruby1.9 - readline.so
- * libtcltk-ruby1.9 - tkutil.so, tcltklib.so and related libraries
- * libopenssl-ruby1.9 - openssl.so and libraries which use openssl
- * ruby1.9-dev - header files and mkmf.rb.
- * ruby1.9-elisp - ruby-mode, etc
- * ruby1.9-examples - example programs
+ * irb1.9.1 - irb program and libraries
+ * ri1.9.1 - ri program
+ * rdoc1.9.1 - rdoc program and libraries
+ * libdbm-ruby1.9.1 - dbm.so
+ * libdbm-gruby1.9.1 - gdbm.so
+ * libreadline-ruby1.9.1 - readline.so
+ * libtcltk-ruby1.9.1 - tkutil.so, tcltklib.so and related libraries
+ * libopenssl-ruby1.9.1 - openssl.so and libraries which use openssl
+ * ruby1.9.1-dev - header files and mkmf.rb.
+ * ruby1.9.1-elisp - ruby-mode, etc
+ * ruby1.9.1-examples - example programs
 
  -- akira yamada ak...@debian.org, Thu, 25 Dec 2007 

Re: Let's discuss big changes in Ruby packaging for squeeze+1

2010-05-10 Thread Tobi
... and another small patch, setting the html encoding to utf-8, because
the gem info might contain utf-8 characters. See e.g. nokogiri.

Tobias
From 049447d5b844e91e997939f134271ce223d7146e Mon Sep 17 00:00:00 2001
From: etobi g...@e-tobi.net
Date: Mon, 10 May 2010 08:18:14 +0200
Subject: [PATCH 2/2] Set html encoding to utf-8

---
 gemwatch.rb |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gemwatch.rb b/gemwatch.rb
index 24c6c89..6bd67c8 100644
--- a/gemwatch.rb
+++ b/gemwatch.rb
@@ -143,6 +143,7 @@ __END__
 @@ layout
 %html
   %head
+%meta{http-equiv = content-type, :content = text/html;charset=UTF-8}
 %link{:rel = stylesheet, :type = text/css, :href = asset_url(/style.css)}
   %body{:class = @body_class}
 %div.wrap
-- 
1.7.1



Re: Let's discuss big changes in Ruby packaging for squeeze+1

2010-05-09 Thread Tobi
Antonio Terceiro wrote:

 In the meantime, the current version is running on
 http://gemwatch.heroku.com/

Thanks a lot!

I just noticed, that the timestamps of the files in the tarball are set to
 1970-01-01, which would cause lintian errors if such tarball is used as
upstream source.

Unfortunately it seems, gem's don't care about the timestamps. I took a
look at the rubygems source code and it probably might be easy to fix
this, but for now I think the best way would be to touch all files. See
the attached patch.

Tobias
From 23915dc23bae2a8627332f7481890b8a4b0cd52e Mon Sep 17 00:00:00 2001
From: etobi g...@e-tobi.net
Date: Sun, 9 May 2010 22:58:52 +0200
Subject: [PATCH] Update timestamps in extracted tarball

---
 README.rst  |1 +
 gemwatch.rb |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/README.rst b/README.rst
index 64a1d8d..b8b3a6b 100644
--- a/README.rst
+++ b/README.rst
@@ -27,6 +27,7 @@ steps::
   wget ./mygem-0.1.0.gem
   tar xf mygem-0.1.0.gem
   tar xzf data.tar.gz
+  find . -exec touch {} \;
   xcat metadata.gz  metadata.yml
   rm -f mygem-0.1.0.gem data.tar.gz metadata.gz
   cd ..
diff --git a/gemwatch.rb b/gemwatch.rb
index 2c2acfc..24c6c89 100644
--- a/gemwatch.rb
+++ b/gemwatch.rb
@@ -61,6 +61,7 @@ class GemWatch::Gem
 run wget #{uri}
 run tar xf #{gem}
 run tar xzf data.tar.gz
+FileUtils.touch(Dir.glob('**/*'))
 run zcat metadata.gz  metadata.yml
 FileUtils.rm_f([gem, data.tar.gz, metadata.gz])
   end
-- 
1.7.1