#4 new
Chad Woolley

Add a check on ruby version

Reported by Chad Woolley | May 20th, 2008 @ 12:31 AM | in 1.0 Release

I am not talking about installing ruby automatically but just running a

IO.popen("ruby --version"){ |f| f.readlines.join }

and check that it matches the ruby version.

If you like the idea, I could write a spec and the implementaion

Thanks for your project!

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

Date: 2008-02-01 17:24

Sender: Chad Woolley

...and 'executable' and 'platform' would be optional, and default

to 'ruby' and '.*'/anything.

Date: 2008-02-01 17:23

Sender: Chad Woolley

Jean-Michel,

Thanks for the continued work and nice words.

This looks good so far. As I think about it more, I'd also like

it to support different ruby interpreters, like jruby.

For example, here is what I get from -v on ruby and jruby:

chadmac:~/workspace/geminstaller woolley$ jruby -v

ruby 1.8.5 (2007-11-01 rev 4842) [i386-jruby1.1b1]

chadmac:~/workspace/geminstaller woolley$ ruby -v

ruby 1.8.5 (2006-08-25) [i686-darwin8.7.1]

So, I think we should support "executable" and

"platform" nodes below the "ruby" node in

the yaml file.

The 'executable' node would be the executable to call with

'--version'.

The "platform" node would be a string that is verified

to be a substring of the [platform] section of the -v output.

This would allow you to do version checks against jruby or ruby,

and also optionally enforce a specific jruby version or platform.

This should be a minor enhancement to your proposal. Feel free

to write up all the specs and implementation and submit a final

patch. I won't have much time to help code it anytime soon,

but I can answer any questions you have.

Thanks again!

-- Chad

Date: 2008-02-01 05:33

Sender: Jean-Michel Garnier

I have attached a patch about the configuratio, tell me what

you think?

You already replied to your question about what would happen

if the version did not match. IF you want, you can write

pending specs and I can try to implement them. Or I can do

the job. By the way, your specs run fine with Rspec 1.1.3.

The code and the specs are very fine grained: well done!

Date: 2008-01-31 10:05

Sender: Chad Woolley

This sounds like a good feature.

What would happen if the version did not match? An exception

to cause geminstaller to fail? If so, this should observe the

--exceptions command line switch (should be a

GemInstaller::GemInstallerError).

Also, where would it be configured? Can you show what you intend

to put in the geminstaller.yml? Would it be a top-level entry

in the yaml file?

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

GemInstaller

http://geminstaller.rubyforge.org

People watching this ticket

Pages