[Ironruby-core] Why IronRuby?

2009-06-17 Thread Mohammad Azam
I have been having fun playing around with IronRuby but one question keeps coming to my mind which is Why IronRuby? What purpose does it serve? I know we can use the simplicity of the IronRuby language to call .NET API's. This means we have two powers combined but will the IronRuby interoperabilit

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Mohammad Azam
Thanks! -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core

Re: [Ironruby-core] Converting an Object to Collection to Bind to DataGridVi

2009-06-17 Thread Jimmy Schementi
Did you take a look at how the example I sent you worked? http://github.com/jschementi/railsconf09/blob/master/8-ardb/app.rb ~js > -Original Message- > From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core- > boun...@rubyforge.org] On Behalf Of Mohammad Azam > Sent: Wednesday,

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Brannon Jones
That code should use 'ensure', to make sure the connection is closed at the end of the block: require 'mscorlib' require 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' include System::Data::SqlClient begin connection = SqlConnection.new('Server=localhost;Database

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Jimmy Schementi
Definitely, WinForms isn't anything special to restrict using SQLServer. I actually show this briefly here: http://blog.jimmy.schementi.com/2009/05/ironruby-at-railsconf-2009.html#sql Source code is here: http://github.com/jschementi/railsconf09/tree/master/8-ardb ~js > -Original Message---

Re: [Ironruby-core] Converting an Object to Collection to Bind to DataGridVi

2009-06-17 Thread Mohammad Azam
Here is one possible solution: def bind_customes_to_grid(customer) list = Array.new list[0] = customer $gvCustomers.DataSource = list end -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://

Re: [Ironruby-core] Converting an Object to Collection to Bind to DataGridVi

2009-06-17 Thread Mohammad Azam
Here is another version: def bind_customes_to_grid(customer) $gvCustomers.DataSource = Array.new.push(customer) end -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listi

[Ironruby-core] Converting an Object to Collection to Bind to DataGridView

2009-06-17 Thread Mohammad Azam
Hi, I have the following code which I am using to bind an object to the Window Forms dataGridView control: def bind_customes_to_grid(customer) $gvCustomers.DataSource = customer end Now, I need to convert the customer into a collection so it can be binding to the DataGridview control. How ca

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Jimmy Schementi
Thanks! I've added this to the IronRuby .NET documentation just as a placeholder: http://ironruby.net/Documentation/.NET/SQL ~js > -Original Message- > From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core- > boun...@rubyforge.org] On Behalf Of Mohammad Azam > Sent: Wednesday,

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Mohammad Azam
Just wanted to share basic code to insert first_name and last_name into the database. require 'mscorlib' require 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' SqlConnection = System::Data::SqlClient::SqlConnection SqlCommand = System::Data::SqlClient::SqlComm

Re: [Ironruby-core] is there a way to pick a method overload?

2009-06-17 Thread Jim Deville
I believe it is UnitOfWork.current.method(:find).overloads().call(). Check in the subfolders of merlin/Main/Languages/Ruby/Tests/interop/net/method/ for overload_spec.rb to see it. JD -Original Message- From: Ivan Porto Carrero Sent: June 17, 2009 12:17 PM To: ironruby-core Subject:

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Mohammad Azam
Thanks! yeah I might be interested in using any .NET ORM! I will try out Jimmy Rails ORM ActiveRecord. I think it will also work for a windows application. Let me check out the dbi module. Ivan Porto carrero wrote: > You can use any OR/M in the .NET space to connect to databases.Writing > que

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Mohammad Azam
Hi Jimmy, Can I use the ActiveRecord SQL SERVER with Window Forms projects? -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Jimmy Schementi
You could use the ActiveRecord SQLServer adapter ... Look for documentation under the Rails section in ironruby.net/documentation. ~Jimmy Sent from my phone On Jun 17, 2009, at 12:13 PM, "Mohammad Azam" wrote: > Hi, > > I am trying to find a way to access database (SQL SERVER) using > IronRuby.

Re: [Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Ivan Porto Carrero
You can use any OR/M in the .NET space to connect to databases.Writing queries will be somewhat challenging though :) Jimmy also wrote a sql server adapter for activerecord that comes with rails so you could also use the rails OR/M ActiveRecord http://github.com/jschementi/activerecord-mssql-adap

[Ironruby-core] is there a way to pick a method overload?

2009-06-17 Thread Ivan Porto Carrero
Hi Is there a way to pick a CLR method overload? var query = new Query(); UnitOfWorkScope.Current.Find(query); That find method takes a Query type or a ProcedureQuery type where ProcedureQuery would be a stored proc call. Also ProcedureQuery is a more specialized version of a Query class. Current

[Ironruby-core] Accessing Database Using IronRuby

2009-06-17 Thread Mohammad Azam
Hi, I am trying to find a way to access database (SQL SERVER) using IronRuby. One option is to use C# and ADO.NET classes to access the database but was wondering if IronRuby has a build in support for dynamic SQL so I don't have to deal with ADO.NET for database access. -- Posted via http://www.

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I have the exact same path in the ir.exe.config file. But I can only run the open-uri if I am in the lib folder where the file is physically located. This is really strange! -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Iro

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
Here is the complete ir.exe.config file: -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-c

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Jim Deville
Usually, the one in > C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libs Contains hacks or workarounds to load the correct one from > C:\ironruby\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\re > dist-libs\ruby\1.8 In other cases, the first one may simply load code from C#. What doe

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
Here is the part of the ir.exe.config file. -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
for me the compiled binaries end up in: C:\tools\ironruby\merlin\main\bin\debug and this is how the relevant tag looks like in that ir.exe.config file I know it's lame but it works for me. + C:\tools\ironruby (master) » ir IronRuby 0.5.0.0 on .NET 2.0.50727.4918 Copyright (c) Microsoft Corpo

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I am using ir command to run it. It is all ruby code. I went to the C:\ironruby\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ruby\1.8 folder and run the following code: require 'open-uri' it asked for stringio (not sure why it was missing) so I placed it in the 1.8 fold

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
Actually I checked using the ir.exe command line and it did not work either. It seems like the C:\ironruby\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ruby\1.8 and C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libs contains duplicate rb files. One open-uri is for url a

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
are you hosting ironruby in your application or are you using the ir command to run it? Are the paths correct in ir.exe.config? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
ok you also need the uri file open-uri has a dependency on that file. But still I think your search paths are messed up. how does you config look like? Where is ironruby located did you pick a release or build from git? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
Here is the version: C:\IronRubyProjects\IronRubyTaskListApplication>ir -v IronRuby 0.5.0.0 on .NET 2.0.0.0 -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/iro

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I tried with the path and got the following error: require File.dirname(__FILE__) + '/libs/open-uri' C:\IronRubyProjects\IronRubyTaskListApplication>ir main_form.rb :0:in `require': no such file to load -- uri (LoadError) from ./libs/open-uri.rb:1 from main_form.rb:4 from

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I have placed the open-uri file in the libs folder within the project. But for some reason it blows up and says unable to locate open-uri file. -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Shay Friedman
Can you check if the open-uri.rb file exists in the folder: \External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ruby\1.8\ -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/li

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
what version of ironruby are you using?it looks like your search paths are messed up. for example does require File.dirname(__FILE__) + '/libs/open-uri' work? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casua

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
If I put: require 'open-uri' then it throws the error that error locating the file 'open-uri'. I used the following code: def scrape_page() uri = URI.parse("http://somewhere.com/default.aspx";) end And now it throws the exception: Unintitialzied constant Object: URI Ivan Porto carrero w

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I tried to add a require 'open-uri' but for some reason it is not able to locate the open-uri files. I have placed the open-uri in the libs folder and I said: require 'libs/open-uri' but it is not able to locate the file. -- Posted via http://www.ruby-forum.com/. ___

[Ironruby-core] Command line Option Parsing broken

2009-06-17 Thread Will Green
Hot on the heels of my blog post about getting Cucumber working with IronRuby, I've discovered that some change in the last 2 weeks has caused igem to stop parsing command line arguments correctly. The problem is that it sees arguments like --bindir as the name of a gem to install, rather than a co

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
if you have openuri required just remove the File that should work or uri = URI.parse("http://somewhere.com/default.aspx";) uri.open do |f| #some logic here end or you could just use open("http://somewhere.com/default.aspx";) do |f| # some logic here end taken from http://www.ruby-doc.org

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Shay Friedman
You're trying to use the File class to open URIs which is not supported. Try open instead of File.open (and add require "open-uri" as well). Shay. Shay Friedman http://www.ironshay.com Follow me: http://twitter.com/ironshay -- Posted via http://www.ruby-forum.com/. __

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Mohammad Azam
I am using the following code to scrape the webpage. button = Button.new button.Text = 'Scrape URL' button.Location = System::Drawing::Point.new(108,61) button.click do |sender,args| page = File.open("http://www.azamsharp.com/Default.aspx";) System::Windows::Forms::MessageBox.Show(page.read

Re: [Ironruby-core] Flagged enums

2009-06-17 Thread Jim Deville
enum/mapping_spec.rb would be fine. -Original Message- From: Jimmy Schementi Sent: June 16, 2009 11:59 PM To: ironruby-core@rubyforge.org Subject: Re: [Ironruby-core] Flagged enums This works now: >>> AnchorStyles.bottom | AnchorStyles.left => Bottom, Left Jim, there should be specs

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
it are just DLL's you could host them inside your own application.ir.exe also calls out to those libraries to do its work --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Shay Friedman
How can IronRuby work if it's not installed? -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core

Re: [Ironruby-core] Accessing open-uri from the same directory

2009-06-17 Thread Ivan Porto Carrero
it can be useful when you want to deploy your application to systems where you don't know if ironruby is installed etc. I'm doing the same for an ironrubymvc application. I still have to find a nicer solution to that maybe by reusing the ironruby configuration to make those paths configurable. ---

Re: [Ironruby-core] IronRuby MVC sample

2009-06-17 Thread Ivan Porto Carrero
I built mono from trunk over the weekend and there it works :D --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Wed, Jun 17, 2009 at 7:54 AM,

Re: [Ironruby-core] Flagged enums

2009-06-17 Thread Thibaut Barrère
Hi, This works now: > > >>> AnchorStyles.bottom | AnchorStyles.left > > => Bottom, Left > thanks! -- Thibaut ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core