# Re: IronRuby version of existing gems

**URL:** <https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514>\
**Category:** IronRuby\
**Created:** [March 3, 2010, 7:16pm UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514 "2010-03-03T19:16:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 3, 2010, 7:16pm UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/1 "2010-03-03T19:16:31Z")

</div>

Isn’t that just keying off of RUBY\_PLATFORM and other constants?

* * *

From: Shri B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Wednesday, March 03, 2010 9:55 AM  
To: removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

It does seem like there isnâ€™t a way to distinguish between IronRuby and  
MRI.

C:\> ir.exe

> > > require “rubygems”  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1409 @cpu=“x86”, @os=“mswin32”, @version=“60”\>

JRuby otoh does seem to do something different

C:\> jruby.exe  
irb(main):001:0\> require “rubygems”  
=\> true  
irb(main):002:0\> Gem::Platform.local()  
=\> #\<Gem::Platform:0xf0 @cpu=“universal”, @os=“java”, @version=“1.6”\>

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 11:52 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

That all depends on how Gem checks the platform. If it uses the  
RUBY\_PLATFORM variable, then IronRuby needs to change what it reports  
here. Currently, it reports i386-mswin32.

–  
Will G.  
[http://hotgazpacho.org/](http://hotgazpacho.org/)

On Tue, Mar 2, 2010 at 1:07 PM, Jim D.  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I believe JRuby is doing the 1st one, which makes sense in my opinion.  
If possible we should prefer platform == â€œironrubyâ€, (or .net, do we  
need to differentiate .net and mono?), but accept others.

JD

From:  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Shri B.  
Sent: Tuesday, March 02, 2010 10:02 AM  
To: removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] IronRuby version of existing gems

This brings a question to mind - what should the general approach be for  
porting existing gems to IronRuby? There could be two possible  
approaches:

1. 

```
  Create a gem with the same name (â€œwin32consoleâ€ in this case), 

```

and specify platform==â€ironrubyâ€. That way, dependent gems do not need  
to be updated, and users have to remember just one name. IronRuby will  
use the version with platform==â€ironrubyâ€, and MRI will use the one with  
platform==â€mswin32â€. So there should not be any clashes even if you use  
MRI and IronRuby on the same machine.

1. 

```
  Create a new gem like iron-term-ansicolor.

```

Any pro or cons to the two? What should the recommendation be in  
general?

From:  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 7:47 AM  
To: ironruby-core  
Subject: Re: [Ironruby-core] iron-term-ansicolor 0.0.2 Released

I released iron-term-ansicolor 0.0.3 last night after testing the gem  
install locally first.

Please let me know if you still have trouble installing it from  
[Rubygems.org](http://Rubygems.org).

Also, I’ve submitted a patch to RSpec to use iron-term-ansicolor if it  
can, the same way it tries to use win32console under MRI.

–  
Will G.  
[http://hotgazpacho.org/](http://hotgazpacho.org/)

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 3, 2010, 7:24pm UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/2 "2010-03-03T19:24:07Z")

</div>

It does seem to.

Ruby Gems maintains a list of platform mappings.

See lib\ruby\site\_ruby\1.8\rubygems\platform.rb in the initialize  
method.  
Whatever initializes Gem::Platform seems to look at RUBY\_PLATFORM

C:\IronRuby\bin\>ir  
IronRuby 0.9.4.0 on .NET 2.0.50727.4927  
Copyright (c) Microsoft Corporation. All rights reserved.

> > > require ‘rubygems’  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1ec @cpu=“x86”, @os=“mswin32”, @version=“60”\>  
> > > RUBY\_PLATFORM  
> > > =\> “i386-mswin32”  
> > > p = Gem::Platform.new(‘universal-.net-3.5’)  
> > > =\> #\<Gem::Platform:0x1ee @cpu=“universal”, @os=“.net”, @version=“3.5”\>

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 3, 2010, 7:35pm UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/3 "2010-03-03T19:35:15Z")

</div>

Digging deeper, it appears that when you require ‘rubygems’ it looks at  
RbConfig, specifically RbConfig::CONFIG[‘arch’]

–  
Will G.  
[http://hotgazpacho.org/](http://hotgazpacho.org/)

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 3, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/4 "2010-03-03T19:38:46Z")

</div>

## we need to update rbconfig. it should also detect the runtime correctly

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 4, 2010, 2:14am UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/5 "2010-03-04T02:14:30Z")

</div>

I will set RUBY\_PLATFORM to â€œ.netâ€ and RbConfig::CONFIG[â€œarchâ€] to  
â€œuniversal-.net-2.0â€ (or â€œuniversal-.net-4.0â€ for the .NET 4 builds)

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, March 03, 2010 10:38 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

## we need to update rbconfig. it should also detect the runtime correctly

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

On Wed, Mar 3, 2010 at 7:18 PM, Will G.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
It does seem to.

Ruby Gems maintains a list of platform mappings.

See lib\ruby\site\_ruby\1.8\rubygems\platform.rb in the initialize  
method. Whatever initializes Gem::Platform seems to look at  
RUBY\_PLATFORM

C:\IronRuby\bin\>ir  
IronRuby 0.9.4.0 on .NET 2.0.50727.4927  
Copyright (c) Microsoft Corporation. All rights reserved.

> > > require ‘rubygems’  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1ec @cpu=“x86”, @os=“mswin32”, @version=“60”\>  
> > > RUBY\_PLATFORM  
> > > =\> “i386-mswin32”  
> > > p = Gem::Platform.new(‘universal-.net-3.5’)  
> > > =\> #\<Gem::Platform:0x1ee @cpu=“universal”, @os=“.net”, @version=“3.5”\>

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Wed, Mar 3, 2010 at 1:10 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Isn’t that just keying off of RUBY\_PLATFORM and other constants?

* * *

From: Shri B.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
Sent: Wednesday, March 03, 2010 9:55 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>

Subject: Re: [Ironruby-core] IronRuby version of existing gems  
It does seem like there isnâ€™t a way to distinguish between IronRuby and  
MRI.

C:\> ir.exe

> > > require “rubygems”  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1409 @cpu=“x86”, @os=“mswin32”, @version=“60”\>

JRuby otoh does seem to do something different

C:\> jruby.exe  
irb(main):001:0\> require “rubygems”  
=\> true  
irb(main):002:0\> Gem::Platform.local()  
=\> #\<Gem::Platform:0xf0 @cpu=“universal”, @os=“java”, @version=“1.6”\>

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 11:52 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

That all depends on how Gem checks the platform. If it uses the  
RUBY\_PLATFORM variable, then IronRuby needs to change what it reports  
here. Currently, it reports i386-mswin32.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Tue, Mar 2, 2010 at 1:07 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I believe JRuby is doing the 1st one, which makes sense in my opinion.  
If possible we should prefer platform == â€œironrubyâ€, (or .net, do we  
need to differentiate .net and mono?), but accept others.

JD

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Shri B.  
Sent: Tuesday, March 02, 2010 10:02 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] IronRuby version of existing gems

This brings a question to mind - what should the general approach be for  
porting existing gems to IronRuby? There could be two possible  
approaches:

1. 

```
  Create a gem with the same name (â€œwin32consoleâ€ in this case), 

```

and specify platform==â€ironrubyâ€. That way, dependent gems do not need  
to be updated, and users have to remember just one name. IronRuby will  
use the version with platform==â€ironrubyâ€, and MRI will use the one with  
platform==â€mswin32â€. So there should not be any clashes even if you use  
MRI and IronRuby on the same machine.

1. 

```
  Create a new gem like iron-term-ansicolor.

```

Any pro or cons to the two? What should the recommendation be in  
general?

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 7:47 AM  
To: ironruby-core  
Subject: Re: [Ironruby-core] iron-term-ansicolor 0.0.2 Released

I released iron-term-ansicolor 0.0.3 last night after testing the gem  
install locally first.

Please let me know if you still have trouble installing it from  
[Rubygems.org](http://Rubygems.org).

Also, I’ve submitted a patch to RSpec to use iron-term-ansicolor if it  
can, the same way it tries to use win32console under MRI.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 4, 2010, 8:45am UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/6 "2010-03-04T08:45:26Z")

</div>

Answering my own question about x86==i386, they are treated as equal:

> > > Gem::Platform.new(“i386-mingw32”) === Gem::Platform.new(“x86-mingw32”)  
> > > true

[http://rubygems.rubyforge.org/rubygems-update/Gem/Platform.html](http://rubygems.rubyforge.org/rubygems-update/Gem/Platform.html) has  
implementations of the different functions (click on the function names)

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Wednesday, March 03, 2010 6:31 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

Does anyone know if this will allow authoring of IronRuby-specific gems?  
Would the same value be used in the gemspec?

After installing win32console, I looked at  
gems\1.8\gems\specifications\win32console-1.2.0-x86-mingw32.gemspec, and  
it had this line:

s.platform = %q{x86-mingw32}

Note that this is different than the value of RbConfig::CONFIG[â€œarchâ€]  
in MRI, which is “i386-mingw32”. So not sure how exactly this works.  
Perhaps RubyGems has a special case for x86==i386?

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Wednesday, March 03, 2010 5:05 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

I will set RUBY\_PLATFORM to â€œ.netâ€ and RbConfig::CONFIG[â€œarchâ€] to  
â€œuniversal-.net-2.0â€ (or â€œuniversal-.net-4.0â€ for the .NET 4 builds)

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, March 03, 2010 10:38 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

## we need to update rbconfig. it should also detect the runtime correctly

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP  
On Wed, Mar 3, 2010 at 7:18 PM, Will G.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
It does seem to.

Ruby Gems maintains a list of platform mappings.

See lib\ruby\site\_ruby\1.8\rubygems\platform.rb in the initialize  
method. Whatever initializes Gem::Platform seems to look at  
RUBY\_PLATFORM

C:\IronRuby\bin\>ir  
IronRuby 0.9.4.0 on .NET 2.0.50727.4927  
Copyright (c) Microsoft Corporation. All rights reserved.

> > > require ‘rubygems’  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1ec @cpu=“x86”, @os=“mswin32”, @version=“60”\>  
> > > RUBY\_PLATFORM  
> > > =\> “i386-mswin32”  
> > > p = Gem::Platform.new(‘universal-.net-3.5’)  
> > > =\> #\<Gem::Platform:0x1ee @cpu=“universal”, @os=“.net”, @version=“3.5”\>

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Wed, Mar 3, 2010 at 1:10 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Isn’t that just keying off of RUBY\_PLATFORM and other constants?

* * *

From: Shri B.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
Sent: Wednesday, March 03, 2010 9:55 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>

Subject: Re: [Ironruby-core] IronRuby version of existing gems  
It does seem like there isnâ€™t a way to distinguish between IronRuby and  
MRI.

C:\> ir.exe

> > > require “rubygems”  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1409 @cpu=“x86”, @os=“mswin32”, @version=“60”\>

JRuby otoh does seem to do something different

C:\> jruby.exe  
irb(main):001:0\> require “rubygems”  
=\> true  
irb(main):002:0\> Gem::Platform.local()  
=\> #\<Gem::Platform:0xf0 @cpu=“universal”, @os=“java”, @version=“1.6”\>

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 11:52 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

That all depends on how Gem checks the platform. If it uses the  
RUBY\_PLATFORM variable, then IronRuby needs to change what it reports  
here. Currently, it reports i386-mswin32.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Tue, Mar 2, 2010 at 1:07 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I believe JRuby is doing the 1st one, which makes sense in my opinion.  
If possible we should prefer platform == â€œironrubyâ€, (or .net, do we  
need to differentiate .net and mono?), but accept others.

JD

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Shri B.  
Sent: Tuesday, March 02, 2010 10:02 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] IronRuby version of existing gems

This brings a question to mind - what should the general approach be for  
porting existing gems to IronRuby? There could be two possible  
approaches:

1. 

```
  Create a gem with the same name (â€œwin32consoleâ€ in this case), 

```

and specify platform==â€ironrubyâ€. That way, dependent gems do not need  
to be updated, and users have to remember just one name. IronRuby will  
use the version with platform==â€ironrubyâ€, and MRI will use the one with  
platform==â€mswin32â€. So there should not be any clashes even if you use  
MRI and IronRuby on the same machine.

1. 

```
  Create a new gem like iron-term-ansicolor.

```

Any pro or cons to the two? What should the recommendation be in  
general?

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 7:47 AM  
To: ironruby-core  
Subject: Re: [Ironruby-core] iron-term-ansicolor 0.0.2 Released

I released iron-term-ansicolor 0.0.3 last night after testing the gem  
install locally first.

Please let me know if you still have trouble installing it from  
[Rubygems.org](http://Rubygems.org).

Also, I’ve submitted a patch to RSpec to use iron-term-ansicolor if it  
can, the same way it tries to use win32console under MRI.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [March 4, 2010, 3:32am UTC](https://www.ruby-forum.com/t/re-ironruby-version-of-existing-gems/184514/7 "2010-03-04T03:32:21Z")

</div>

Does anyone know if this will allow authoring of IronRuby-specific gems?  
Would the same value be used in the gemspec?

After installing win32console, I looked at  
gems\1.8\gems\specifications\win32console-1.2.0-x86-mingw32.gemspec, and  
it had this line:

s.platform = %q{x86-mingw32}

Note that this is different than the value of RbConfig::CONFIG[â€œarchâ€]  
in MRI, which is “i386-mingw32”. So not sure how exactly this works.  
Perhaps RubyGems has a special case for x86==i386?

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Wednesday, March 03, 2010 5:05 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

I will set RUBY\_PLATFORM to â€œ.netâ€ and RbConfig::CONFIG[â€œarchâ€] to  
â€œuniversal-.net-2.0â€ (or â€œuniversal-.net-4.0â€ for the .NET 4 builds)

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, March 03, 2010 10:38 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

## we need to update rbconfig. it should also detect the runtime correctly

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP  
On Wed, Mar 3, 2010 at 7:18 PM, Will G.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
It does seem to.

Ruby Gems maintains a list of platform mappings.

See lib\ruby\site\_ruby\1.8\rubygems\platform.rb in the initialize  
method. Whatever initializes Gem::Platform seems to look at  
RUBY\_PLATFORM

C:\IronRuby\bin\>ir  
IronRuby 0.9.4.0 on .NET 2.0.50727.4927  
Copyright (c) Microsoft Corporation. All rights reserved.

> > > require ‘rubygems’  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1ec @cpu=“x86”, @os=“mswin32”, @version=“60”\>  
> > > RUBY\_PLATFORM  
> > > =\> “i386-mswin32”  
> > > p = Gem::Platform.new(‘universal-.net-3.5’)  
> > > =\> #\<Gem::Platform:0x1ee @cpu=“universal”, @os=“.net”, @version=“3.5”\>

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Wed, Mar 3, 2010 at 1:10 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Isn’t that just keying off of RUBY\_PLATFORM and other constants?

* * *

From: Shri B.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
Sent: Wednesday, March 03, 2010 9:55 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>

Subject: Re: [Ironruby-core] IronRuby version of existing gems  
It does seem like there isnâ€™t a way to distinguish between IronRuby and  
MRI.

C:\> ir.exe

> > > require “rubygems”  
> > > =\> true  
> > > Gem::Platform.local()  
> > > =\> #\<Gem::Platform:0x1409 @cpu=“x86”, @os=“mswin32”, @version=“60”\>

JRuby otoh does seem to do something different

C:\> jruby.exe  
irb(main):001:0\> require “rubygems”  
=\> true  
irb(main):002:0\> Gem::Platform.local()  
=\> #\<Gem::Platform:0xf0 @cpu=“universal”, @os=“java”, @version=“1.6”\>

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 11:52 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] IronRuby version of existing gems

That all depends on how Gem checks the platform. If it uses the  
RUBY\_PLATFORM variable, then IronRuby needs to change what it reports  
here. Currently, it reports i386-mswin32.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Tue, Mar 2, 2010 at 1:07 PM, Jim D.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I believe JRuby is doing the 1st one, which makes sense in my opinion.  
If possible we should prefer platform == â€œironrubyâ€, (or .net, do we  
need to differentiate .net and mono?), but accept others.

JD

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Shri B.  
Sent: Tuesday, March 02, 2010 10:02 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] IronRuby version of existing gems

This brings a question to mind - what should the general approach be for  
porting existing gems to IronRuby? There could be two possible  
approaches:

1. 

```
  Create a gem with the same name (â€œwin32consoleâ€ in this case), 

```

and specify platform==â€ironrubyâ€. That way, dependent gems do not need  
to be updated, and users have to remember just one name. IronRuby will  
use the version with platform==â€ironrubyâ€, and MRI will use the one with  
platform==â€mswin32â€. So there should not be any clashes even if you use  
MRI and IronRuby on the same machine.

1. 

```
  Create a new gem like iron-term-ansicolor.

```

Any pro or cons to the two? What should the recommendation be in  
general?

From:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
On Behalf Of Will G.  
Sent: Tuesday, March 02, 2010 7:47 AM  
To: ironruby-core  
Subject: Re: [Ironruby-core] iron-term-ansicolor 0.0.2 Released

I released iron-term-ansicolor 0.0.3 last night after testing the gem  
install locally first.

Please let me know if you still have trouble installing it from  
[Rubygems.org](http://Rubygems.org).

Also, I’ve submitted a patch to RSpec to use iron-term-ansicolor if it  
can, the same way it tries to use win32console under MRI.

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
