tfpt review "/shelveset:i-scripts;REDMOND\jimmysch" Cleans up i* scripts - only keep gem, irb, rdoc, ri; delete rack, rails, etc - rename Ruby scripts to non-i names, and keep i*.bat files (igem.bat and gem) - Fix tutorial.bat -------------- next part -------------- A non-text attachment was scrubbed... Name: i-scripts.diff Type: application/octet-stream Size: 20148 bytes Desc: i-scripts.diff URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100329/30fecb31/attachment-0001.obj>
Shri Borde
2010-Mar-29 20:39 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Ryan, fwiw, the window for getting this into the V1 release will be closing down in the next few days. -----Original Message----- Posted by Ryan Riley (Guest) on 04.03.2010 02:27 Well, I''m still trying to get my environment set up and having little luck. Still getting used to Mac OS X and *nix development. Has anyone else attempted the fix? Hopefully I''ll have this sorted soon and can get on it. Regards, Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/
Ryan Riley
2010-Mar-31 04:02 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Thanks for the update. I am working on it now and will keep you posted. Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Mon, Mar 29, 2010 at 1:39 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> Ryan, fwiw, the window for getting this into the V1 release will be closing > down in the next few days. > > -----Original Message----- > Posted by Ryan Riley (Guest) on 04.03.2010 02:27 > Well, I''m still trying to get my environment set up and having little > luck. > Still getting used to Mac OS X and *nix development. Has anyone else > attempted the fix? Hopefully I''ll have this sorted soon and can get on > it. > > Regards, > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100330/b7fa4453/attachment.html>
Ryan Riley
2010-Apr-02 23:37 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Sorry I wasn''t able to get this to you in time. I''m finally making some progress, but I won''t have it done in time for release. Ryan On Mon, Mar 29, 2010 at 1:39 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> Ryan, fwiw, the window for getting this into the V1 release will be closing > down in the next few days. > > -----Original Message----- > Posted by Ryan Riley (Guest) on 04.03.2010 02:27 > Well, I''m still trying to get my environment set up and having little > luck. > Still getting used to Mac OS X and *nix development. Has anyone else > attempted the fix? Hopefully I''ll have this sorted soon and can get on > it. > > Regards, > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100402/8ee84f2e/attachment.html>
Shri Borde
2010-Apr-03 06:04 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Thanks for the update. We can target getting this into the next bug-fix release (1.0.1). ________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] on behalf of Ryan Riley [ryan.riley at panesofglass.org] Sent: Friday, April 02, 2010 4:37 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Sorry I wasn''t able to get this to you in time. I''m finally making some progress, but I won''t have it done in time for release. Ryan On Mon, Mar 29, 2010 at 1:39 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ryan, fwiw, the window for getting this into the V1 release will be closing down in the next few days. -----Original Message----- Posted by Ryan Riley (Guest) on 04.03.2010 02:27 Well, I''m still trying to get my environment set up and having little luck. Still getting used to Mac OS X and *nix development. Has anyone else attempted the fix? Hopefully I''ll have this sorted soon and can get on it. Regards, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/f923263b/attachment.html>
Ryan Riley
2010-Apr-03 06:37 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Sounds good. I think I''m making good progress, though figuring out how to run tests is a challenge right now. Anyone run tests on linux? By the way, I finally got a good build by using Ivan''s linux branch on Mono 2.7 (trunk) using rake compile and setting the environment variables noted in the wiki docs. xbuild threw a load of errors. I think I can sort out the testing issue by figuring out from Dev.bat what paths I need to get mspec to run. Right now it''s not recognized and won''t run. Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Fri, Apr 2, 2010 at 11:04 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> Thanks for the update. We can target getting this into the next bug-fix > release (1.0.1). > > ------------------------------ > *From:* ironruby-core-bounces at rubyforge.org [ > ironruby-core-bounces at rubyforge.org] on behalf of Ryan Riley [ > ryan.riley at panesofglass.org] > *Sent:* Friday, April 02, 2010 4:37 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Sorry I wasn''t able to get this to you in time. I''m finally making some > progress, but I won''t have it done in time for release. > > Ryan > > > On Mon, Mar 29, 2010 at 1:39 PM, Shri Borde <Shri.Borde at microsoft.com>wrote: > >> Ryan, fwiw, the window for getting this into the V1 release will be >> closing down in the next few days. >> >> -----Original Message----- >> Posted by Ryan Riley (Guest) on 04.03.2010 02:27 >> Well, I''m still trying to get my environment set up and having little >> luck. >> Still getting used to Mac OS X and *nix development. Has anyone else >> attempted the fix? Hopefully I''ll have this sorted soon and can get on >> it. >> >> Regards, >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100402/c81c3391/attachment-0001.html>
Ivan Porto Carrero
2010-Apr-03 06:42 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
for xbuild you have to turn off warnings as errors with a command-line switch. ...so I think you can do MONO_IOMAP=all xbuild ./Ruby.sln /clp:warnaserror- that last command line parameter could be a little bit different but that gives the idea. You would still need mono trunk because of a bug in the compiler on 2.6.3 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Sat, Apr 3, 2010 at 8:37 AM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Sounds good. I think I''m making good progress, though figuring out how to > run tests is a challenge right now. Anyone run tests on linux? > > By the way, I finally got a good build by using Ivan''s linux branch on Mono > 2.7 (trunk) using rake compile and setting the environment variables noted > in the wiki docs. xbuild threw a load of errors. I think I can sort out the > testing issue by figuring out from Dev.bat what paths I need to get mspec to > run. Right now it''s not recognized and won''t run. > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Fri, Apr 2, 2010 at 11:04 PM, Shri Borde <Shri.Borde at microsoft.com>wrote: > >> Thanks for the update. We can target getting this into the next bug-fix >> release (1.0.1). >> >> ------------------------------ >> *From:* ironruby-core-bounces at rubyforge.org [ >> ironruby-core-bounces at rubyforge.org] on behalf of Ryan Riley [ >> ryan.riley at panesofglass.org] >> *Sent:* Friday, April 02, 2010 4:37 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Sorry I wasn''t able to get this to you in time. I''m finally making some >> progress, but I won''t have it done in time for release. >> >> Ryan >> >> >> On Mon, Mar 29, 2010 at 1:39 PM, Shri Borde <Shri.Borde at microsoft.com>wrote: >> >>> Ryan, fwiw, the window for getting this into the V1 release will be >>> closing down in the next few days. >>> >>> -----Original Message----- >>> Posted by Ryan Riley (Guest) on 04.03.2010 02:27 >>> Well, I''m still trying to get my environment set up and having little >>> luck. >>> Still getting used to Mac OS X and *nix development. Has anyone else >>> attempted the fix? Hopefully I''ll have this sorted soon and can get on >>> it. >>> >>> Regards, >>> >>> Ryan Riley >>> >>> Email: ryan.riley at panesofglass.org >>> LinkedIn: http://www.linkedin.com/in/ryanriley >>> Blog: http://wizardsofsmart.net/ >>> Twitter: @panesofglass >>> Website: http://panesofglass.org/ >>> _______________________________________________ >>> Ironruby-core mailing list >>> Ironruby-core at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/dc6ea209/attachment.html>
Ryan Riley
2010-Apr-03 07:11 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/dc2feadf/attachment.html>
Jim Deville
2010-Apr-03 18:00 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/3e614cc1/attachment.html>
Tomas Matousek
2010-Apr-03 18:25 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/2348492c/attachment.html>
Ryan Riley
2010-Apr-03 21:30 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote:> Can you give an example of where you need the conversions? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville > *Sent:* Saturday, April 03, 2010 11:00 AM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. > I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside > that file is a to_clr_array method > > JD > > ------------------------------ > > *From: *Ryan Riley <ryan.riley at panesofglass.org> > *Sent: *Saturday, April 03, 2010 12:13 AM > *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I can get > RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/c473a9a2/attachment-0001.html>
Ryan Riley
2010-Apr-03 21:32 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Does a clr_array map to a Ruby Array? Ryan Riley On Sat, Apr 3, 2010 at 11:00 AM, Jim Deville <jdeville at microsoft.com> wrote:> > No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. > I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside > that file is a to_clr_array method > > JD > > > ------------------------------ > From: Ryan Riley <ryan.riley at panesofglass.org> > Sent: Saturday, April 03, 2010 12:13 AM > To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module > for Mono? > > Where is documentation on converting between CLR and Ruby types? I can > get RubyStrings, but what about Fixnum and Array? > > Thanks, > > Ryan Riley > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/738d90c6/attachment.html>
Ryan Riley
2010-Apr-03 22:58 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb <http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and > Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the > Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is > no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as > System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum > as the type, and I was trying to get the correct types back from the > functions. That leaves MRI''s Array to Mono''s System.String[]. > > My current implementation is just a Ruby module wrapping calls to the Mono > functions and returning the appropriate types. Most of it is working, though > without being able to run tests easily, I''m testing from the command line. I > still need to add conditionals to return nil if it''s run on Windows. I > suppose I also need to conditionally load the Mono.Posix.dll if it''s on > Windows, too. > > I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve > already got what I finished last night up there.) I also asked Shri for a > pairing session to make sure it''s inline with what you''re wanting. > > Cheers, > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > >> Can you give an example of where you need the conversions? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville >> *Sent:* Saturday, April 03, 2010 11:00 AM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> >> No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. >> I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside >> that file is a to_clr_array method >> >> JD >> >> ------------------------------ >> >> *From: *Ryan Riley <ryan.riley at panesofglass.org> >> *Sent: *Saturday, April 03, 2010 12:13 AM >> *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> >> *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Where is documentation on converting between CLR and Ruby types? I can get >> RubyStrings, but what about Fixnum and Array? >> >> >> >> Thanks, >> >> >> Ryan Riley >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/fc5d86d8/attachment.html>
Tomas Matousek
2010-Apr-03 23:43 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/64c61285/attachment-0001.html>
Ryan Riley
2010-Apr-03 23:49 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
I was hoping for just such pointers, thanks! I will try to get this updated tonight. Ryan Sent from my iPhone On Apr 3, 2010, at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:> Nice work. > > > > A few suggestions: > > > > - You can move the file to C:\M0\Merlin\Main\Languages\Ruby > \Libs. > > - Use System::Environment:: > System::Environment.OSVersion.Platform to detect the OS (see e.g. > Win32API.rb in Libs). > > - Rather than check for the platform in every method it > might be better to define the methods differently on Windows. > Something like: > > > > module Etc > > platform = System::PlatformID > > case System::Environment.OSVersion.Platform > > when platform.Win32S, platform.WinCE, platform.Win32Windows, > platform.Win32NT: > > def self.endgrent; end > def self.endpwent; end > > def self.getgrent; end > > ? > > else > > load_assembly ''Mono.Posix'' > > > def self.endgrent > Mono::Unix::Native::Syscall.endgrent > end > > def self.endpwent > Mono::Unix::Native::Syscall.endpwent > end > > def self.getgrent > to_group(Mono::Unix::Native::Syscall.getgrent) > end > > ? > end > > end > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ryan Riley > Sent: Saturday, April 03, 2010 3:59 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted an initial "complete" implementation, though I have only > done basic testing. I have a couple of TODO''s remaining and some > cleanup, as well as writing actual specs. I still don''t have tests > running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb > > > > Not the prettiest thing in the world, but I just wanted to get it > working. I definitely still have work to do. > > > > Cheers, > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org > > wrote: > > Sure! Mono::Unix::Native::Passwd and Mono::Unix::Native::Group that > are returned from the Mono::Unix::Native::Syscall functions have > UInt32, System.String, and System.String[]. System.String is no > biggie, and I''m finding .to_i on a System.UInt32 is still displayed > as System.UInt32, so I suppose that''s not an issue, either. MRI > displays Fixnum as the type, and I was trying to get the correct > types back from the functions. That leaves MRI''s Array to Mono''s > System.String[]. > > > > My current implementation is just a Ruby module wrapping calls to > the Mono functions and returning the appropriate types. Most of it > is working, though without being able to run tests easily, I''m > testing from the command line. I still need to add conditionals to > return nil if it''s run on Windows. I suppose I also need to > conditionally load the Mono.Posix.dll if it''s on Windows, too. > > > > I''m about to finish the basic implementation and post to github. > (I''ve already got what I finished last night up there.) I also asked > Shri for a pairing session to make sure it''s inline with what you''re > wanting. > > > > Cheers, > > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com > > wrote: > > Can you give an example of where you need the conversions? > > > > Tomas > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Saturday, April 03, 2010 11:00 AM > > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are > harder. I would take a look at clr_ext in merlin/main/languages/ruby/ > samples. Inside that file is a to_clr_array method > > JD > > From: Ryan Riley <ryan.riley at panesofglass.org> > Sent: Saturday, April 03, 2010 12:13 AM > To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I > can get RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/d90cc98f/attachment.html>
Ryan Riley
2010-Apr-04 00:02 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:> Nice work. > > > > A few suggestions: > > > > - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. > > - Use System::Environment:: System::Environment.OSVersion.Platform > to detect the OS (see e.g. Win32API.rb in Libs). > > - Rather than check for the platform in every method it might be > better to define the methods differently on Windows. Something like: > > > > module Etc > > platform = System::PlatformID > > case System::Environment.OSVersion.Platform > > when platform.Win32S, platform.WinCE, platform.Win32Windows, > platform.Win32NT: > > def self.endgrent; end > > def self.endpwent; end > > def self.getgrent; end > > ? > > else > > load_assembly ''Mono.Posix'' > > > > def self.endgrent > > Mono::Unix::Native::Syscall.endgrent > > end > > > > def self.endpwent > > Mono::Unix::Native::Syscall.endpwent > > end > > > > def self.getgrent > > to_group(Mono::Unix::Native::Syscall.getgrent) > > > end > > > > ? > > end > > end > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Saturday, April 03, 2010 3:59 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted an initial "complete" implementation, though I have only done > basic testing. I have a couple of TODO''s remaining and some cleanup, as well > as writing actual specs. I still don''t have tests running. You can find the > module here: > http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb > > > > Not the prettiest thing in the world, but I just wanted to get it working. > I definitely still have work to do. > > > > Cheers, > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> > wrote: > > Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and > Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the > Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is > no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as > System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum > as the type, and I was trying to get the correct types back from the > functions. That leaves MRI''s Array to Mono''s System.String[]. > > > > My current implementation is just a Ruby module wrapping calls to the Mono > functions and returning the appropriate types. Most of it is working, though > without being able to run tests easily, I''m testing from the command line. I > still need to add conditionals to return nil if it''s run on Windows. I > suppose I also need to conditionally load the Mono.Posix.dll if it''s on > Windows, too. > > > > I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve > already got what I finished last night up there.) I also asked Shri for a > pairing session to make sure it''s inline with what you''re wanting. > > > > Cheers, > > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > Can you give an example of where you need the conversions? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville > *Sent:* Saturday, April 03, 2010 11:00 AM > > > *To:* ironruby-core at rubyforge.org > > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. > I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside > that file is a to_clr_array method > > JD > ------------------------------ > > *From: *Ryan Riley <ryan.riley at panesofglass.org> > *Sent: *Saturday, April 03, 2010 12:13 AM > *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I can get > RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/921d5b63/attachment-0001.html>
Ryan Riley
2010-Apr-04 00:48 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Nm ... I just made the changes and committed to my linux branch. I''ll work on tests, rebasing, etc. tonight. http://github.com/panesofglass/ironruby/blob/linux/Merlin/Main/Languages/Ruby/Libs/etc.rb Cheers, Ryan Riley On Sat, Apr 3, 2010 at 5:02 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Quick question: The etc.rb in Libs is a class, but the implementation in > the Ruby Standard Library appears to be a module. Should I keep the class or > use the module? > > Ryan Riley > > > > On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > >> Nice work. >> >> >> >> A few suggestions: >> >> >> >> - You can move the file to >> C:\M0\Merlin\Main\Languages\Ruby\Libs. >> >> - Use System::Environment:: System::Environment.OSVersion.Platform >> to detect the OS (see e.g. Win32API.rb in Libs). >> >> - Rather than check for the platform in every method it might be >> better to define the methods differently on Windows. Something like: >> >> >> >> module Etc >> >> platform = System::PlatformID >> >> case System::Environment.OSVersion.Platform >> >> when platform.Win32S, platform.WinCE, platform.Win32Windows, >> platform.Win32NT: >> >> def self.endgrent; end >> >> def self.endpwent; end >> >> def self.getgrent; end >> >> ? >> >> else >> >> load_assembly ''Mono.Posix'' >> >> >> >> def self.endgrent >> >> Mono::Unix::Native::Syscall.endgrent >> >> end >> >> >> >> def self.endpwent >> >> Mono::Unix::Native::Syscall.endpwent >> >> end >> >> >> >> def self.getgrent >> >> to_group(Mono::Unix::Native::Syscall.getgrent) >> >> >> end >> >> >> >> ? >> >> end >> >> end >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 3:59 PM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted an initial "complete" implementation, though I have only done >> basic testing. I have a couple of TODO''s remaining and some cleanup, as well >> as writing actual specs. I still don''t have tests running. You can find the >> module here: >> http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb >> >> >> >> Not the prettiest thing in the world, but I just wanted to get it working. >> I definitely still have work to do. >> >> >> >> Cheers, >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >> >> Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and >> Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the >> Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is >> no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as >> System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum >> as the type, and I was trying to get the correct types back from the >> functions. That leaves MRI''s Array to Mono''s System.String[]. >> >> >> >> My current implementation is just a Ruby module wrapping calls to the Mono >> functions and returning the appropriate types. Most of it is working, though >> without being able to run tests easily, I''m testing from the command line. I >> still need to add conditionals to return nil if it''s run on Windows. I >> suppose I also need to conditionally load the Mono.Posix.dll if it''s on >> Windows, too. >> >> >> >> I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve >> already got what I finished last night up there.) I also asked Shri for a >> pairing session to make sure it''s inline with what you''re wanting. >> >> >> >> Cheers, >> >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Can you give an example of where you need the conversions? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville >> *Sent:* Saturday, April 03, 2010 11:00 AM >> >> >> *To:* ironruby-core at rubyforge.org >> >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> >> No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. >> I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside >> that file is a to_clr_array method >> >> JD >> ------------------------------ >> >> *From: *Ryan Riley <ryan.riley at panesofglass.org> >> *Sent: *Saturday, April 03, 2010 12:13 AM >> *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> >> *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Where is documentation on converting between CLR and Ruby types? I can get >> RubyStrings, but what about Fixnum and Array? >> >> >> >> Thanks, >> >> >> Ryan Riley >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100403/e83dcd20/attachment.html>
Tomas Matousek
2010-Apr-04 01:00 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
That is a bug. Make it a module. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 5:02 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/2f8cfa98/attachment-0001.html>
Jim Deville
2010-Apr-04 05:13 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Also, to get a Int32 out of a UInt32, you should be able to use induced_from:>>> a = System::UInt32.new(1)=> 1 (UInt32)>>> Fixnum.induced_from(a)=> 1 Minor thing, but it will work. The fact that etc is a class is my bad. I was just getting enough implemented in order to pass some specs and use libraries that expected the nil on Windows. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Saturday, April 03, 2010 6:01 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? That is a bug. Make it a module. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 5:02 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/e96c9230/attachment-0001.html>
Ryan Riley
2010-Apr-04 16:53 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
I''ve posted all the type fixes, but since I can''t compile master, I''m hesitant to rebase. What should I do? Also, I still haven''t gotten to the tests. Looks like the current ones all expect nil and assume Windows. Are those the real rubyspec specs? Sent from my iPhone On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote:> Also, to get a Int32 out of a UInt32, you should be able to use > induced_from: > > > > >>> a = System::UInt32.new(1) > > => 1 (UInt32) > > >>> Fixnum.induced_from(a) > > => 1 > > > > Minor thing, but it will work. > > > > The fact that etc is a class is my bad. I was just getting enough > implemented in order to pass some specs and use libraries that > expected the nil on Windows. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Tomas Matousek > Sent: Saturday, April 03, 2010 6:01 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > That is a bug. Make it a module. > > > > Tomas > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ryan Riley > Sent: Saturday, April 03, 2010 5:02 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > Quick question: The etc.rb in Libs is a class, but the > implementation in the Ruby Standard Library appears to be a module. > Should I keep the class or use the module? > > > Ryan Riley > > On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com > > wrote: > > Nice work. > > > > A few suggestions: > > > > - You can move the file to C:\M0\Merlin\Main\Languages\Ruby > \Libs. > > - Use System::Environment:: > System::Environment.OSVersion.Platform to detect the OS (see e.g. > Win32API.rb in Libs). > > - Rather than check for the platform in every method it > might be better to define the methods differently on Windows. > Something like: > > > > module Etc > > platform = System::PlatformID > > case System::Environment.OSVersion.Platform > > when platform.Win32S, platform.WinCE, platform.Win32Windows, > platform.Win32NT: > > def self.endgrent; end > def self.endpwent; end > > def self.getgrent; end > > ? > > else > > load_assembly ''Mono.Posix'' > > > def self.endgrent > Mono::Unix::Native::Syscall.endgrent > end > > def self.endpwent > Mono::Unix::Native::Syscall.endpwent > end > > def self.getgrent > to_group(Mono::Unix::Native::Syscall.getgrent) > > > end > > ? > end > > end > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ryan Riley > Sent: Saturday, April 03, 2010 3:59 PM > > > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted an initial "complete" implementation, though I have only > done basic testing. I have a couple of TODO''s remaining and some > cleanup, as well as writing actual specs. I still don''t have tests > running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb > > > > Not the prettiest thing in the world, but I just wanted to get it > working. I definitely still have work to do. > > > > Cheers, > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org > > wrote: > > Sure! Mono::Unix::Native::Passwd and Mono::Unix::Native::Group that > are returned from the Mono::Unix::Native::Syscall functions have > UInt32, System.String, and System.String[]. System.String is no > biggie, and I''m finding .to_i on a System.UInt32 is still displayed > as System.UInt32, so I suppose that''s not an issue, either. MRI > displays Fixnum as the type, and I was trying to get the correct > types back from the functions. That leaves MRI''s Array to Mono''s > System.String[]. > > > > My current implementation is just a Ruby module wrapping calls to > the Mono functions and returning the appropriate types. Most of it > is working, though without being able to run tests easily, I''m > testing from the command line. I still need to add conditionals to > return nil if it''s run on Windows. I suppose I also need to > conditionally load the Mono.Posix.dll if it''s on Windows, too. > > > > I''m about to finish the basic implementation and post to github. > (I''ve already got what I finished last night up there.) I also asked > Shri for a pairing session to make sure it''s inline with what you''re > wanting. > > > > Cheers, > > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com > > wrote: > > Can you give an example of where you need the conversions? > > > > Tomas > > > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Saturday, April 03, 2010 11:00 AM > > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are > harder. I would take a look at clr_ext in merlin/main/languages/ruby/ > samples. Inside that file is a to_clr_array method > > JD > > From: Ryan Riley <ryan.riley at panesofglass.org> > Sent: Saturday, April 03, 2010 12:13 AM > To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I > can get RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/39171e55/attachment-0001.html>
Shri Borde
2010-Apr-04 17:55 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
If you run ?mspec ci library\etc?, that runs the real RubySpec specs. irtests does run a command like ?mspec ci lib? which will run the Etc RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might be useful to you about how these scripts work. The RubySpecs are supposed to be working on all platforms. The specs use checks like ?platform_is :windows? or ?platform_is_not :windows? to have versions for all OSes. I am surprised that the current ones expect nil. You can fix them to have versions of the specs that work on Unixes. You can run the tests against MRI using ?mspec ?tr? to ensure that the spec you add is correct. If you can streamline the development process for Mono, that will be great so others have an easier time in the future? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Sunday, April 04, 2010 9:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted all the type fixes, but since I can''t compile master, I''m hesitant to rebase. What should I do? Also, I still haven''t gotten to the tests. Looks like the current ones all expect nil and assume Windows. Are those the real rubyspec specs? Sent from my iPhone On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com<mailto:jdeville at microsoft.com>> wrote: Also, to get a Int32 out of a UInt32, you should be able to use induced_from:>>> a = System::UInt32.new(1)=> 1 (UInt32)>>> Fixnum.induced_from(a)=> 1 Minor thing, but it will work. The fact that etc is a class is my bad. I was just getting enough implemented in order to pass some specs and use libraries that expected the nil on Windows. JD From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Saturday, April 03, 2010 6:01 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? That is a bug. Make it a module. Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 5:02 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/dd731e6e/attachment-0001.html>
Jim Deville
2010-Apr-04 18:23 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Most of the libraries are still poorly specced. I actually wrote most of the current etc ones in order to get them passing. If you look around though, you can find places in the lib specs that are empty files :( ________________________________ From: Shri Borde <Shri.Borde at microsoft.com> Sent: Sunday, April 04, 2010 10:58 AM To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? If you run ?mspec ci library\etc?, that runs the real RubySpec specs. irtests does run a command like ?mspec ci lib? which will run the Etc RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might be useful to you about how these scripts work. The RubySpecs are supposed to be working on all platforms. The specs use checks like ?platform_is :windows? or ?platform_is_not :windows? to have versions for all OSes. I am surprised that the current ones expect nil. You can fix them to have versions of the specs that work on Unixes. You can run the tests against MRI using ?mspec ?tr? to ensure that the spec you add is correct. If you can streamline the development process for Mono, that will be great so others have an easier time in the future? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Sunday, April 04, 2010 9:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted all the type fixes, but since I can''t compile master, I''m hesitant to rebase. What should I do? Also, I still haven''t gotten to the tests. Looks like the current ones all expect nil and assume Windows. Are those the real rubyspec specs? Sent from my iPhone On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com<mailto:jdeville at microsoft.com>> wrote: Also, to get a Int32 out of a UInt32, you should be able to use induced_from:>>> a = System::UInt32.new(1)=> 1 (UInt32)>>> Fixnum.induced_from(a)=> 1 Minor thing, but it will work. The fact that etc is a class is my bad. I was just getting enough implemented in order to pass some specs and use libraries that expected the nil on Windows. JD From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Saturday, April 03, 2010 6:01 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? That is a bug. Make it a module. Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 5:02 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/71e53f39/attachment-0001.html>
Ryan Riley
2010-Apr-05 01:32 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Thanks, Shri. The problem is that I cannot run mspec at all. I have added it to my path, but I get a message saying thtat the command can''t be found, even while in the bin folder. (And yes, the files are executable. :) I''ll keep trying to determine what''s wrong, but I would think this should just work. In other news, I was able to get master built on linux using rake compile. I''ve checked this into my copy of master on github, along with the etc.rb updates and Ivan''s dev.sh script. I can write the additional test cases, but they should also work now on windows. I''m about to pull and try it myself. Cheers! Ryan Riley On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com>wrote:> If you run ?mspec ci library\etc?, that runs the real RubySpec specs. > irtests does run a command like ?mspec ci lib? which will run the Etc > RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might be > useful to you about how these scripts work. > > > > The RubySpecs are supposed to be working on all platforms. The specs use > checks like ?platform_is :windows? or ?platform_is_not :windows? to have > versions for all OSes. I am surprised that the current ones expect nil. You > can fix them to have versions of the specs that work on Unixes. You can run > the tests against MRI using ?mspec ?tr? to ensure that the spec you add is > correct. > > > > If you can streamline the development process for Mono, that will be great > so others have an easier time in the future? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Sunday, April 04, 2010 9:54 AM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted all the type fixes, but since I can''t compile master, I''m > hesitant to rebase. What should I do? Also, I still haven''t gotten to the > tests. Looks like the current ones all expect nil and assume Windows. Are > those the real rubyspec specs? > > Sent from my iPhone > > > On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote: > > Also, to get a Int32 out of a UInt32, you should be able to use > induced_from: > > > > >>> a = System::UInt32.new(1) > > => 1 (UInt32) > > >>> Fixnum.induced_from(a) > > => 1 > > > > Minor thing, but it will work. > > > > The fact that etc is a class is my bad. I was just getting enough > implemented in order to pass some specs and use libraries that expected the > nil on Windows. > > > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek > *Sent:* Saturday, April 03, 2010 6:01 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > That is a bug. Make it a module. > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Saturday, April 03, 2010 5:02 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > Quick question: The etc.rb in Libs is a class, but the implementation in > the Ruby Standard Library appears to be a module. Should I keep the class or > use the module? > > > Ryan Riley > > On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > Nice work. > > > > A few suggestions: > > > > - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. > > - Use System::Environment:: System::Environment.OSVersion.Platform > to detect the OS (see e.g. Win32API.rb in Libs). > > - Rather than check for the platform in every method it might be > better to define the methods differently on Windows. Something like: > > > > module Etc > > platform = System::PlatformID > > case System::Environment.OSVersion.Platform > > when platform.Win32S, platform.WinCE, platform.Win32Windows, > platform.Win32NT: > > def self.endgrent; end > > def self.endpwent; end > > def self.getgrent; end > > ? > > else > > load_assembly ''Mono.Posix'' > > > > def self.endgrent > > Mono::Unix::Native::Syscall.endgrent > > end > > > > def self.endpwent > > Mono::Unix::Native::Syscall.endpwent > > end > > > > > def self.getgrent > > to_group(Mono::Unix::Native::Syscall.getgrent) > > > > > > end > > > > ? > > end > > end > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Saturday, April 03, 2010 3:59 PM > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted an initial "complete" implementation, though I have only done > basic testing. I have a couple of TODO''s remaining and some cleanup, as well > as writing actual specs. I still don''t have tests running. You can find the > module here: > http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb > > > > Not the prettiest thing in the world, but I just wanted to get it working. > I definitely still have work to do. > > > > Cheers, > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> > wrote: > > Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and > Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the > Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is > no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as > System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum > as the type, and I was trying to get the correct types back from the > functions. That leaves MRI''s Array to Mono''s System.String[]. > > > > My current implementation is just a Ruby module wrapping calls to the Mono > functions and returning the appropriate types. Most of it is working, though > without being able to run tests easily, I''m testing from the command line. I > still need to add conditionals to return nil if it''s run on Windows. I > suppose I also need to conditionally load the Mono.Posix.dll if it''s on > Windows, too. > > > > I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve > already got what I finished last night up there.) I also asked Shri for a > pairing session to make sure it''s inline with what you''re wanting. > > > > Cheers, > > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > Can you give an example of where you need the conversions? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville > *Sent:* Saturday, April 03, 2010 11:00 AM > > > *To:* ironruby-core at rubyforge.org > > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. > I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside > that file is a to_clr_array method > > JD > ------------------------------ > > *From: *Ryan Riley <ryan.riley at panesofglass.org> > *Sent: *Saturday, April 03, 2010 12:13 AM > *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I can get > RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/3b3091e2/attachment-0001.html>
Ryan Riley
2010-Apr-05 01:49 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Here''s the error I get with xbuild: Errors: /home/ryan/dev/ironruby/Merlin/Main/Languages/Ruby/Ruby.sln (default targets) -> (ValidateSolutionConfiguration target) -> : error : Error initializing task Message: Not registered task Message. 14 Warning(s) 1 Error(s) Time Elapsed 00:00:00.1908000 Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sun, Apr 4, 2010 at 6:32 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Thanks, Shri. The problem is that I cannot run mspec at all. I have added > it to my path, but I get a message saying thtat the command can''t be found, > even while in the bin folder. (And yes, the files are executable. :) I''ll > keep trying to determine what''s wrong, but I would think this should just > work. > > In other news, I was able to get master built on linux using rake compile. > I''ve checked this into my copy of master on github, along with the etc.rb > updates and Ivan''s dev.sh script. I can write the additional test cases, but > they should also work now on windows. I''m about to pull and try it myself. > > Cheers! > > Ryan Riley > > > > On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com>wrote: > >> If you run ?mspec ci library\etc?, that runs the real RubySpec specs. >> irtests does run a command like ?mspec ci lib? which will run the Etc >> RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might >> be useful to you about how these scripts work. >> >> >> >> The RubySpecs are supposed to be working on all platforms. The specs use >> checks like ?platform_is :windows? or ?platform_is_not :windows? to have >> versions for all OSes. I am surprised that the current ones expect nil. You >> can fix them to have versions of the specs that work on Unixes. You can run >> the tests against MRI using ?mspec ?tr? to ensure that the spec you add is >> correct. >> >> >> >> If you can streamline the development process for Mono, that will be great >> so others have an easier time in the future? >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Sunday, April 04, 2010 9:54 AM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted all the type fixes, but since I can''t compile master, I''m >> hesitant to rebase. What should I do? Also, I still haven''t gotten to the >> tests. Looks like the current ones all expect nil and assume Windows. Are >> those the real rubyspec specs? >> >> Sent from my iPhone >> >> >> On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote: >> >> Also, to get a Int32 out of a UInt32, you should be able to use >> induced_from: >> >> >> >> >>> a = System::UInt32.new(1) >> >> => 1 (UInt32) >> >> >>> Fixnum.induced_from(a) >> >> => 1 >> >> >> >> Minor thing, but it will work. >> >> >> >> The fact that etc is a class is my bad. I was just getting enough >> implemented in order to pass some specs and use libraries that expected the >> nil on Windows. >> >> >> >> JD >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek >> *Sent:* Saturday, April 03, 2010 6:01 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> That is a bug. Make it a module. >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 5:02 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> Quick question: The etc.rb in Libs is a class, but the implementation in >> the Ruby Standard Library appears to be a module. Should I keep the class or >> use the module? >> >> >> Ryan Riley >> >> On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Nice work. >> >> >> >> A few suggestions: >> >> >> >> - You can move the file to >> C:\M0\Merlin\Main\Languages\Ruby\Libs. >> >> - Use System::Environment:: System::Environment.OSVersion.Platform >> to detect the OS (see e.g. Win32API.rb in Libs). >> >> - Rather than check for the platform in every method it might be >> better to define the methods differently on Windows. Something like: >> >> >> >> module Etc >> >> platform = System::PlatformID >> >> case System::Environment.OSVersion.Platform >> >> when platform.Win32S, platform.WinCE, platform.Win32Windows, >> platform.Win32NT: >> >> def self.endgrent; end >> >> def self.endpwent; end >> >> def self.getgrent; end >> >> ? >> >> else >> >> load_assembly ''Mono.Posix'' >> >> >> >> def self.endgrent >> >> Mono::Unix::Native::Syscall.endgrent >> >> end >> >> >> >> def self.endpwent >> >> Mono::Unix::Native::Syscall.endpwent >> >> end >> >> >> >> >> def self.getgrent >> >> to_group(Mono::Unix::Native::Syscall.getgrent) >> >> >> >> >> >> end >> >> >> >> ? >> >> end >> >> end >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 3:59 PM >> >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted an initial "complete" implementation, though I have only done >> basic testing. I have a couple of TODO''s remaining and some cleanup, as well >> as writing actual specs. I still don''t have tests running. You can find the >> module here: >> http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb >> >> >> >> Not the prettiest thing in the world, but I just wanted to get it working. >> I definitely still have work to do. >> >> >> >> Cheers, >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >> >> Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and >> Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the >> Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername%28System.Int32>functions have UInt32, System.String, and System.String[]. System.String is >> no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as >> System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum >> as the type, and I was trying to get the correct types back from the >> functions. That leaves MRI''s Array to Mono''s System.String[]. >> >> >> >> My current implementation is just a Ruby module wrapping calls to the Mono >> functions and returning the appropriate types. Most of it is working, though >> without being able to run tests easily, I''m testing from the command line. I >> still need to add conditionals to return nil if it''s run on Windows. I >> suppose I also need to conditionally load the Mono.Posix.dll if it''s on >> Windows, too. >> >> >> >> I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve >> already got what I finished last night up there.) I also asked Shri for a >> pairing session to make sure it''s inline with what you''re wanting. >> >> >> >> Cheers, >> >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Can you give an example of where you need the conversions? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville >> *Sent:* Saturday, April 03, 2010 11:00 AM >> >> >> *To:* ironruby-core at rubyforge.org >> >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> >> No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. >> I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside >> that file is a to_clr_array method >> >> JD >> ------------------------------ >> >> *From: *Ryan Riley <ryan.riley at panesofglass.org> >> *Sent: *Saturday, April 03, 2010 12:13 AM >> *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> >> *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Where is documentation on converting between CLR and Ruby types? I can get >> RubyStrings, but what about Fixnum and Array? >> >> >> >> Thanks, >> >> >> Ryan Riley >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/6ef86e4d/attachment-0001.html>
Ryan Riley
2010-Apr-05 02:33 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Nm... I figured out that dev.sh, despite the command to export to PATH was not. I''m working on rubyspecs now. Do I put these in the rubyspec git repo or in the IR copy (MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec)? Ryan On Sun, Apr 4, 2010 at 6:32 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Thanks, Shri. The problem is that I cannot run mspec at all. I have added > it to my path, but I get a message saying thtat the command can''t be found, > even while in the bin folder. (And yes, the files are executable. :) I''ll > keep trying to determine what''s wrong, but I would think this should just > work. > > In other news, I was able to get master built on linux using rake compile. > I''ve checked this into my copy of master on github, along with the etc.rb > updates and Ivan''s dev.sh script. I can write the additional test cases, but > they should also work now on windows. I''m about to pull and try it myself. > > Cheers! > > Ryan Riley > > > > On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com>wrote: > >> If you run ?mspec ci library\etc?, that runs the real RubySpec specs. >> irtests does run a command like ?mspec ci lib? which will run the Etc >> RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might >> be useful to you about how these scripts work. >> >> >> >> The RubySpecs are supposed to be working on all platforms. The specs use >> checks like ?platform_is :windows? or ?platform_is_not :windows? to have >> versions for all OSes. I am surprised that the current ones expect nil. You >> can fix them to have versions of the specs that work on Unixes. You can run >> the tests against MRI using ?mspec ?tr? to ensure that the spec you add is >> correct. >> >> >> >> If you can streamline the development process for Mono, that will be great >> so others have an easier time in the future? >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Sunday, April 04, 2010 9:54 AM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted all the type fixes, but since I can''t compile master, I''m >> hesitant to rebase. What should I do? Also, I still haven''t gotten to the >> tests. Looks like the current ones all expect nil and assume Windows. Are >> those the real rubyspec specs? >> >> Sent from my iPhone >> >> >> On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote: >> >> Also, to get a Int32 out of a UInt32, you should be able to use >> induced_from: >> >> >> >> >>> a = System::UInt32.new(1) >> >> => 1 (UInt32) >> >> >>> Fixnum.induced_from(a) >> >> => 1 >> >> >> >> Minor thing, but it will work. >> >> >> >> The fact that etc is a class is my bad. I was just getting enough >> implemented in order to pass some specs and use libraries that expected the >> nil on Windows. >> >> >> >> JD >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek >> *Sent:* Saturday, April 03, 2010 6:01 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> That is a bug. Make it a module. >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 5:02 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> Quick question: The etc.rb in Libs is a class, but the implementation in >> the Ruby Standard Library appears to be a module. Should I keep the class or >> use the module? >> >> >> Ryan Riley >> >> On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Nice work. >> >> >> >> A few suggestions: >> >> >> >> - You can move the file to >> C:\M0\Merlin\Main\Languages\Ruby\Libs. >> >> - Use System::Environment:: System::Environment.OSVersion.Platform >> to detect the OS (see e.g. Win32API.rb in Libs). >> >> - Rather than check for the platform in every method it might be >> better to define the methods differently on Windows. Something like: >> >> >> >> module Etc >> >> platform = System::PlatformID >> >> case System::Environment.OSVersion.Platform >> >> when platform.Win32S, platform.WinCE, platform.Win32Windows, >> platform.Win32NT: >> >> def self.endgrent; end >> >> def self.endpwent; end >> >> def self.getgrent; end >> >> ? >> >> else >> >> load_assembly ''Mono.Posix'' >> >> >> >> def self.endgrent >> >> Mono::Unix::Native::Syscall.endgrent >> >> end >> >> >> >> def self.endpwent >> >> Mono::Unix::Native::Syscall.endpwent >> >> end >> >> >> >> >> def self.getgrent >> >> to_group(Mono::Unix::Native::Syscall.getgrent) >> >> >> >> >> >> end >> >> >> >> ? >> >> end >> >> end >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 3:59 PM >> >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted an initial "complete" implementation, though I have only done >> basic testing. I have a couple of TODO''s remaining and some cleanup, as well >> as writing actual specs. I still don''t have tests running. You can find the >> module here: >> http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb >> >> >> >> Not the prettiest thing in the world, but I just wanted to get it working. >> I definitely still have work to do. >> >> >> >> Cheers, >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >> >> Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and >> Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the >> Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is >> no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as >> System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum >> as the type, and I was trying to get the correct types back from the >> functions. That leaves MRI''s Array to Mono''s System.String[]. >> >> >> >> My current implementation is just a Ruby module wrapping calls to the Mono >> functions and returning the appropriate types. Most of it is working, though >> without being able to run tests easily, I''m testing from the command line. I >> still need to add conditionals to return nil if it''s run on Windows. I >> suppose I also need to conditionally load the Mono.Posix.dll if it''s on >> Windows, too. >> >> >> >> I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve >> already got what I finished last night up there.) I also asked Shri for a >> pairing session to make sure it''s inline with what you''re wanting. >> >> >> >> Cheers, >> >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Can you give an example of where you need the conversions? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville >> *Sent:* Saturday, April 03, 2010 11:00 AM >> >> >> *To:* ironruby-core at rubyforge.org >> >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> >> No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. >> I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside >> that file is a to_clr_array method >> >> JD >> ------------------------------ >> >> *From: *Ryan Riley <ryan.riley at panesofglass.org> >> *Sent: *Saturday, April 03, 2010 12:13 AM >> *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> >> *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Where is documentation on converting between CLR and Ruby types? I can get >> RubyStrings, but what about Fixnum and Array? >> >> >> >> Thanks, >> >> >> Ryan Riley >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/1002e598/attachment-0001.html>
Shri Borde
2010-Apr-05 05:29 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
You should add new/updated specs to MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec so that all IronRuby devs will immediately start running the new/updated specs (after your changes get pulled into the IronRuby master repo). Jim will then periodically push these back to the RubySpec git repo. He also does pull periodically from the RubySpec repo into MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Sunday, April 04, 2010 7:33 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Nm... I figured out that dev.sh, despite the command to export to PATH was not. I''m working on rubyspecs now. Do I put these in the rubyspec git repo or in the IR copy (MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec)? Ryan On Sun, Apr 4, 2010 at 6:32 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Thanks, Shri. The problem is that I cannot run mspec at all. I have added it to my path, but I get a message saying thtat the command can''t be found, even while in the bin folder. (And yes, the files are executable. :) I''ll keep trying to determine what''s wrong, but I would think this should just work. In other news, I was able to get master built on linux using rake compile. I''ve checked this into my copy of master on github, along with the etc.rb updates and Ivan''s dev.sh script. I can write the additional test cases, but they should also work now on windows. I''m about to pull and try it myself. Cheers! Ryan Riley On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: If you run ?mspec ci library\etc?, that runs the real RubySpec specs. irtests does run a command like ?mspec ci lib? which will run the Etc RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might be useful to you about how these scripts work. The RubySpecs are supposed to be working on all platforms. The specs use checks like ?platform_is :windows? or ?platform_is_not :windows? to have versions for all OSes. I am surprised that the current ones expect nil. You can fix them to have versions of the specs that work on Unixes. You can run the tests against MRI using ?mspec ?tr? to ensure that the spec you add is correct. If you can streamline the development process for Mono, that will be great so others have an easier time in the future? From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Sunday, April 04, 2010 9:54 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted all the type fixes, but since I can''t compile master, I''m hesitant to rebase. What should I do? Also, I still haven''t gotten to the tests. Looks like the current ones all expect nil and assume Windows. Are those the real rubyspec specs? Sent from my iPhone On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com<mailto:jdeville at microsoft.com>> wrote: Also, to get a Int32 out of a UInt32, you should be able to use induced_from:>>> a = System::UInt32.new(1)=> 1 (UInt32)>>> Fixnum.induced_from(a)=> 1 Minor thing, but it will work. The fact that etc is a class is my bad. I was just getting enough implemented in order to pass some specs and use libraries that expected the nil on Windows. JD From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Tomas Matousek Sent: Saturday, April 03, 2010 6:01 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? That is a bug. Make it a module. Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 5:02 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Quick question: The etc.rb in Libs is a class, but the implementation in the Ruby Standard Library appears to be a module. Should I keep the class or use the module? Ryan Riley On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Nice work. A few suggestions: - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. - Use System::Environment:: System::Environment.OSVersion.Platform to detect the OS (see e.g. Win32API.rb in Libs). - Rather than check for the platform in every method it might be better to define the methods differently on Windows. Something like: module Etc platform = System::PlatformID case System::Environment.OSVersion.Platform when platform.Win32S, platform.WinCE, platform.Win32Windows, platform.Win32NT: def self.endgrent; end def self.endpwent; end def self.getgrent; end ? else load_assembly ''Mono.Posix'' def self.endgrent Mono::Unix::Native::Syscall.endgrent end def self.endpwent Mono::Unix::Native::Syscall.endpwent end def self.getgrent to_group(Mono::Unix::Native::Syscall.getgrent) end ? end end From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Ryan Riley Sent: Saturday, April 03, 2010 3:59 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? I''ve posted an initial "complete" implementation, though I have only done basic testing. I have a couple of TODO''s remaining and some cleanup, as well as writing actual specs. I still don''t have tests running. You can find the module here: http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb Not the prettiest thing in the world, but I just wanted to get it working. I definitely still have work to do. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd> and Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group> that are returned from the Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32> functions have UInt32, System.String, and System.String[]. System.String is no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum as the type, and I was trying to get the correct types back from the functions. That leaves MRI''s Array to Mono''s System.String[]. My current implementation is just a Ruby module wrapping calls to the Mono functions and returning the appropriate types. Most of it is working, though without being able to run tests easily, I''m testing from the command line. I still need to add conditionals to return nil if it''s run on Windows. I suppose I also need to conditionally load the Mono.Posix.dll if it''s on Windows, too. I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve already got what I finished last night up there.) I also asked Shri for a pairing session to make sure it''s inline with what you''re wanting. Cheers, Ryan Riley Email: ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org> LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: Can you give an example of where you need the conversions? Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville Sent: Saturday, April 03, 2010 11:00 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside that file is a to_clr_array method JD ________________________________ From: Ryan Riley <ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> Sent: Saturday, April 03, 2010 12:13 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> <ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>> Subject: Re: [Ironruby-core] Anyone interested in implementing Etc module for Mono? Where is documentation on converting between CLR and Ruby types? I can get RubyStrings, but what about Fixnum and Array? Thanks, Ryan Riley _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100405/7400557b/attachment-0001.html>
Ryan Riley
2010-Apr-05 06:05 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
Great. I''ve been working on cleaning up the file paths so that I can run the specs (and irtests). The problem seems to be just having ''\\'' hard-coded everywhere. I''m changing this to File.join("abc","xyz"). I''ve still got a few remaining, notably ir.cmd and irtests.rb. Then I''ll get on the specs for Etc. Those really shouldn''t be hard to write up as I''ve typed them over and over into the REPL the last few days. :) Cheers, Ryan On Sun, Apr 4, 2010 at 10:29 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> You should add new/updated specs to > MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspecso that all IronRuby devs will immediately start running the new/updated > specs (after your changes get pulled into the IronRuby master repo). Jim > will then periodically push these back to the RubySpec git repo. He also > does pull periodically from the RubySpec repo into > MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Sunday, April 04, 2010 7:33 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > Nm... I figured out that dev.sh, despite the command to export to PATH was > not. I''m working on rubyspecs now. Do I put these in the rubyspec git repo > or in the IR copy > (MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec)? > > > Ryan > > On Sun, Apr 4, 2010 at 6:32 PM, Ryan Riley <ryan.riley at panesofglass.org> > wrote: > > Thanks, Shri. The problem is that I cannot run mspec at all. I have added > it to my path, but I get a message saying thtat the command can''t be found, > even while in the bin folder. (And yes, the files are executable. :) I''ll > keep trying to determine what''s wrong, but I would think this should just > work. > > > > In other news, I was able to get master built on linux using rake compile. > I''ve checked this into my copy of master on github, along with the etc.rb > updates and Ivan''s dev.sh script. I can write the additional test cases, but > they should also work now on windows. I''m about to pull and try it myself. > > > > Cheers! > > > Ryan Riley > > > > On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com> > wrote: > > If you run ?mspec ci library\etc?, that runs the real RubySpec specs. > irtests does run a command like ?mspec ci lib? which will run the Etc > RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might be > useful to you about how these scripts work. > > > > The RubySpecs are supposed to be working on all platforms. The specs use > checks like ?platform_is :windows? or ?platform_is_not :windows? to have > versions for all OSes. I am surprised that the current ones expect nil. You > can fix them to have versions of the specs that work on Unixes. You can run > the tests against MRI using ?mspec ?tr? to ensure that the spec you add is > correct. > > > > If you can streamline the development process for Mono, that will be great > so others have an easier time in the future? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Sunday, April 04, 2010 9:54 AM > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted all the type fixes, but since I can''t compile master, I''m > hesitant to rebase. What should I do? Also, I still haven''t gotten to the > tests. Looks like the current ones all expect nil and assume Windows. Are > those the real rubyspec specs? > > Sent from my iPhone > > > On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote: > > Also, to get a Int32 out of a UInt32, you should be able to use > induced_from: > > > > >>> a = System::UInt32.new(1) > > => 1 (UInt32) > > >>> Fixnum.induced_from(a) > > => 1 > > > > Minor thing, but it will work. > > > > The fact that etc is a class is my bad. I was just getting enough > implemented in order to pass some specs and use libraries that expected the > nil on Windows. > > > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek > *Sent:* Saturday, April 03, 2010 6:01 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > That is a bug. Make it a module. > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Saturday, April 03, 2010 5:02 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > Quick question: The etc.rb in Libs is a class, but the implementation in > the Ruby Standard Library appears to be a module. Should I keep the class or > use the module? > > > Ryan Riley > > On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > Nice work. > > > > A few suggestions: > > > > - You can move the file to C:\M0\Merlin\Main\Languages\Ruby\Libs. > > - Use System::Environment:: System::Environment.OSVersion.Platform > to detect the OS (see e.g. Win32API.rb in Libs). > > - Rather than check for the platform in every method it might be > better to define the methods differently on Windows. Something like: > > > > module Etc > > platform = System::PlatformID > > case System::Environment.OSVersion.Platform > > when platform.Win32S, platform.WinCE, platform.Win32Windows, > platform.Win32NT: > > def self.endgrent; end > > def self.endpwent; end > > def self.getgrent; end > > ? > > else > > load_assembly ''Mono.Posix'' > > > > def self.endgrent > > Mono::Unix::Native::Syscall.endgrent > > end > > > > def self.endpwent > > Mono::Unix::Native::Syscall.endpwent > > end > > > > > > > > > def self.getgrent > > to_group(Mono::Unix::Native::Syscall.getgrent) > > > > > > end > > > > ? > > end > > end > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Saturday, April 03, 2010 3:59 PM > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > I''ve posted an initial "complete" implementation, though I have only done > basic testing. I have a couple of TODO''s remaining and some cleanup, as well > as writing actual specs. I still don''t have tests running. You can find the > module here: > http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb > > > > Not the prettiest thing in the world, but I just wanted to get it working. > I definitely still have work to do. > > > > Cheers, > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> > wrote: > > Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and > Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the > Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is > no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as > System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum > as the type, and I was trying to get the correct types back from the > functions. That leaves MRI''s Array to Mono''s System.String[]. > > > > My current implementation is just a Ruby module wrapping calls to the Mono > functions and returning the appropriate types. Most of it is working, though > without being able to run tests easily, I''m testing from the command line. I > still need to add conditionals to return nil if it''s run on Windows. I > suppose I also need to conditionally load the Mono.Posix.dll if it''s on > Windows, too. > > > > I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve > already got what I finished last night up there.) I also asked Shri for a > pairing session to make sure it''s inline with what you''re wanting. > > > > Cheers, > > > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > Can you give an example of where you need the conversions? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville > *Sent:* Saturday, April 03, 2010 11:00 AM > > > *To:* ironruby-core at rubyforge.org > > *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > > > > No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. > I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside > that file is a to_clr_array method > > JD > ------------------------------ > > *From: *Ryan Riley <ryan.riley at panesofglass.org> > *Sent: *Saturday, April 03, 2010 12:13 AM > *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc > module for Mono? > > Where is documentation on converting between CLR and Ruby types? I can get > RubyStrings, but what about Fixnum and Array? > > > > Thanks, > > > Ryan Riley > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100404/b49bc04c/attachment-0001.html>
Ryan Riley
2010-Apr-05 15:30 UTC
[Ironruby-core] Anyone interested in implementing Etc module for Mono?
By the way, if I''ve changed jobs since I signed my LCA, do I need to do it again for my current employer? Ryan On Sun, Apr 4, 2010 at 11:05 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Great. I''ve been working on cleaning up the file paths so that I can run > the specs (and irtests). The problem seems to be just having ''\\'' hard-coded > everywhere. I''m changing this to File.join("abc","xyz"). I''ve still got a > few remaining, notably ir.cmd and irtests.rb. Then I''ll get on the specs for > Etc. Those really shouldn''t be hard to write up as I''ve typed them over and > over into the REPL the last few days. :) > > Cheers, > > Ryan > > > On Sun, Apr 4, 2010 at 10:29 PM, Shri Borde <Shri.Borde at microsoft.com>wrote: > >> You should add new/updated specs to >> MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspecso that all IronRuby devs will immediately start running the new/updated >> specs (after your changes get pulled into the IronRuby master repo). Jim >> will then periodically push these back to the RubySpec git repo. He also >> does pull periodically from the RubySpec repo into >> MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec. >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Sunday, April 04, 2010 7:33 PM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> Nm... I figured out that dev.sh, despite the command to export to PATH was >> not. I''m working on rubyspecs now. Do I put these in the rubyspec git repo >> or in the IR copy >> (MERLIN_ROOT/../External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec)? >> >> >> Ryan >> >> On Sun, Apr 4, 2010 at 6:32 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >> >> Thanks, Shri. The problem is that I cannot run mspec at all. I have added >> it to my path, but I get a message saying thtat the command can''t be found, >> even while in the bin folder. (And yes, the files are executable. :) I''ll >> keep trying to determine what''s wrong, but I would think this should just >> work. >> >> >> >> In other news, I was able to get master built on linux using rake compile. >> I''ve checked this into my copy of master on github, along with the etc.rb >> updates and Ivan''s dev.sh script. I can write the additional test cases, but >> they should also work now on windows. I''m about to pull and try it myself. >> >> >> >> Cheers! >> >> >> Ryan Riley >> >> >> >> On Sun, Apr 4, 2010 at 10:55 AM, Shri Borde <Shri.Borde at microsoft.com> >> wrote: >> >> If you run ?mspec ci library\etc?, that runs the real RubySpec specs. >> irtests does run a command like ?mspec ci lib? which will run the Etc >> RubySpec specs. http://wiki.github.com/ironruby/ironruby/rubyspec might >> be useful to you about how these scripts work. >> >> >> >> The RubySpecs are supposed to be working on all platforms. The specs use >> checks like ?platform_is :windows? or ?platform_is_not :windows? to have >> versions for all OSes. I am surprised that the current ones expect nil. You >> can fix them to have versions of the specs that work on Unixes. You can run >> the tests against MRI using ?mspec ?tr? to ensure that the spec you add is >> correct. >> >> >> >> If you can streamline the development process for Mono, that will be great >> so others have an easier time in the future? >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Sunday, April 04, 2010 9:54 AM >> >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted all the type fixes, but since I can''t compile master, I''m >> hesitant to rebase. What should I do? Also, I still haven''t gotten to the >> tests. Looks like the current ones all expect nil and assume Windows. Are >> those the real rubyspec specs? >> >> Sent from my iPhone >> >> >> On Apr 3, 2010, at 10:13 PM, Jim Deville <jdeville at microsoft.com> wrote: >> >> Also, to get a Int32 out of a UInt32, you should be able to use >> induced_from: >> >> >> >> >>> a = System::UInt32.new(1) >> >> => 1 (UInt32) >> >> >>> Fixnum.induced_from(a) >> >> => 1 >> >> >> >> Minor thing, but it will work. >> >> >> >> The fact that etc is a class is my bad. I was just getting enough >> implemented in order to pass some specs and use libraries that expected the >> nil on Windows. >> >> >> >> JD >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek >> *Sent:* Saturday, April 03, 2010 6:01 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> That is a bug. Make it a module. >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 5:02 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> Quick question: The etc.rb in Libs is a class, but the implementation in >> the Ruby Standard Library appears to be a module. Should I keep the class or >> use the module? >> >> >> Ryan Riley >> >> On Sat, Apr 3, 2010 at 4:43 PM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Nice work. >> >> >> >> A few suggestions: >> >> >> >> - You can move the file to >> C:\M0\Merlin\Main\Languages\Ruby\Libs. >> >> - Use System::Environment:: System::Environment.OSVersion.Platform >> to detect the OS (see e.g. Win32API.rb in Libs). >> >> - Rather than check for the platform in every method it might be >> better to define the methods differently on Windows. Something like: >> >> >> >> module Etc >> >> platform = System::PlatformID >> >> case System::Environment.OSVersion.Platform >> >> when platform.Win32S, platform.WinCE, platform.Win32Windows, >> platform.Win32NT: >> >> def self.endgrent; end >> >> def self.endpwent; end >> >> def self.getgrent; end >> >> ? >> >> else >> >> load_assembly ''Mono.Posix'' >> >> >> >> def self.endgrent >> >> Mono::Unix::Native::Syscall.endgrent >> >> end >> >> >> >> def self.endpwent >> >> Mono::Unix::Native::Syscall.endpwent >> >> end >> >> >> >> >> >> >> >> >> def self.getgrent >> >> to_group(Mono::Unix::Native::Syscall.getgrent) >> >> >> >> >> >> end >> >> >> >> ? >> >> end >> >> end >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Saturday, April 03, 2010 3:59 PM >> >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> I''ve posted an initial "complete" implementation, though I have only done >> basic testing. I have a couple of TODO''s remaining and some cleanup, as well >> as writing actual specs. I still don''t have tests running. You can find the >> module here: >> http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb >> >> >> >> Not the prettiest thing in the world, but I just wanted to get it working. >> I definitely still have work to do. >> >> >> >> Cheers, >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 2:30 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >> >> Sure! Mono::Unix::Native::Passwd<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Passwd>and >> Mono::Unix::Native::Group<http://www.go-mono.com/docs/index.aspx?link=T:Mono.Unix.Native.Group>that are returned from the >> Mono::Unix::Native::Syscall<http://www.go-mono.com/docs/index.aspx?link=M:Mono.Posix.Syscall.getusername(System.Int32>functions have UInt32, System.String, and System.String[]. System.String is >> no biggie, and I''m finding .to_i on a System.UInt32 is still displayed as >> System.UInt32, so I suppose that''s not an issue, either. MRI displays Fixnum >> as the type, and I was trying to get the correct types back from the >> functions. That leaves MRI''s Array to Mono''s System.String[]. >> >> >> >> My current implementation is just a Ruby module wrapping calls to the Mono >> functions and returning the appropriate types. Most of it is working, though >> without being able to run tests easily, I''m testing from the command line. I >> still need to add conditionals to return nil if it''s run on Windows. I >> suppose I also need to conditionally load the Mono.Posix.dll if it''s on >> Windows, too. >> >> >> >> I''m about to finish the basic implementation and post to github<http://github.com/panesofglass/ironruby/blob/linux/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Etc/IronRuby.Libraries.Etc/etc.rb>. (I''ve >> already got what I finished last night up there.) I also asked Shri for a >> pairing session to make sure it''s inline with what you''re wanting. >> >> >> >> Cheers, >> >> >> >> Ryan Riley >> >> Email: ryan.riley at panesofglass.org >> LinkedIn: http://www.linkedin.com/in/ryanriley >> Blog: http://wizardsofsmart.net/ >> Twitter: @panesofglass >> Website: http://panesofglass.org/ >> >> On Sat, Apr 3, 2010 at 11:25 AM, Tomas Matousek < >> Tomas.Matousek at microsoft.com> wrote: >> >> Can you give an example of where you need the conversions? >> >> >> >> Tomas >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jim Deville >> *Sent:* Saturday, April 03, 2010 11:00 AM >> >> >> *To:* ironruby-core at rubyforge.org >> >> *Subject:* Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> >> >> >> No conversion for Fixnums is needed (Fixnums are ints). Arrays are harder. >> I would take a look at clr_ext in merlin/main/languages/ruby/samples. Inside >> that file is a to_clr_array method >> >> JD >> ------------------------------ >> >> *From: *Ryan Riley <ryan.riley at panesofglass.org> >> *Sent: *Saturday, April 03, 2010 12:13 AM >> *To: *ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> >> *Subject: *Re: [Ironruby-core] Anyone interested in implementing Etc >> module for Mono? >> >> Where is documentation on converting between CLR and Ruby types? I can get >> RubyStrings, but what about Fixnum and Array? >> >> >> >> Thanks, >> >> >> Ryan Riley >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100405/38141d4c/attachment-0001.html>