views:

259

answers:

2
+1  Q: 

Shoes and Gems

I have shoes raisins (0.r1134) [i686-darwin8.9.1] +video

I'm trying to set up a Shoes.setup block like this:


Shoes.setup do
  gem 'mini_exiftool'
  gem 'xml-simple > 1.0'

  require "mini_exiftool"
  require 'xmlrpc/client'
  require 'xmlsimple.rb'
  require "my_webservice_api_wrapper"

  mwa = MyWebserviceApiWrapper.new
  mwa.login  # problems...
end

All works fine until we get to mwa.login, which takes us off to my XML-RPC wrapper API that will do a secure login. I get the error:

undefined method `closed?' for #

If I fire up irb and load "my_webservice_api_wrapper.rb" it all works fine, so I'm thinking maybe I misunderstood what should be loaded in Shoes and when.

Any help appreciated. Shoes looks really cool.

+1  A: 

I think you need to break that up into two separate blocks:

Shoes.setup do
  gem 'mini_exiftool'
  gem 'xml-simple > 1.0'
end

require "mini_exiftool"
require 'xmlrpc/client'
require 'xmlsimple.rb'
require "my_webservice_api_wrapper"

Shoes.app do
  mwa = MyWebserviceApiWrapper.new
  mwa.login  # problems...
end
smountcastle
A: 

I hope your login module doesn't use HTTPS as I don't think that is supported in Shoes yet.

Ram
I think that's it. This has gone back burner for two reasons: 1) I need https; and 2) The WS result set is so bit it slows the control to a crawl. With Cocoa, you load controls on demand so memory is only allocated to display what the user sees (kinda). With Shoes, it's harder (AFAIK) to implement this on-demand loading behavior into the control.
Steve

related questions