Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Customizing rubygems via #{RUBY_ENGINE}.rb
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vladimir Sizikov  
View profile  
 More options Jun 25 2008, 5:10 pm
From: "Vladimir Sizikov" <vsizi...@gmail.com>
Date: Wed, 25 Jun 2008 23:10:49 +0200
Local: Wed, Jun 25 2008 5:10 pm
Subject: [Rubygems-developers] Customizing rubygems via #{RUBY_ENGINE}.rb
Hi guys,

I'm currently in a process of upgrading JRuby trunk with the latest
rubygems 1.2, and
trying to use the new feature to provide some JRuby specific
customization to rubygems via
#{RUBY_ENGINE}.rb file.

It worked very well in some cases, but I'm facing some problems when I
try to customize
things like commands, since that RUBY_ENGINE.rb file is loaded at the
end of rubygems.rb
file but *before* other things like commands are loaded.

Here are some use cases that I'd like to resolve somehow:

1. gem install and gem update commands. I'd like to customize the
default options.
   More specifically, to enable env_shebang option.

2. installer.rb has shebang(bin_file_name) method that works not
ideally with JRuby on Windows,
   and I'd like to provide customized version of that.

In both cases, I can't redefine/monkey-patch those things from
#{RUBY_ENGINE}.rb.

Any suggestions?

Thank you,
  --Vladimir

P.S. So far, rubygems 1.2 looks *very* impressive speed- and
memory-wise. Thanks!!
_______________________________________________
Rubygems-developers mailing list
Rubygems-develop...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Hodel  
View profile  
 More options Jun 25 2008, 5:46 pm
From: Eric Hodel <drbr...@segment7.net>
Date: Wed, 25 Jun 2008 14:46:42 -0700
Local: Wed, Jun 25 2008 5:46 pm
Subject: Re: [Rubygems-developers] Customizing rubygems via #{RUBY_ENGINE}.rb
On Jun 25, 2008, at 14:10 PM, Vladimir Sizikov wrote:

I think Gem::ConfigFile can be changed to set this as default.  I'll  
explore it.

> 2. installer.rb has shebang(bin_file_name) method that works not
> ideally with JRuby on Windows,
>   and I'd like to provide customized version of that.

How do you want to change shebang?  Maybe we can make the change in  
the installer instead.
_______________________________________________
Rubygems-developers mailing list
Rubygems-develop...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vladimir Sizikov  
View profile  
 More options Jun 25 2008, 5:53 pm
From: "Vladimir Sizikov" <vsizi...@gmail.com>
Date: Wed, 25 Jun 2008 23:53:58 +0200
Local: Wed, Jun 25 2008 5:53 pm
Subject: Re: [Rubygems-developers] Customizing rubygems via #{RUBY_ENGINE}.rb
Hi Eric,

Thanks for very quick response!

On Wed, Jun 25, 2008 at 11:46 PM, Eric Hodel <drbr...@segment7.net> wrote:
>> 1. gem install and gem update commands. I'd like to customize the
>> default options.
>>  More specifically, to enable env_shebang option.

> I think Gem::ConfigFile can be changed to set this as default.  I'll explore
> it.

The ideal case would be to have zero "hacks/patches" over official
rubygems sources, so if there is a way to provide command defaults and
not modifying
the official sources, that would be the best.

I think #{RUBY_ENGINE}.rb is a good start.

>> 2. installer.rb has shebang(bin_file_name) method that works not
>> ideally with JRuby on Windows,
>>  and I'd like to provide customized version of that.

> How do you want to change shebang?  Maybe we can make the change in the
> installer instead.

In JRuby, the main executable name on Windows is jruby.bat. If you
have the shebang:
#!/usr/bin/env jruby.bat

That won't work on Cygwin, but
#!/usr/bin/env jruby  - will work

So, we currently modify that shebang method to return the appropriate one.

Thanks,
  --Vladimir
_______________________________________________
Rubygems-developers mailing list
Rubygems-develop...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Hodel  
View profile  
 More options Jun 25 2008, 7:50 pm
From: Eric Hodel <drbr...@segment7.net>
Date: Wed, 25 Jun 2008 16:50:58 -0700
Local: Wed, Jun 25 2008 7:50 pm
Subject: Re: [Rubygems-developers] Customizing rubygems via #{RUBY_ENGINE}.rb
On Jun 25, 2008, at 14:53 PM, Vladimir Sizikov wrote:

Ok, I added Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS and  
PLATFORM_DEFAULTS.

Add:

Gem::ConfigFile::PLATFORM_DEFAULTS['install'] = '--env-shebang'
Gem::ConfigFile::PLATFORM_DEFAULTS['update'] = '--env-shebang'

I think this will work for `gem update`, but I'm not sure.  Can you  
let me know if it doesn't work?

(In the future, Gem::InstallUpdateOptions needs to be connected into  
these common options, I'm not sure how to do that yet.)

I saw your paste (http://pastie.org/222204) with the change you're  
making to Installer.  Do you think an overridable  
Gem.ruby_executable_name would be sufficient? By default it would be  
Gem::ConfigMap[:ruby_install_name].
_______________________________________________
Rubygems-developers mailing list
Rubygems-develop...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vladimir Sizikov  
View profile  
 More options Jul 9 2008, 6:38 am
From: "Vladimir Sizikov" <vsizi...@gmail.com>
Date: Wed, 9 Jul 2008 12:38:16 +0200
Local: Wed, Jul 9 2008 6:38 am
Subject: Re: [Rubygems-developers] Customizing rubygems via #{RUBY_ENGINE}.rb
Hi Eric,

Thanks for your support and responses, my comments below.

On Thu, Jun 26, 2008 at 1:50 AM, Eric Hodel <drbr...@segment7.net> wrote:
> Ok, I added Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS and
> PLATFORM_DEFAULTS.

And I just integrated that into JRuby.

> Add:

> Gem::ConfigFile::PLATFORM_DEFAULTS['install'] = '--env-shebang'
> Gem::ConfigFile::PLATFORM_DEFAULTS['update'] = '--env-shebang'

> I think this will work for `gem update`, but I'm not sure.  Can you let me
> know if it doesn't work?

Yes, this works perfectly in both cases (I had to add require
'rubygems/config_file' to JRuby's customization file jruby.rb though,
which seems to be the proper thing).

The only issue with this is that the help output that lists the
default options is not really updated accordingly. So, while we
endable --env-shebang in jruby.rb, users won't see from jruby -S gem
help install, that this option is enabled.

But, all in all, 4 more direct changes of official rubygems sources
are removed, and the only single one remains:

>>>> 2. installer.rb has shebang(bin_file_name) method that works not
>>>> ideally with JRuby on Windows,
>>>> and I'd like to provide customized version of that.

I'll talk about it in a separate email.

Thanks,
  --Vladimir
_______________________________________________
Rubygems-developers mailing list
Rubygems-develop...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »