Rake 0.6.0 Released

J

Jim Weirich

= Rake 0.6.0 Released

Its time for some long requested enhancements and lots of bug fixes
... And a whole new web page.

== New Web Page

The primary documentation for rake has moved from the RubyForge based
wiki to its own Hieraki based web site. Constant spam on the wiki
made it a difficult to keep clean. The new site will be easier to
update and organize.

Check out the new documentation at: http://docs.rubyrake.org

We will be adding new documentation to the site as time goes on.

In addition to the new docs page, make sure you check out Martin
Fowlers article on rake at http://martinfowler.com/articles/rake.html

== Changes

=== New Features

* Multiple prerequisites on Rake rules now allowed. However, keep the
following in mind:

1. All the prerequisites of a rule must be available before a rule
is triggered, where "enabled" means (a) an existing file, (b) a
defined rule, or (c) another rule which also must be
trigger-able.
2. Rules are checked in order of definition, so it is important to
order your rules properly. If a file can be created by two
different rules, put the more specific rule first (otherwise the
more general rule will trigger first and the specific one will
never be triggered).
3. The <tt>source</tt> method now returns the name of the first
prerequisite listed in the rule. <tt>sources</tt> returns the
names of all the rule prerequisites, ordered as they are defined
in the rule. If the task has other prerequisites not defined in
the rule (but defined in an explicit task definition), then they
will _not_ be included in the sources list.

* FileLists may now use the egrep command. This popular enhancement
is now a core part of the FileList object. If you want to get a
list of all your to-dos, fixmes and TBD comments, add the following
to your Rakefile.

desc "Look for TODO and FIXME tags in the code"
task :todo do
FileList['**/*.rb'].egrep /#.*(FIXME|TODO|TBD)/
end

* The <tt>investigation</tt> method was added to task object to dump
out some important values. This makes it a bit easier to debug Rake
tasks.

For example, if you are having problems with a particular task, just
print it out:

task :huh do
puts Rake::Task['huh'].investigation
end

* The Rake::TestTask class now supports a "ruby_opts" option to pass
arbitrary ruby options to a test subprocess.

=== Some Incompatibilities

* When using the <tt>ruby</tt> command to start a Ruby subprocess, the
Ruby interpreter that is currently running rake is used by default.
This makes it easier to use rake in an environment with multiple
ruby installation. (Previously, the first ruby command found in the
PATH was used).

If you wish to chose a different Ruby interpreter, you can
explicitly choose the interpreter via the <tt>sh</tt> command.

* The major rake classes (Task, FileTask, FileCreationTask, RakeApp)
have been moved out of the toplevel scope and are now accessible as
Rake::Task, Rake::FileTask, Rake::FileCreationTask and
Rake::Application. If your Rakefile
directly references any one of these tasks, you may:

1. Update your Rakefile to use the new classnames
2. Use the --classic-namespace option on the rake command to get the
old behavior,
3. Add <code>require 'rake/classic_namespace'</code> to the
Rakefile to get the old behavior.

<tt>rake</tt> will print a rather annoying warning whenever a
deprecated class name is referenced without enabling classic
namespace.

=== Bug Fixes

* Several unit tests and functional tests were fixed to run better
under windows.

* Directory tasks are now a specialized version of a File task. A
directory task will only be triggered if it doesn't exist. It will
not be triggered if it is out of date w.r.t. any of its
prerequisites.

* Fixed a bug in the Rake::GemPackageTask class so that the gem now
properly contains the platform name.

* Fixed a bug where a prerequisite on a <tt>file</tt> task would cause
an exception if the prerequisite did not exist.

== What is Rake

Rake is a build tool similar to the make program in many ways. But
instead of cryptic make recipes, Rake uses standard Ruby code to
declare tasks and dependencies. You have the full power of a modern
scripting language built right into your build tool.

== Availability

The easiest way to get and install rake is via RubyGems ...

gem install rake (you may need root/admin privileges)

Otherwise, you can get it from the more traditional places:

Home Page:: http://rake.rubyforge.org/
Download:: http://rubyforge.org/project/showfiles.php?group_id=50

== Thanks

As usual, it was input from users that drove a alot of these changes.
The following people either contributed patches, made suggestions or
made otherwise helpful comments. Thanks to ...

* Greg Fast (better ruby_opt test options)
* Kelly Felkins (requested by better namespace support)
* Martin Fowler (suggested Task.investigation)
* Stuart Jansen (send initial patch for multiple prerequisites).
* Masao Mutch (better support for non-ruby Gem platforms)
* Philipp Neubeck (patch for file task exception fix)
 
J

Joel VanderWerf

Jim said:
= Rake 0.6.0 Released

Trying to update my gems from 0.5.7, but I get this:

$ gem update
Upgrading installed gems...
Updating Gem source index for: http://gems.rubyforge.org
Attempting remote upgrade of rake
Attempting remote installation of 'rake'
ERROR: While executing gem ... (Gem::Exception)
SSL is not installed on this system

I do have libssl 0.9.7 installed, and the earlier rake installed ok.
What could be causing this?
 
J

Jim Weirich

I do have libssl 0.9.7 installed, and the earlier rake installed ok.
What could be causing this?

Sounds like a gem issue. The Rake gem is signed, but RubyGems is pretty
careful about continuing even when the ssl libraries are not available.

Try running the gem command with the --backtrace option so we can get a
stacktrace and locate the code causing the error.
 
J

Joel VanderWerf

Jim said:
Sounds like a gem issue. The Rake gem is signed, but RubyGems is pretty
careful about continuing even when the ssl libraries are not available.

Try running the gem command with the --backtrace option so we can get a
stacktrace and locate the code causing the error.

$ gem update --backtrace
Upgrading installed gems...
Updating Gem source index for: http://gems.rubyforge.org
Attempting remote upgrade of rake
Attempting remote installation of 'rake'
ERROR: While executing gem ... (Gem::Exception)
SSL is not installed on this system
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_openssl.rb:21:in
`ensure_ssl_available'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:512:in `initialize'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:481:in `each_entry'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:439:in `loop'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:439:in `each_entry'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:424:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:481:in `initialize'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `new'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `new'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:580:in `open_from_io'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:799:in `open_from_io'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:53:in `from_io'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:41:in
`from_file_by_path'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:57:in `install'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:407:in
`install'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:195:in `execute'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:153:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:153:in `execute'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:781:in `execute'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:777:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:777:in `execute'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:94:in
`process_args'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:67:in `run'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:13:in `run'
/usr/local/bin/gem:17
 
J

Jim Weirich

Yeah, its the fact that the gem is signed and RubyGems is insisting on having
SSL available. I think it should only do that if the security policy
requires it, but that's a gems issue that needs looking into.

So, what to do?

(1) If you thought you had SSL, and you don't, then you probably should look
into that.

(2) If you want the latest rake no matter what, I put out an unsigned version
of the gem on my betagem site labelled version 0.6.1. You can get it with:

gem install rake --source http://onestepback.org/betagems
 
D

Dominik Schlütter

Hi,

Jim Weirich said:
Sounds like a gem issue. The Rake gem is signed, but RubyGems is pretty
careful about continuing even when the ssl libraries are not available.

I got the same problem here on a Debian/MIPSel (a Buffalo LinkStation)
box. SSL is installed, but I was missing the Ruby/SSL bindings. Doing an
'apt-get install libopenssl-ruby' did help (although it complained about
the rdoc).

On my Mac (10.4.2 Tiger) I didn't run into any problems with Ruby
installed via DarwinPorts.


Regards,

Dominik.
 
J

Joel VanderWerf

Jim said:
Yeah, its the fact that the gem is signed and RubyGems is insisting on having
SSL available. I think it should only do that if the security policy
requires it, but that's a gems issue that needs looking into.

So, what to do?

(1) If you thought you had SSL, and you don't, then you probably should look
into that.

That's it. My openssl.so was not installed correctly. It built ok in
ext/openssl, but I had to disable the RUBYOPT=rubygems for it to install
(and then gem update was able to install rake-0.6.0). With
RUBYOPT=rubygems, I was getting this:

$ make install
/usr/local/lib/ruby/site_ruby/1.8/rubygems/security.rb:18: uninitialized
constant OpenSSL::Digest::SHA1 (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4
make: *** [/usr/local/lib/ruby/site_ruby/1.8/i686-linux/openssl.so] Error 1
 
J

Jim Weirich

Jim said:
Yeah, its the fact that the gem is signed and RubyGems is insisting on
having SSL available. I think it should only do that if the security
policy requires it, but that's a gems issue that needs looking into.

So, what to do?

(1) If you thought you had SSL, and you don't, then you probably should
look into that.

That's it. My openssl.so was not installed correctly. It built ok in
ext/openssl, but I had to disable the RUBYOPT=rubygems for it to install
(and then gem update was able to install rake-0.6.0). With
RUBYOPT=rubygems, I was getting this:

$ make install
/usr/local/lib/ruby/site_ruby/1.8/rubygems/security.rb:18: uninitialized
constant OpenSSL::Digest::SHA1 (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4
make: *** [/usr/local/lib/ruby/site_ruby/1.8/i686-linux/openssl.so] Error 1

Thanks for the feedback. RubyGems assumes that if you can successfully
require the openssl library, then ssl is available. Unfortunately, in the
half installed state you were in, the openssl.so library was available but
not the ruby portion (openssl.rb). So the require succeeded, fooling
RubyGems into thinking the entire ssl infrastructure was in place when it was
not.

I'll put a fix in for that.
 
C

Chris Martin

Jim said:
Yeah, its the fact that the gem is signed and RubyGems is insisting o= n
having SSL available. I think it should only do that if the security
policy requires it, but that's a gems issue that needs looking into.

So, what to do?

(1) If you thought you had SSL, and you don't, then you probably shou= ld
look into that.

That's it. My openssl.so was not installed correctly. It built ok in
ext/openssl, but I had to disable the RUBYOPT=3Drubygems for it to inst= all
(and then gem update was able to install rake-0.6.0). With
RUBYOPT=3Drubygems, I was getting this:

$ make install
/usr/local/lib/ruby/site_ruby/1.8/rubygems/security.rb:18: uninitialize= d
constant OpenSSL::Digest::SHA1 (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397:in `requ= ire'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:397
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4:in `require= '
from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:4
make: *** [/usr/local/lib/ruby/site_ruby/1.8/i686-linux/openssl.so] Err=
or 1
=20
Thanks for the feedback. RubyGems assumes that if you can successfully
require the openssl library, then ssl is available. Unfortunately, in th= e
half installed state you were in, the openssl.so library was available bu= t
not the ruby portion (openssl.rb). So the require succeeded, fooling
RubyGems into thinking the entire ssl infrastructure was in place when it= was
not.
=20
I'll put a fix in for that.
=20
--
-- Jim Weirich (e-mail address removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
=20
=20

To clarify for the slow and/or nubys who might get this error when
installing and/or updating gems for rails.

The ruby openssl library needs to be installed. eg, debian needs
libopenssl-ruby1.8

May be the error could be made clearer, I was sitting there going,
"but it IS installed!" in much more expletive words. ;)
I even read this thread last night, but your explanation didn't click
until I double checked it today.

--=20
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/
 
J

Joel VanderWerf

Chris Martin wrote:
...
To clarify for the slow and/or nubys who might get this error when
installing and/or updating gems for rails.

The ruby openssl library needs to be installed. eg, debian needs
libopenssl-ruby1.8

If you're not using packages and are building ruby from source, you can do

export RUBYOPT=

in your shell before building ruby. Then, if you have openssl installed
(not the ruby binding--the real openssl lib), the ruby openssl extension
in the ext/ dir will build and install. Then you can have

export RUBYOPT=rubygems

or whatever.

But I think Jim's fix to RubyGems will get around this entirely.
 
J

Jim Weirich

Joel VanderWerf said:
Chris Martin wrote:
...

If you're not using packages and are building ruby from source, you can= do

export RUBYOPT=3D

in your shell before building ruby. Then, if you have openssl installed
(not the ruby binding--the real openssl lib), the ruby openssl extensio= n
in the ext/ dir will build and install. Then you can have

export RUBYOPT=3Drubygems

or whatever.

But I think Jim's fix to RubyGems will get around this entirely.

The patch in RubyGems CVS will address this exact problem. We still need
to fix the gem command so that it can install signed gems without SSL
installed ... but I don't think that will be a hard problem.

--=20
-- Jim Weirich (e-mail address removed) http://onestepback.org
 
S

Stefan Lang

hiya, a dumb question, what is the difference between rant and
rake? they look the same?

Sorry for replying so late. Generally, it's possible to convert
a Rakefile to an Rantfile without much work. AFAIK Rant has
all major features of Rake plus:

* Optional use of MD5 checksums instead of timestamps.
* Easy and portable tgz/zip file creation on Linux/MacOS X/Windows
(and probably most other platforms where ruby runs).
* Create a script, tailored to the needs of a project, which
can be used instead of an Rant installation
=> Distribute this script with your project and users
and other developers don't need an Rant installation.
* It is possible to split up the build specification into
multiple files in different directories.
(=> no such thing as "recursive make" necessary).
This feature will be highly improved with the next release.
* and a few more...

Kind regards,
Stefan
 
S

stu

Thanks for the reply. I only asked as I currently use rant, and I
wondered since they seem so similar.

the recursive thing / subdirs thing had some big bugs in the early
0.4.something bus 0.4.4 has been great so far.. didnt know about he
md5 thing.. as I've hit a nasty rant timestamp bug that caused me to
change the way I do a build on my current project. :/

i better go look it up...

-Stu
 
S

Stefan Lang

Thanks for the reply. I only asked as I currently use rant, and I
wondered since they seem so similar.

the recursive thing / subdirs thing had some big bugs in the early
0.4.something bus 0.4.4 has been great so far.. didnt know about
he md5 thing.. as I've hit a nasty rant timestamp bug that caused
me to change the way I do a build on my current project. :/

Please write a bug report! If I can reproduce the bug, I can fix
it for the next release.
i better go look it up...

To use it, just put

import "md5"

at the top of an Rantfile to use MD5 checksums instead of timestamps.

Kind regards,
Stefan
 
H

Han Holl

------=_Part_6609_68265.1126779104979
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi Jim (and list),

[ cut ]
Check out the new documentation at: http://docs.rubyrake.org


This site seems to be down (two days already)=20

* The <tt>investigation</tt> method was added to task object to dump
out some important values. This makes it a bit easier to debug Rake
tasks.


Is there a reason not to call that inspect ?

Cheers,

Han Holl

------=_Part_6609_68265.1126779104979--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top