Shay Friedman
2010-Mar-23 07:53 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
Hey guys, What is the recommendation for using Ruby''s standard libraries in Silverlight applications? Should the lib be copied to the project dir? should a reference be added to the manifest? some other technique? Thanks, Shay. -------------------------------------------------------- Shay Friedman | Author of IronRuby Unleashed Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100323/f0fddc9e/attachment.html>
Ivan Porto Carrero
2010-Mar-23 08:18 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
I''d the contents of the lib folder in a zip file and then use gestalt to download the zip. from then on they are available --- 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman <shay.friedman at gmail.com>wrote:> Hey guys, > > What is the recommendation for using Ruby''s standard libraries in > Silverlight applications? > Should the lib be copied to the project dir? should a reference be added to > the manifest? some other technique? > > Thanks, > Shay. > -------------------------------------------------------- > Shay Friedman | Author of IronRuby Unleashed > Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay > > _______________________________________________ > 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/20100323/65b9197c/attachment.html>
Shay Friedman
2010-Mar-23 08:28 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
That''s a good idea but it enforces the user to use Gestalt. Which brings up another question - are we willing to "standardize" Gestalt by making it the best practice for using DLR languages in Silverlight? -------------------------------------------------------- Shay Friedman | Author of IronRuby Unleashed Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> I''d the contents of the lib folder in a zip file > > and then use gestalt to download the zip. from then on they are available > --- > 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman <shay.friedman at gmail.com>wrote: > >> Hey guys, >> >> What is the recommendation for using Ruby''s standard libraries in >> Silverlight applications? >> Should the lib be copied to the project dir? should a reference be added >> to the manifest? some other technique? >> >> Thanks, >> Shay. >> -------------------------------------------------------- >> Shay Friedman | Author of IronRuby Unleashed >> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >> >> _______________________________________________ >> 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/20100323/94c12047/attachment.html>
Ivan Porto Carrero
2010-Mar-23 09:50 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
I thought that already happened (dlr-slvx requirement etc) --- 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman <shay.friedman at gmail.com>wrote:> That''s a good idea but it enforces the user to use Gestalt. > > Which brings up another question - are we willing to "standardize" Gestalt > by making it the best practice for using DLR languages in Silverlight? > > -------------------------------------------------------- > Shay Friedman | Author of IronRuby Unleashed > Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay > > > On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < > ivan at whiterabbitconsulting.eu> wrote: > >> I''d the contents of the lib folder in a zip file >> >> and then use gestalt to download the zip. from then on they are available >> --- >> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman <shay.friedman at gmail.com>wrote: >> >>> Hey guys, >>> >>> What is the recommendation for using Ruby''s standard libraries in >>> Silverlight applications? >>> Should the lib be copied to the project dir? should a reference be added >>> to the manifest? some other technique? >>> >>> Thanks, >>> Shay. >>> -------------------------------------------------------- >>> Shay Friedman | Author of IronRuby Unleashed >>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>> >>> _______________________________________________ >>> 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/20100323/62397547/attachment.html>
Shay Friedman
2010-Mar-23 14:35 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
OK I zipped the libs folder and added it to the page as <script type="application/zip" src="lib.zip"></script>. When I try to require the assemblies, the files are not found. I tried to make the case simpler and zipped a simple rb file to a zip and included it in the page as well: <script type="application/zip" src="test.zip"></script> I tried: require "TestClass.rb" require "TestClass" require ''test.zip/TestClass.rb'' require ''test.zip/TestClass'' None of these worked. By the way, I see that Chiron loads the zip files... What am I doing wrong? -------------------------------------------------------- Shay Friedman | Author of IronRuby Unleashed Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay On Tue, Mar 23, 2010 at 11:50 AM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> I thought that already happened (dlr-slvx requirement etc) > > --- > 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman <shay.friedman at gmail.com>wrote: > >> That''s a good idea but it enforces the user to use Gestalt. >> >> Which brings up another question - are we willing to "standardize" Gestalt >> by making it the best practice for using DLR languages in Silverlight? >> >> -------------------------------------------------------- >> Shay Friedman | Author of IronRuby Unleashed >> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >> >> >> On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < >> ivan at whiterabbitconsulting.eu> wrote: >> >>> I''d the contents of the lib folder in a zip file >>> >>> and then use gestalt to download the zip. from then on they are >>> available >>> --- >>> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman <shay.friedman at gmail.com>wrote: >>> >>>> Hey guys, >>>> >>>> What is the recommendation for using Ruby''s standard libraries in >>>> Silverlight applications? >>>> Should the lib be copied to the project dir? should a reference be added >>>> to the manifest? some other technique? >>>> >>>> Thanks, >>>> Shay. >>>> -------------------------------------------------------- >>>> Shay Friedman | Author of IronRuby Unleashed >>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>> >>>> _______________________________________________ >>>> 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/20100323/06cf2d2a/attachment-0001.html>
Ivan Porto Carrero
2010-Mar-23 15:00 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
for assemblies you need to add an appmanifest I think --- 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 Tue, Mar 23, 2010 at 3:35 PM, Shay Friedman <shay.friedman at gmail.com>wrote:> OK I zipped the libs folder and added it to the page as <script > type="application/zip" src="lib.zip"></script>. > When I try to require the assemblies, the files are not found. > > I tried to make the case simpler and zipped a simple rb file to a zip and > included it in the page as well: <script type="application/zip" > src="test.zip"></script> > I tried: > require "TestClass.rb" > require "TestClass" > require ''test.zip/TestClass.rb'' > require ''test.zip/TestClass'' > > None of these worked. > > By the way, I see that Chiron loads the zip files... > > What am I doing wrong? > > -------------------------------------------------------- > Shay Friedman | Author of IronRuby Unleashed > Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay > > > On Tue, Mar 23, 2010 at 11:50 AM, Ivan Porto Carrero < > ivan at whiterabbitconsulting.eu> wrote: > >> I thought that already happened (dlr-slvx requirement etc) >> >> --- >> 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman <shay.friedman at gmail.com>wrote: >> >>> That''s a good idea but it enforces the user to use Gestalt. >>> >>> Which brings up another question - are we willing to "standardize" >>> Gestalt by making it the best practice for using DLR languages in >>> Silverlight? >>> >>> -------------------------------------------------------- >>> Shay Friedman | Author of IronRuby Unleashed >>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>> >>> >>> On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < >>> ivan at whiterabbitconsulting.eu> wrote: >>> >>>> I''d the contents of the lib folder in a zip file >>>> >>>> and then use gestalt to download the zip. from then on they are >>>> available >>>> --- >>>> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman <shay.friedman at gmail.com >>>> > wrote: >>>> >>>>> Hey guys, >>>>> >>>>> What is the recommendation for using Ruby''s standard libraries in >>>>> Silverlight applications? >>>>> Should the lib be copied to the project dir? should a reference be >>>>> added to the manifest? some other technique? >>>>> >>>>> Thanks, >>>>> Shay. >>>>> -------------------------------------------------------- >>>>> Shay Friedman | Author of IronRuby Unleashed >>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>> >>>>> _______________________________________________ >>>>> 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/20100323/fb1f5415/attachment.html>
Shay Friedman
2010-Mar-24 07:17 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
It doesn''t work for Ruby files as well as assemblies (which are placed within a ZIP file)... :-( -------------------------------------------------------- Shay Friedman | Author of IronRuby Unleashed Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay On Tue, Mar 23, 2010 at 5:00 PM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> for assemblies you need to add an appmanifest I think > > --- > 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 Tue, Mar 23, 2010 at 3:35 PM, Shay Friedman <shay.friedman at gmail.com>wrote: > >> OK I zipped the libs folder and added it to the page as <script >> type="application/zip" src="lib.zip"></script>. >> When I try to require the assemblies, the files are not found. >> >> I tried to make the case simpler and zipped a simple rb file to a zip and >> included it in the page as well: <script type="application/zip" >> src="test.zip"></script> >> I tried: >> require "TestClass.rb" >> require "TestClass" >> require ''test.zip/TestClass.rb'' >> require ''test.zip/TestClass'' >> >> None of these worked. >> >> By the way, I see that Chiron loads the zip files... >> >> What am I doing wrong? >> >> -------------------------------------------------------- >> Shay Friedman | Author of IronRuby Unleashed >> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >> >> >> On Tue, Mar 23, 2010 at 11:50 AM, Ivan Porto Carrero < >> ivan at whiterabbitconsulting.eu> wrote: >> >>> I thought that already happened (dlr-slvx requirement etc) >>> >>> --- >>> 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman <shay.friedman at gmail.com>wrote: >>> >>>> That''s a good idea but it enforces the user to use Gestalt. >>>> >>>> Which brings up another question - are we willing to "standardize" >>>> Gestalt by making it the best practice for using DLR languages in >>>> Silverlight? >>>> >>>> -------------------------------------------------------- >>>> Shay Friedman | Author of IronRuby Unleashed >>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>> >>>> >>>> On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < >>>> ivan at whiterabbitconsulting.eu> wrote: >>>> >>>>> I''d the contents of the lib folder in a zip file >>>>> >>>>> and then use gestalt to download the zip. from then on they are >>>>> available >>>>> --- >>>>> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman < >>>>> shay.friedman at gmail.com> wrote: >>>>> >>>>>> Hey guys, >>>>>> >>>>>> What is the recommendation for using Ruby''s standard libraries in >>>>>> Silverlight applications? >>>>>> Should the lib be copied to the project dir? should a reference be >>>>>> added to the manifest? some other technique? >>>>>> >>>>>> Thanks, >>>>>> Shay. >>>>>> -------------------------------------------------------- >>>>>> Shay Friedman | Author of IronRuby Unleashed >>>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >> >> > > _______________________________________________ > 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/20100324/7ad4ee1a/attachment.html>
Ivan Porto Carrero
2010-Mar-24 07:50 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
if you put a app\myfile.rb in the zip file you should be able to do require ''app/myfile'' --- 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 Wed, Mar 24, 2010 at 8:17 AM, Shay Friedman <shay.friedman at gmail.com>wrote:> It doesn''t work for Ruby files as well as assemblies (which are placed > within a ZIP file)... :-( > > -------------------------------------------------------- > Shay Friedman | Author of IronRuby Unleashed > Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay > > > On Tue, Mar 23, 2010 at 5:00 PM, Ivan Porto Carrero < > ivan at whiterabbitconsulting.eu> wrote: > >> for assemblies you need to add an appmanifest I think >> >> --- >> 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 Tue, Mar 23, 2010 at 3:35 PM, Shay Friedman <shay.friedman at gmail.com>wrote: >> >>> OK I zipped the libs folder and added it to the page as <script >>> type="application/zip" src="lib.zip"></script>. >>> When I try to require the assemblies, the files are not found. >>> >>> I tried to make the case simpler and zipped a simple rb file to a zip and >>> included it in the page as well: <script type="application/zip" >>> src="test.zip"></script> >>> I tried: >>> require "TestClass.rb" >>> require "TestClass" >>> require ''test.zip/TestClass.rb'' >>> require ''test.zip/TestClass'' >>> >>> None of these worked. >>> >>> By the way, I see that Chiron loads the zip files... >>> >>> What am I doing wrong? >>> >>> -------------------------------------------------------- >>> Shay Friedman | Author of IronRuby Unleashed >>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>> >>> >>> On Tue, Mar 23, 2010 at 11:50 AM, Ivan Porto Carrero < >>> ivan at whiterabbitconsulting.eu> wrote: >>> >>>> I thought that already happened (dlr-slvx requirement etc) >>>> >>>> --- >>>> 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman <shay.friedman at gmail.com >>>> > wrote: >>>> >>>>> That''s a good idea but it enforces the user to use Gestalt. >>>>> >>>>> Which brings up another question - are we willing to "standardize" >>>>> Gestalt by making it the best practice for using DLR languages in >>>>> Silverlight? >>>>> >>>>> -------------------------------------------------------- >>>>> Shay Friedman | Author of IronRuby Unleashed >>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>> >>>>> >>>>> On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < >>>>> ivan at whiterabbitconsulting.eu> wrote: >>>>> >>>>>> I''d the contents of the lib folder in a zip file >>>>>> >>>>>> and then use gestalt to download the zip. from then on they are >>>>>> available >>>>>> --- >>>>>> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman < >>>>>> shay.friedman at gmail.com> wrote: >>>>>> >>>>>>> Hey guys, >>>>>>> >>>>>>> What is the recommendation for using Ruby''s standard libraries in >>>>>>> Silverlight applications? >>>>>>> Should the lib be copied to the project dir? should a reference be >>>>>>> added to the manifest? some other technique? >>>>>>> >>>>>>> Thanks, >>>>>>> Shay. >>>>>>> -------------------------------------------------------- >>>>>>> Shay Friedman | Author of IronRuby Unleashed >>>>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>> >>> >> >> _______________________________________________ >> 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/20100324/2a3e6529/attachment-0001.html>
Shay Friedman
2010-Mar-25 13:30 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
It doesn''t work for me. -------------------------------------------------------- Shay Friedman | Author of IronRuby Unleashed Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay On Wed, Mar 24, 2010 at 9:50 AM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> if you put a app\myfile.rb in the zip file > you should be able to do require ''app/myfile'' > --- > 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 Wed, Mar 24, 2010 at 8:17 AM, Shay Friedman <shay.friedman at gmail.com>wrote: > >> It doesn''t work for Ruby files as well as assemblies (which are placed >> within a ZIP file)... :-( >> >> -------------------------------------------------------- >> Shay Friedman | Author of IronRuby Unleashed >> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >> >> >> On Tue, Mar 23, 2010 at 5:00 PM, Ivan Porto Carrero < >> ivan at whiterabbitconsulting.eu> wrote: >> >>> for assemblies you need to add an appmanifest I think >>> >>> --- >>> 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 Tue, Mar 23, 2010 at 3:35 PM, Shay Friedman <shay.friedman at gmail.com>wrote: >>> >>>> OK I zipped the libs folder and added it to the page as <script >>>> type="application/zip" src="lib.zip"></script>. >>>> When I try to require the assemblies, the files are not found. >>>> >>>> I tried to make the case simpler and zipped a simple rb file to a zip >>>> and included it in the page as well: <script type="application/zip" >>>> src="test.zip"></script> >>>> I tried: >>>> require "TestClass.rb" >>>> require "TestClass" >>>> require ''test.zip/TestClass.rb'' >>>> require ''test.zip/TestClass'' >>>> >>>> None of these worked. >>>> >>>> By the way, I see that Chiron loads the zip files... >>>> >>>> What am I doing wrong? >>>> >>>> -------------------------------------------------------- >>>> Shay Friedman | Author of IronRuby Unleashed >>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>> >>>> >>>> On Tue, Mar 23, 2010 at 11:50 AM, Ivan Porto Carrero < >>>> ivan at whiterabbitconsulting.eu> wrote: >>>> >>>>> I thought that already happened (dlr-slvx requirement etc) >>>>> >>>>> --- >>>>> 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 Tue, Mar 23, 2010 at 9:28 AM, Shay Friedman < >>>>> shay.friedman at gmail.com> wrote: >>>>> >>>>>> That''s a good idea but it enforces the user to use Gestalt. >>>>>> >>>>>> Which brings up another question - are we willing to "standardize" >>>>>> Gestalt by making it the best practice for using DLR languages in >>>>>> Silverlight? >>>>>> >>>>>> -------------------------------------------------------- >>>>>> Shay Friedman | Author of IronRuby Unleashed >>>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>>> >>>>>> >>>>>> On Tue, Mar 23, 2010 at 10:18 AM, Ivan Porto Carrero < >>>>>> ivan at whiterabbitconsulting.eu> wrote: >>>>>> >>>>>>> I''d the contents of the lib folder in a zip file >>>>>>> >>>>>>> and then use gestalt to download the zip. from then on they are >>>>>>> available >>>>>>> --- >>>>>>> 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 Tue, Mar 23, 2010 at 8:53 AM, Shay Friedman < >>>>>>> shay.friedman at gmail.com> wrote: >>>>>>> >>>>>>>> Hey guys, >>>>>>>> >>>>>>>> What is the recommendation for using Ruby''s standard libraries in >>>>>>>> Silverlight applications? >>>>>>>> Should the lib be copied to the project dir? should a reference be >>>>>>>> added to the manifest? some other technique? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Shay. >>>>>>>> -------------------------------------------------------- >>>>>>>> Shay Friedman | Author of IronRuby Unleashed >>>>>>>> Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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/20100325/c5257fee/attachment-0001.html>
Jimmy Schementi
2010-Apr-01 04:40 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
Wow, a lot of questions to answer here; let me know if I missed one ...> What is the recommendation for using Ruby''s standard libraries in Silverlight applications? > Should the lib be copied to the project dir? should a reference be added to the manifest? some other technique?Depends on whether your using the Chiron to generate a XAP file, or your using dlr.js and embedding Ruby code in the HTML page with script-tags. Chiron to generate the XAP: Just copy the necessary Ruby stdlib files into your XAP file directory. If you just want to reference an entire directory, you can use the "-path" Chiron.exe option. Script-tags: See the IronPython docs on this: http://ironpython.net/browser/docs.html#zip-files. Basically you must have a script-tag like this: <script type="application/x-zip-compressed" src="lib.zip"></script>. Then you can reference the "lib" directory in your scripts, including adding it to the path: <script type="text/ruby">$: << "lib"; require ''erb'';</script>. You can also just list out each Ruby file used: # foo.rb require ''bar'' <!-- index.html --> <script type="text/ruby" src="foo.rb" defer="true"></script> <script type="text/ruby" src="bar.rb" defer="true"></script> <script type="text/ruby"> require ''foo'' </script> I hope this shows that script-tags just download the script, and add it to the "virtual file-system" that the DLR-languages see. The "defer" attribute causes the script to not be run; it will be run when a script requires it.> I zipped the libs folder and added it to the page as <script type="application/zip" src="lib.zip"></script>. > When I try to require the assemblies, the files are not found. > > I tried to make the case simpler and zipped a simple rb file to a zip and included it in the page as well: > <script type="application/zip" src="test.zip"></script> > I tried: > require "TestClass.rb" > require "TestClass" > require ''test.zip/TestClass.rb'' > require ''test.zip/TestClass'' > > None of these worked. > > By the way, I see that Chiron loads the zip files... > > What am I doing wrong?Change the mime-type to application/x-zip-compressed and try requiring "test/TestClass" ... that will work. We should also allow application/zip as the mime-type: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26676. Keep in mind that Silverlight can only read archived files created with a deflate ZIP algorithm; but using Chiron to create the zip file will ensure it works ... something like "Chiron.exe /d:lib /x:lib.zip".> for assemblies you need to add an appmanifest I thinkActually, all the AppManifest.xaml does it load the assemblies for you; you can use "require" or "load_assembly" to accomplish the same thing, so I advise against touching the AppManifest.xaml, unless your XAML has dependencies on an assembly. Keep in mind there is no way to have an "assembly script-tag" ... you must put the assembly in a ZIP file.> if you put a app\myfile.rb in the zip file, you should be able to do require ''app/myfile''Close ... you have to use the file filename in the require call, or add the zip file name to the path (see example above). Today this only works when you use the zip file name without it''s extension, but that''s a bug IMO: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26677.> Which brings up another question - are we willing to "standardize" Gestalt by making it the best practice for using DLR languages in Silverlight?Well on its way; the http://ironpython.net/browser/ page only has documentation for the "Gestalt"-way, though the Chiron/XAP model will also be documented. Fun fact: while the first version of Gestalt (0.5) was made completely independently by the visitmix.com/labs team, the 1.0 release was completely rewritten and merged into Microsoft.Scripting.Silverlight.dll. In fact, the current source code on gestalt.codeplex.com is only the code from 0.5; the latest source code for Microsoft.Scripting.Silverlight is in IronRuby''s GitHub and IronPython''s CodePlex source repos. Keep in mind the previous Chiron/XAP file model isn''t going away; Gestalt takes [too-must] advantage of how Silverlight expects apps to be structured, so there are some limitations to it. The glaring limitation is you can''t run gestalt apps out-of-browser; HTML doesn''t work there ... there might be a way around this by using Silverlight''s ability to host HTML content IN a Silverlight control, but that hasn''t been tested yet. So the Chiron/XAP model will continue to be supported, but I don''t advise using it unless you need to run out-of-browser. You can also combine the two; the IronRuby tutorial uses the Chiron/XAP model for the app, but the Gestalt-way to enable tests running in the browser. ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100401/3336c908/attachment-0001.html>
Miguel Madero
2010-May-03 03:18 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
I think the Chiron model is better for different scenarios. You mentioned OOB, but also if IronRuby (or other Dynamic Languages) are used as part of a statically compiled app where XAPs and assemblies are distributed in the typical SL way. Not sure how we would do it with Gestal as I''ve seen that it relies on the Script tags. Is there a way of doing that programmatically? On Thu, Apr 1, 2010 at 2:40 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote:> Wow, a lot of questions to answer here; let me know if I missed one ? > > > > > What is the recommendation for using Ruby''s standard libraries in > Silverlight applications? > > > Should the lib be copied to the project dir? should a reference be added > to the manifest? some other technique? > > > > Depends on whether your using the Chiron to generate a XAP file, or your > using dlr.js and embedding Ruby code in the HTML page with script-tags. > > > > Chiron to generate the XAP: > > Just copy the necessary Ruby stdlib files into your XAP file directory. If > you just want to reference an entire directory, you can use the ?-path? > Chiron.exe option. > > > > Script-tags: > > See the IronPython docs on this: http://ironpython.net/browser/docs.html#zip-files. Basically you must have a script-tag like this: <script type="application/x-zip-compressed" src="lib.zip"></script>. Then you can reference the ?lib? directory in your scripts, including adding it to the path: <script type="text/ruby">$: << "lib"; require ''erb'';</script>. > > > > You can also just list out each Ruby file used: > > > > # foo.rb > > require ''bar'' > > > > <!-- index.html --> > > <script type="text/ruby" src="foo.rb" defer="true"></script> > > <script type="text/ruby" src="bar.rb" defer="true"></script> > > <script type="text/ruby"> > > require ''foo'' > > </script> > > > > I hope this shows that script-tags just download the script, and add it to the ?virtual file-system? that the DLR-languages see. The ?defer? attribute causes the script to not be run; it will be run when a script requires it. > > > > > I zipped the libs folder and added it to the page as <script > type="application/zip" src="lib.zip"></script>. > > > When I try to require the assemblies, the files are not found. > > > > > > I tried to make the case simpler and zipped a simple rb file to a zip > and included it in the page as well: > > > <script type="application/zip" src="test.zip"></script> > > > I tried: > > > require "TestClass.rb" > > > require "TestClass" > > > require ''test.zip/TestClass.rb'' > > > require ''test.zip/TestClass'' > > > > > > None of these worked. > > > > > > By the way, I see that Chiron loads the zip files... > > > > > > What am I doing wrong? > > > > Change the mime-type to application/x-zip-compressed and try requiring > "test/TestClass" ? that will work. We should also allow application/zip as > the mime-type: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26676. Keep > in mind that Silverlight can only read archived files created with a deflate > ZIP algorithm; but using Chiron to create the zip file will ensure it works > ? something like ?Chiron.exe /d:lib /x:lib.zip?. > > > > > for assemblies you need to add an appmanifest I think > > > > Actually, all the AppManifest.xaml does it load the assemblies for you; you > can use ?require? or ?load_assembly? to accomplish the same thing, so I > advise against touching the AppManifest.xaml, unless your XAML has > dependencies on an assembly. > > > > Keep in mind there is no way to have an ?assembly script-tag? ? you must > put the assembly in a ZIP file. > > > > > if you put a app\myfile.rb in the zip file, you should be able to do > require ''app/myfile'' > > > Close ? you have to use the file filename in the require call, or add the > zip file name to the path (see example above). Today this only works when > you use the zip file name without it?s extension, but that?s a bug IMO: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26677. > > > Which brings up another question - are we willing to "standardize" > Gestalt by making it the best practice for using DLR languages in > Silverlight? > > Well on its way; the http://ironpython.net/browser/ page only has > documentation for the ?Gestalt?-way, though the Chiron/XAP model will also > be documented. Fun fact: while the first version of Gestalt (0.5) was made > completely independently by the visitmix.com/labs team, the 1.0 release > was completely rewritten and merged into > Microsoft.Scripting.Silverlight.dll. In fact, the current source code on > gestalt.codeplex.com is only the code from 0.5; the latest source code for > Microsoft.Scripting.Silverlight is in IronRuby?s GitHub and IronPython?s > CodePlex source repos. > > Keep in mind the previous Chiron/XAP file model isn?t going away; Gestalt > takes [too-must] advantage of how Silverlight expects apps to be structured, > so there are some limitations to it. The glaring limitation is you can?t run > gestalt apps out-of-browser; HTML doesn?t work there ? there might be a way > around this by using Silverlight?s ability to host HTML content IN a > Silverlight control, but that hasn?t been tested yet. So the Chiron/XAP > model will continue to be supported, but I don?t advise using it unless you > need to run out-of-browser. You can also combine the two; the IronRuby > tutorial uses the Chiron/XAP model for the app, but the Gestalt-way to > enable tests running in the browser. > > ~Jimmy > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100503/6273b380/attachment-0001.html>
Jimmy Schementi
2010-May-03 17:59 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
When using IronRuby in a Silverlight app where the main language is C# or VB, then you wouldn''t be using Chiron at all. You''d add the script files to your Silverlight project, and use the DLR hosting API to run them. You could still use script-tags in this scenario as well; you''d need to look at the source for Microsoft.Scripting.Silverlight.DynamicApplication and call into its initialization logic from your app. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Miguel Madero Sent: Sunday, May 02, 2010 8:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Using Ruby''s standard libraries in Silverlight I think the Chiron model is better for different scenarios. You mentioned OOB, but also if IronRuby (or other Dynamic Languages) are used as part of a statically compiled app where XAPs and assemblies are distributed in the typical SL way. Not sure how we would do it with Gestal as I''ve seen that it relies on the Script tags. Is there a way of doing that programmatically? On Thu, Apr 1, 2010 at 2:40 PM, Jimmy Schementi <Jimmy.Schementi at microsoft.com<mailto:Jimmy.Schementi at microsoft.com>> wrote: Wow, a lot of questions to answer here; let me know if I missed one ...> What is the recommendation for using Ruby''s standard libraries in Silverlight applications? > Should the lib be copied to the project dir? should a reference be added to the manifest? some other technique?Depends on whether your using the Chiron to generate a XAP file, or your using dlr.js and embedding Ruby code in the HTML page with script-tags. Chiron to generate the XAP: Just copy the necessary Ruby stdlib files into your XAP file directory. If you just want to reference an entire directory, you can use the "-path" Chiron.exe option. Script-tags: See the IronPython docs on this: http://ironpython.net/browser/docs.html#zip-files. Basically you must have a script-tag like this: <script type="application/x-zip-compressed" src="lib.zip"></script>. Then you can reference the "lib" directory in your scripts, including adding it to the path: <script type="text/ruby">$: << "lib"; require ''erb'';</script>. You can also just list out each Ruby file used: # foo.rb require ''bar'' <!-- index.html --> <script type="text/ruby" src="foo.rb" defer="true"></script> <script type="text/ruby" src="bar.rb" defer="true"></script> <script type="text/ruby"> require ''foo'' </script> I hope this shows that script-tags just download the script, and add it to the "virtual file-system" that the DLR-languages see. The "defer" attribute causes the script to not be run; it will be run when a script requires it.> I zipped the libs folder and added it to the page as <script type="application/zip" src="lib.zip"></script>. > When I try to require the assemblies, the files are not found. > > I tried to make the case simpler and zipped a simple rb file to a zip and included it in the page as well: > <script type="application/zip" src="test.zip"></script> > I tried: > require "TestClass.rb" > require "TestClass" > require ''test.zip/TestClass.rb'' > require ''test.zip/TestClass'' > > None of these worked. > > By the way, I see that Chiron loads the zip files... > > What am I doing wrong?Change the mime-type to application/x-zip-compressed and try requiring "test/TestClass" ... that will work. We should also allow application/zip as the mime-type: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26676. Keep in mind that Silverlight can only read archived files created with a deflate ZIP algorithm; but using Chiron to create the zip file will ensure it works ... something like "Chiron.exe /d:lib /x:lib.zip".> for assemblies you need to add an appmanifest I thinkActually, all the AppManifest.xaml does it load the assemblies for you; you can use "require" or "load_assembly" to accomplish the same thing, so I advise against touching the AppManifest.xaml, unless your XAML has dependencies on an assembly. Keep in mind there is no way to have an "assembly script-tag" ... you must put the assembly in a ZIP file.> if you put a app\myfile.rb in the zip file, you should be able to do require ''app/myfile''Close ... you have to use the file filename in the require call, or add the zip file name to the path (see example above). Today this only works when you use the zip file name without it''s extension, but that''s a bug IMO: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26677.> Which brings up another question - are we willing to "standardize" Gestalt by making it the best practice for using DLR languages in Silverlight?Well on its way; the http://ironpython.net/browser/ page only has documentation for the "Gestalt"-way, though the Chiron/XAP model will also be documented. Fun fact: while the first version of Gestalt (0.5) was made completely independently by the visitmix.com/labs<http://visitmix.com/labs> team, the 1.0 release was completely rewritten and merged into Microsoft.Scripting.Silverlight.dll. In fact, the current source code on gestalt.codeplex.com<http://gestalt.codeplex.com/> is only the code from 0.5; the latest source code for Microsoft.Scripting.Silverlight is in IronRuby''s GitHub and IronPython''s CodePlex source repos. Keep in mind the previous Chiron/XAP file model isn''t going away; Gestalt takes [too-must] advantage of how Silverlight expects apps to be structured, so there are some limitations to it. The glaring limitation is you can''t run gestalt apps out-of-browser; HTML doesn''t work there ... there might be a way around this by using Silverlight''s ability to host HTML content IN a Silverlight control, but that hasn''t been tested yet. So the Chiron/XAP model will continue to be supported, but I don''t advise using it unless you need to run out-of-browser. You can also combine the two; the IronRuby tutorial uses the Chiron/XAP model for the app, but the Gestalt-way to enable tests running in the browser. ~Jimmy _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Miguel A. Madero Reyes www.miguelmadero.com<http://www.miguelmadero.com> (blog) me at miguelmadero.com<mailto:me at miguelmadero.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100503/08aaf6cb/attachment.html>
Miguel Madero
2010-May-05 00:03 UTC
[Ironruby-core] Using Ruby''s standard libraries in Silverlight
Jimmy, I was thinking more of an scenario where one of the teams in a project do one of the modules in IronRuby that would be downloaded on demand. I guess one option would be for them to create a C# project and package their IR code in there. That project could also have the hosting and bootstrapping logic to hooked that module into the rest of the app. That''s certainly the simplest way. I was thinking to use Chiron to download the XAP and let a "ModuleLoader" worry about how hosting it. Now that I mentioned it I guess we could do something similar with Gestalt. I will play a bit with both options on the weekend. Miguel On Tue, May 4, 2010 at 3:59 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote:> When using IronRuby in a Silverlight app where the main language is C# or > VB, then you wouldn?t be using Chiron at all. You?d add the script files to > your Silverlight project, and use the DLR hosting API to run them. > > > > You could still use script-tags in this scenario as well; you?d need to > look at the source for Microsoft.Scripting.Silverlight.DynamicApplication > and call into its initialization logic from your app. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Miguel Madero > *Sent:* Sunday, May 02, 2010 8:18 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Using Ruby''s standard libraries in > Silverlight > > > > I think the Chiron model is better for different scenarios. You mentioned > OOB, but also if IronRuby (or other Dynamic Languages) are used as part of a > statically compiled app where XAPs and assemblies are distributed in the > typical SL way. Not sure how we would do it with Gestal as I''ve seen that it > relies on the Script tags. Is there a way of doing that programmatically? > > > > > On Thu, Apr 1, 2010 at 2:40 PM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > Wow, a lot of questions to answer here; let me know if I missed one ? > > > > > What is the recommendation for using Ruby''s standard libraries in > Silverlight applications? > > > Should the lib be copied to the project dir? should a reference be added > to the manifest? some other technique? > > > > Depends on whether your using the Chiron to generate a XAP file, or your > using dlr.js and embedding Ruby code in the HTML page with script-tags. > > > > Chiron to generate the XAP: > > Just copy the necessary Ruby stdlib files into your XAP file directory. If > you just want to reference an entire directory, you can use the ?-path? > Chiron.exe option. > > > > Script-tags: > > See the IronPython docs on this: http://ironpython.net/browser/docs.html#zip-files. Basically you must have a script-tag like this: <script type="application/x-zip-compressed" src="lib.zip"></script>. Then you can reference the ?lib? directory in your scripts, including adding it to the path: <script type="text/ruby">$: << "lib"; require ''erb'';</script>. > > > > You can also just list out each Ruby file used: > > > > # foo.rb > > require ''bar'' > > > > <!-- index.html --> > > <script type="text/ruby" src="foo.rb" defer="true"></script> > > <script type="text/ruby" src="bar.rb" defer="true"></script> > > <script type="text/ruby"> > > require ''foo'' > > </script> > > > > I hope this shows that script-tags just download the script, and add it to the ?virtual file-system? that the DLR-languages see. The ?defer? attribute causes the script to not be run; it will be run when a script requires it. > > > > > I zipped the libs folder and added it to the page as <script > type="application/zip" src="lib.zip"></script>. > > > When I try to require the assemblies, the files are not found. > > > > > > I tried to make the case simpler and zipped a simple rb file to a zip > and included it in the page as well: > > > <script type="application/zip" src="test.zip"></script> > > > I tried: > > > require "TestClass.rb" > > > require "TestClass" > > > require ''test.zip/TestClass.rb'' > > > require ''test.zip/TestClass'' > > > > > > None of these worked. > > > > > > By the way, I see that Chiron loads the zip files... > > > > > > What am I doing wrong? > > > > Change the mime-type to application/x-zip-compressed and try requiring > "test/TestClass" ? that will work. We should also allow application/zip as > the mime-type: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26676. Keep > in mind that Silverlight can only read archived files created with a deflate > ZIP algorithm; but using Chiron to create the zip file will ensure it works > ? something like ?Chiron.exe /d:lib /x:lib.zip?. > > > > > for assemblies you need to add an appmanifest I think > > > > Actually, all the AppManifest.xaml does it load the assemblies for you; you > can use ?require? or ?load_assembly? to accomplish the same thing, so I > advise against touching the AppManifest.xaml, unless your XAML has > dependencies on an assembly. > > > > Keep in mind there is no way to have an ?assembly script-tag? ? you must > put the assembly in a ZIP file. > > > > > if you put a app\myfile.rb in the zip file, you should be able to do > require ''app/myfile'' > > > Close ? you have to use the file filename in the require call, or add the > zip file name to the path (see example above). Today this only works when > you use the zip file name without it?s extension, but that?s a bug IMO: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26677. > > > Which brings up another question - are we willing to "standardize" > Gestalt by making it the best practice for using DLR languages in > Silverlight? > > Well on its way; the http://ironpython.net/browser/ page only has > documentation for the ?Gestalt?-way, though the Chiron/XAP model will also > be documented. Fun fact: while the first version of Gestalt (0.5) was made > completely independently by the visitmix.com/labs team, the 1.0 release > was completely rewritten and merged into > Microsoft.Scripting.Silverlight.dll. In fact, the current source code on > gestalt.codeplex.com is only the code from 0.5; the latest source code for > Microsoft.Scripting.Silverlight is in IronRuby?s GitHub and IronPython?s > CodePlex source repos. > > Keep in mind the previous Chiron/XAP file model isn?t going away; Gestalt > takes [too-must] advantage of how Silverlight expects apps to be structured, > so there are some limitations to it. The glaring limitation is you can?t run > gestalt apps out-of-browser; HTML doesn?t work there ? there might be a way > around this by using Silverlight?s ability to host HTML content IN a > Silverlight control, but that hasn?t been tested yet. So the Chiron/XAP > model will continue to be supported, but I don?t advise using it unless you > need to run out-of-browser. You can also combine the two; the IronRuby > tutorial uses the Chiron/XAP model for the app, but the Gestalt-way to > enable tests running in the browser. > > ~Jimmy > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > me at miguelmadero.com > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100505/d7125713/attachment-0001.html>
On 05/04/2010 06:03 PM, Miguel Madero wrote:> Jimmy, > > I was thinking more of an scenario where one of the teams in a project > do one of the modules in IronRuby that would be downloaded on demand. > > I guess one option would be for them to create a C# project and > package their IR code in there. That project could also have the > hosting and bootstrapping logic to hooked that module into the rest of > the app. That''s certainly the simplest way. I was thinking to use > Chiron to download the XAP and let a "ModuleLoader" worry about how > hosting it. Now that I mentioned it I guess we could do something > similar with Gestalt. > > I will play a bit with both options on the weekend. > > Miguel > On Tue, May 4, 2010 at 3:59 AM, Jimmy Schementi > <Jimmy.Schementi at microsoft.com <mailto:Jimmy.Schementi at microsoft.com>> > wrote: > > When using IronRuby in a Silverlight app where the main language > is C# or VB, then you wouldn?t be using Chiron at all. You?d add > the script files to your Silverlight project, and use the DLR > hosting API to run them. > > > > You could still use script-tags in this scenario as well; you?d > need to look at the source for > Microsoft.Scripting.Silverlight.DynamicApplication and call into > its initialization logic from your app. > > > > *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 > *Miguel Madero > *Sent:* Sunday, May 02, 2010 8:18 PM > *To:* ironruby-core at rubyforge.org <mailto:ironruby-core at rubyforge.org> > *Subject:* Re: [Ironruby-core] Using Ruby''s standard libraries in > Silverlight > > > > I think the Chiron model is better for different scenarios. You > mentioned OOB, but also if IronRuby (or other Dynamic Languages) > are used as part of a statically compiled app where XAPs and > assemblies are distributed in the typical SL way. Not sure how we > would do it with Gestal as I''ve seen that it relies on the Script > tags. Is there a way of doing that programmatically? > > > > > On Thu, Apr 1, 2010 at 2:40 PM, Jimmy Schementi > <Jimmy.Schementi at microsoft.com > <mailto:Jimmy.Schementi at microsoft.com>> wrote: > > Wow, a lot of questions to answer here; let me know if I missed one ? > > > > > What is the recommendation for using Ruby''s standard libraries in > Silverlight applications? > > > Should the lib be copied to the project dir? should a reference > be added to the manifest? some other technique? > > > > Depends on whether your using the Chiron to generate a XAP file, > or your using dlr.js and embedding Ruby code in the HTML page with > script-tags. > > > > Chiron to generate the XAP: > > Just copy the necessary Ruby stdlib files into your XAP file > directory. If you just want to reference an entire directory, you > can use the ?-path? Chiron.exe option. > > > > Script-tags: > > See the IronPython docs on this: http://ironpython.net/browser/docs.html#zip-files. Basically you must have a script-tag like this: <script type="application/x-zip-compressed" src="lib.zip"></script>. Then you can reference the ?lib? directory in your scripts, including adding it to the path: <script type="text/ruby">$: << "lib"; require ''erb'';</script>. > > > > You can also just list out each Ruby file used: > > > > # foo.rb > > require ''bar'' > > > > <!-- index.html --> > > <script type="text/ruby" src="foo.rb" defer="true"></script> > > <script type="text/ruby" src="bar.rb" defer="true"></script> > > <script type="text/ruby"> > > require ''foo'' > > </script> > > > > I hope this shows that script-tags just download the script, and add it to the ?virtual file-system? that the DLR-languages see. The ?defer? attribute causes the script to not be run; it will be run when a script requires it. > > > > > I zipped the libs folder and added it to the page as <script > type="application/zip" src="lib.zip"></script>. > > > When I try to require the assemblies, the files are not found. > > > > > > I tried to make the case simpler and zipped a simple rb file to a > zip and included it in the page as well: > > > <script type="application/zip" src="test.zip"></script> > > > I tried: > > > require "TestClass.rb" > > > require "TestClass" > > > require ''test.zip/TestClass.rb'' > > > require ''test.zip/TestClass'' > > > > > > None of these worked. > > > > > > By the way, I see that Chiron loads the zip files... > > > > > > What am I doing wrong? > > > > Change the mime-type to application/x-zip-compressed and try > requiring "test/TestClass" ? that will work. We should also allow > |application/zip| as the mime-type: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26676. Keep > in mind that Silverlight can only read archived files created with > a deflate ZIP algorithm; but using Chiron to create the zip file > will ensure it works ? something like ?Chiron.exe /d:lib /x:lib.zip?. > > > > > for assemblies you need to add an appmanifest I think > > > > Actually, all the AppManifest.xaml does it load the assemblies for > you; you can use ?require? or ?load_assembly? to accomplish the > same thing, so I advise against touching the AppManifest.xaml, > unless your XAML has dependencies on an assembly. > > > > Keep in mind there is no way to have an ?assembly script-tag? ? > you must put the assembly in a ZIP file. > > > > > if you put a app\myfile.rb in the zip file, you should be able to > do require ''app/myfile'' > > > Close ? you have to use the file filename in the require call, or > add the zip file name to the path (see example above). Today this > only works when you use the zip file name without it?s extension, > but that?s a bug IMO: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26677. > > > Which brings up another question - are we willing to > "standardize" Gestalt by making it the best practice for using DLR > languages in Silverlight? > > Well on its way; the http://ironpython.net/browser/ page only has > documentation for the ?Gestalt?-way, though the Chiron/XAP model > will also be documented. Fun fact: while the first version of > Gestalt (0.5) was made completely independently by the > visitmix.com/labs <http://visitmix.com/labs> team, the 1.0 release > was completely rewritten and merged into > Microsoft.Scripting.Silverlight.dll. In fact, the current source > code on gestalt.codeplex.com <http://gestalt.codeplex.com/> is > only the code from 0.5; the latest source code for > Microsoft.Scripting.Silverlight is in IronRuby?s GitHub and > IronPython?s CodePlex source repos. > > Keep in mind the previous Chiron/XAP file model isn?t going away; > Gestalt takes [too-must] advantage of how Silverlight expects apps > to be structured, so there are some limitations to it. The glaring > limitation is you can?t run gestalt apps out-of-browser; HTML > doesn?t work there ? there might be a way around this by using > Silverlight?s ability to host HTML content IN a Silverlight > control, but that hasn?t been tested yet. So the Chiron/XAP model > will continue to be supported, but I don?t advise using it unless > you need to run out-of-browser. You can also combine the two; the > IronRuby tutorial uses the Chiron/XAP model for the app, but the > Gestalt-way to enable tests running in the browser. > > ~Jimmy > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com <http://www.miguelmadero.com/> (blog) > me at miguelmadero.com <mailto:me at miguelmadero.com> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com <http://www.miguelmadero.com> (blog) > me at miguelmadero.com <mailto:me at miguelmadero.com> > > > _______________________________________________ > 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/20100504/82af48fd/attachment-0001.html>