librelist archives

« back to archive

Trouble with green shoes - not even starting infoes (GLib::Error)

Trouble with green shoes - not even starting infoes (GLib::Error)

From:
Tobias Pfeiffer
Date:
2011-09-17 @ 23:56
Hello everyone,

me again! I continued my work on infoes today. I made some good 
refactorings and now I even have tabs, the bad part is just that now my 
green shoes won't run anymore which (presumably) my mentors won't like.

This is the 

error:/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/helper_methods.rb:117:in

`parse_markup': Error on line 1: Entity did not end with a semicolon; 
most likely you used an ampersand character without intending to start 
an entity - escape ampersand as & (GLib::Error)
Whole stacktrace at:  https://gist.github.com/1224500
And honestly I don't know what's going on there. The last part of my 
code it complains about in the stack trace is a method stolen straight 
from hacketyhack. Maybe somebody else can make sense of this.

The code of the project resides at: https://github.com/PragTob/infoes

You make the green_shoes version via:

     bundle install
     rake green_shoes
     ruby greenfoes.rb

On a side note: The rake task doesn't do much, just the following:

     def self.make_green(inputfile_path, outputfile_path)
       content = File.read inputfile_path
       # m lets . match new lines
       content.gsub!(/Shoes\.setup do.*?end/m, "require 'green_shoes'")
       File.open(outputfile_path, 'w') { |file| file.write content }
     end

is there already some kind of a more sophisticated tool for this?

Cheers,
Tobi

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
ashbb
Date:
2011-09-18 @ 01:39
Hi Tobi,

I cloned your PragTob/infoes from github and edited a little bit, then I got
this snapshot: http://www.rin-shun.com/shoes/geenfoes_about.png

The following diff is my editing. Try it out. ;-)

C:\tmp\infoes>diff infoes.rb greenfoes.rb
2c2
<
---
> =begin
9c9,10
<
---
> =end
> require 'green_shoes'

C:\tmp\infoes>cd lib

C:\tmp\infoes\lib>diff twitter_orig.rb twitter.rb
81c81
<     info number
---
>     #info number

C:\tmp\infoes\lib>cd ../tabs

C:\tmp\infoes\tabs>diff side_tab_orig.rb side_tab.rb
6c6,7
<       @content = stack :hidden => true do content end
---
>       #@content = stack :hidden => true do content end
>       @content = stack do content end

ps. Error has occured at line `stack :hidden => true do`. It's not good.
    I have to debug Green Shoes with more lots of cases. :-D

ashbb

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
Tobias Pfeiffer
Date:
2011-09-18 @ 09:38
Hey ashbb,

thank you so much for your help! I incorporated all your changes but it 
still crashes with the same error in my Linux Mint 11 x64 machine.

Sorry for leaving the info call in there, it was late and I was tired - 
I forgot to commit and push :P

Thanks,
Tobi

On 09/18/2011 03:39 AM, ashbb wrote:
> Hi Tobi,
>
> I cloned your PragTob/infoes from github and edited a little bit, then I got
> this snapshot: http://www.rin-shun.com/shoes/geenfoes_about.png
>
> The following diff is my editing. Try it out. ;-)
>
> C:\tmp\infoes>diff infoes.rb greenfoes.rb
> 2c2
> <
> ---
>   >  =begin
> 9c9,10
> <
> ---
>   >  =end
>   >  require 'green_shoes'
>
> C:\tmp\infoes>cd lib
>
> C:\tmp\infoes\lib>diff twitter_orig.rb twitter.rb
> 81c81
> <      info number
> ---
>   >      #info number
>
> C:\tmp\infoes\lib>cd ../tabs
>
> C:\tmp\infoes\tabs>diff side_tab_orig.rb side_tab.rb
> 6c6,7
> <        @content = stack :hidden =>  true do content end
> ---
>   >        #@content = stack :hidden =>  true do content end
>   >        @content = stack do content end
>
> ps. Error has occured at line `stack :hidden =>  true do`. It's not good.
>       I have to debug Green Shoes with more lots of cases. :-D
>
> ashbb

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
ashbb
Date:
2011-09-18 @ 11:05
Hi Tobi,

> it still crashes with the same error in my Linux Mint 11 x64 machine.
Umm,...
Could you upload your latest greenfoes.rb and error message?
I'd like to confirm this issue is just on Linux but not on Windows.

> Sorry for leaving the info call in there, it was late and I was tired
No prob.
Have a good weekend. ;-)

ashbb

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
Tobias Pfeiffer
Date:
2011-09-18 @ 12:31
Hi ashbb,

see attachement for greenfoes.
Error message:

tobi@business ~/github/infoes $ ruby greenfoes.rb

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/helper_methods.rb:117:in

`parse_markup': Error on line 1: Entity did not end with a semicolon; 
most likely you used an ampersand character without intending to start 
an entity - escape ampersand as & (GLib::Error)
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/helper_methods.rb:117:in

`make_pango_attr'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:123:in

`textblock'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:167:in

`para'
     from /home/tobi/github/infoes/tabs/side_tab.rb:30:in `method_missing'
     from /home/tobi/github/infoes/lib/tweet.rb:37:in `block (2 levels) 
in display'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/slot.rb:30:in

`initialize'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:59:in

`new'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:59:in

`stack'
     from /home/tobi/github/infoes/tabs/side_tab.rb:30:in `method_missing'
     from /home/tobi/github/infoes/lib/tweet.rb:36:in `block in display'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/slot.rb:30:in

`initialize'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:69:in

`new'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:69:in

`flow'
     from /home/tobi/github/infoes/tabs/side_tab.rb:30:in `method_missing'
     from /home/tobi/github/infoes/lib/tweet.rb:31:in `display'
     from /home/tobi/github/infoes/tabs/home.rb:15:in `block in content'
     from /home/tobi/github/infoes/tabs/home.rb:15:in `each'
     from /home/tobi/github/infoes/tabs/home.rb:15:in `content'
     from /home/tobi/github/infoes/tabs/side_tab.rb:7:in `block (2 
levels) in initialize'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/slot.rb:30:in

`initialize'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:59:in

`new'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/app.rb:59:in

`stack'
     from /home/tobi/github/infoes/tabs/side_tab.rb:30:in `method_missing'
     from /home/tobi/github/infoes/tabs/side_tab.rb:7:in `block in 
initialize'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/slot.rb:107:in

`prepend'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/slot.rb:101:in

`append'
     from /home/tobi/github/infoes/tabs/side_tab.rb:5:in `initialize'
     from greenfoes.rb:38:in `new'
     from greenfoes.rb:38:in `get_tab'
     from greenfoes.rb:44:in `open_tab'
     from greenfoes.rb:57:in `block in <main>'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/main.rb:81:in

`instance_eval'
     from 

/home/tobi/.rvm/gems/ruby-1.9.2-p290@greenfoes/gems/green_shoes-1.0.282/lib/shoes/main.rb:81:in

`app'
     from greenfoes.rb:49:in `<main>'

As I saw your first tweet I tried to upgrade my gtk but failed and filed 
a bugreport.. however apparently according to your newest tweet it 
doesn't seem to work either way so well time double wasted :-<

cheers and thanks for your help!
Tobi



On 09/18/2011 01:05 PM, ashbb wrote:
> Hi Tobi,
>
>   >  it still crashes with the same error in my Linux Mint 11 x64 machine.
> Umm,...
> Could you upload your latest greenfoes.rb and error message?
> I'd like to confirm this issue is just on Linux but not on Windows.
>
>   >  Sorry for leaving the info call in there, it was late and I was tired
> No prob.
> Have a good weekend. ;-)
>
> ashbb
>

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
ashbb
Date:
2011-09-18 @ 14:32
Hi Tobi,

Now I understood your problem. :)

To recreate your problem, at first I had to do "Twitter Settings".

After finishing "Twitter Settings (input PIN number)",
then I ran your greenfoes.rb again,
I got the same error you attached at your previous post.

Okay, I could recreate your problem on my Windows 7.
So, I could figure out the problem.

This problem occurs if a tweet includes HTML specific characters,
i.e. &, <, etc.

Sorry, this is one of the restrictions on Green Shoes. xx-P

Here is a workaround. Look at infoes/lib/tweet.rb, line 36-39 and
the following code. Replacing '&' to '&'.

      shoes.stack width: -TWEET_PIC_WIDTH do
        text.gsub! '&', '&'
        shoes.para publisher_name, ": ", text, " ",
          shoes.link("Go to Tweet") { Launchy.open(url) }
      end

Finally, I got this snapshot:
http://www.rin-shun.com/shoes/greenfoes_snapshot_1.png

ashbb

Re: [shoes] Trouble with green shoes - not even starting infoes (GLib::Error)

From:
Tobias Pfeiffer
Date:
2011-09-18 @ 15:28
Hi ashbb!

You're awesome! It starts again. However it crashes on most of my tabs 
but I'll try to have a look into that and then report back here again :P

About the screen shots, all the space between the tweets is really 
strange. Sometimes there is like space for another tweet between two 
tweets and sometimes it's ok. I only have this problem with green shoes, 
not red shoes. Any idea why that might be?

Thanks again!
Tobi

On 09/18/2011 04:32 PM, ashbb wrote:
> Hi Tobi,
>
> Now I understood your problem. :)
>
> To recreate your problem, at first I had to do "Twitter Settings".
>
> After finishing "Twitter Settings (input PIN number)",
> then I ran your greenfoes.rb again,
> I got the same error you attached at your previous post.
>
> Okay, I could recreate your problem on my Windows 7.
> So, I could figure out the problem.
>
> This problem occurs if a tweet includes HTML specific characters,
> i.e.&,<, etc.
>
> Sorry, this is one of the restrictions on Green Shoes. xx-P
>
> Here is a workaround. Look at infoes/lib/tweet.rb, line 36-39 and
> the following code. Replacing '&' to'&'.
>
>         shoes.stack width: -TWEET_PIC_WIDTH do
>           text.gsub! '&','&'
>           shoes.para publisher_name, ": ", text, " ",
>             shoes.link("Go to Tweet") { Launchy.open(url) }
>         end
>
> Finally, I got this snapshot: 
http://www.rin-shun.com/shoes/greenfoes_snapshot_1.png
>
> ashbb
>