require "xmlrpc/server"
s = XMLRPC::Server.new(8080)
s.add_handler("reverse") do |s|
s.reverse
end
s.add_handler("scramble") do |s|
s.split(//).sort{rand}.join
end
s.set_default_handler do |name, *args|
raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
" or wrong number of parameters!")
end
s.serve
I am having trouble finding the free and open Flex SDK (not sure it
exists yet), but Flex/Appollo/AIR might make a nice UI for a Ruby
application.
Regards,
Paul.
module FlexXmlRpcApp
def self.publish(*methods)
instance_variable_set '@s', XMLRPC::Server.new(8080)
methods.each do |m|
@s.add_handler(m.to_s) do
self.send m
end
end
end
end
class MyApp
include FlexXmlRpcApp
def foo
end
I wrote that all within the Gmail window, so no promises... =)
Although it's kind of sad that we resort to XMLRPC for a fat client
GUI (unless I'm misunderstanding).
--
For building invisible machines...
http://invisibleblocks.wordpress.com
class MyApp
include FlexXmlRpcApp
publish :foo
def foo
'foo'
end
end
On Jun 20, 11:25 am, "Dan Bernier" <danbern...@gmail.com> wrote:
> That sounds interesting! From your example, it'd probably be easy to
> add something like attr_reader, so you can make an Application object,
> and "publish" certain methods to the GUI.
>
> module FlexXmlRpcApp
> def self.publish(*methods)
> instance_variable_set '@s', XMLRPC::Server.new(8080)
> methods.each do |m|
> @s.add_handler(m.to_s) do
> self.send m
> end
> end
> end
> end
>
> class MyApp
> include FlexXmlRpcApp
> def foo
>
> end
>
> I wrote that all within the Gmail window, so no promises... =)
>
> Although it's kind of sad that we resort to XMLRPC for a fat client
> GUI (unless I'm misunderstanding).
>
Right, it is *very* easy to put together an xml-rpc server to expose
your ruby functionality and it works. This could be used for a Fat
Client or just for a desktop application. It looks like a reasonably
easy way to put a nice-looking GUI on your Ruby as an alternative to,
say, writing a Camping application just to get a GUI.
Regards,
Paul.
If you find more info on the Flex thing, let me know. This could be
the trojan horse for Ruby at my company... =)
> If you find more info on the Flex thing, let me know. This could be
> the trojan horse for Ruby at my company... =)
Do we have anything planned for the July meeting? I'd love to see a
presentation on this or at least get together and hack around on it.
I don't have free cycles this month to prepare a talk myself, but it's
definitely an interesting topic,
On Jun 20, 12:08 pm, "Gregory Brown" <gregory.t.br...@gmail.com>
wrote:
Good idea, we should have room for it. AFAIK, we had planned for Gary
to give us a RailsConf report.
July 11th is the 'second Wednesday'. Can we get a room at UNH again?
Regards,
Paul.
On Jun 20, 12:08 pm, "Gregory Brown" <gregory.t.br...@gmail.com>
wrote:
> On 6/20/07, Dan Bernier <danbern...@gmail.com> wrote:
>
> > If you find more info on the Flex thing, let me know. This could be
> > the trojan horse for Ruby at my company... =)
Surely you don't intend to suggest that Ruby is malware?
http://en.wikipedia.org/wiki/Trojan_horse_%28computing%29
;)
Regards,
Paul
> July 11th is the 'second Wednesday'. Can we get a room at UNH again?
I can ask about it, though reserving it last time was a bit of a
hassle. Do we have other options? If not, let me know, and I'll put
in for the room.
On 6/20/07, paul <nov...@gmail.com> wrote:
>
>
>
On Jun 20, 3:42 pm, "Dan Bernier" <danbern...@gmail.com> wrote:
> Maybe I should call it "Ruby's gelcap"...something to make it go down
> more smoothly. =)
>
> On 6/20/07, paul <nova...@gmail.com> wrote:
>
>
>
>
>
> > On Jun 20, 12:08 pm, "Gregory Brown" <gregory.t.br...@gmail.com>
> > wrote:
> > > On 6/20/07, Dan Bernier <danbern...@gmail.com> wrote:
>
> > > > If you find more info on the Flex thing, let me know. This could be
> > > > the trojan horse for Ruby at my company... =)
> > Surely you don't intend to suggest that Ruby is malware?
> >http://en.wikipedia.org/wiki/Trojan_horse_%28computing%29
> > ;)
>
> > Regards,
>
> > Paul
>
> --
> For building invisible machines...http://invisibleblocks.wordpress.com
I found where you can get the (freebeer, no sign-on required) Flex 2.0
SDK http://www.adobe.com/products/flex/downloads/
The AIR (formerly Apollo, the runtime that runs on the desktop and
outside the browser) is available here: http://labs.adobe.com/downloads/air.html
There are OSX and Windows version, Linux is promised. It is a small
download (if you already have Flash 9.0 installed).
You can also download a trial version of Flex 3.0 alpha and "Flex
Builder" the Ecplise plugin that gives you an IDE for all of the
above, but they are not (beer)free and Flex Builder is not going to be
free
Regards,
Paul.
^ unless of course, you're on x86_64, which is half of the reason to
use GNU/Linux. :-/
(for me)
But i guess where you'd need a GUI mainly is OS X and Windows, so that
sounds neat.
On Jun 21, 10:12 am, "Gregory Brown" <gregory.t.br...@gmail.com>
wrote:
> On 6/21/07, paul <nova...@gmail.com> wrote:
>
>
>
>
>
> > On Jun 20, 3:42 pm, "Dan Bernier" <danbern...@gmail.com> wrote:
> > > Maybe I should call it "Ruby's gelcap"...something to make it go down
> > > more smoothly. =)
>
> > > On 6/20/07, paul <nova...@gmail.com> wrote:
>
> > > > On Jun 20, 12:08 pm, "Gregory Brown" <gregory.t.br...@gmail.com>
> > > > wrote:
> > > > > On 6/20/07, Dan Bernier <danbern...@gmail.com> wrote:
>
> > > > > > If you find more info on the Flex thing, let me know. This could be
> > > > > > the trojan horse for Ruby at my company... =)
> > > > Surely you don't intend to suggest that Ruby is malware?
> > > >http://en.wikipedia.org/wiki/Trojan_horse_%28computing%29
> > > > ;)
>
> > > > Regards,
>
> > > > Paul
>
> > > --
> > > For building invisible machines...http://invisibleblocks.wordpress.com
>
> > I found where you can get the (freebeer, no sign-on required) Flex 2.0
> > SDKhttp://www.adobe.com/products/flex/downloads/
>
> > The AIR (formerly Apollo, the runtime that runs on the desktop and
> > outside the browser) is available here: http://labs.adobe.com/downloads/air.html
> > There are OSX and Windows version, Linux is promised. It is a small
> > download (if you already have Flash 9.0 installed).
>
> ^ unless of course, you're on x86_64, which is half of the reason to
> use GNU/Linux. :-/
> (for me)
>
> But i guess where you'd need a GUI mainly is OS X and Windows, so that
> sounds neat.
Yeah, depends on your target audience. For a Corp. environment, that
is probably enough.
On Jun 22, 10:07 am, paul <nova...@gmail.com> wrote:
> Now there is a video: http://www.adobe.com/devnet/flex/articles/eckel_video.html
>
Here is another video of Bruce Eckel and James Ward building a Flex
front end to a RESTful back end [0]. They are using TurboGears, but
it could just as easily been Rails or Camping:
This gives a better idea of what is involved in using Flex and
ActionScript. I like the REST approach better than xml-rpc too.
Regards,
Paul.
[0] http://www.adobe.com/devnet/flex/articles/eckel_video.html