# \[HELP\] make samples Ruby 1.9 ready

**URL:** <https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422>\
**Category:** Ruby-Gnome 2\
**Created:** [February 19, 2011, 3:59pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422 "2011-02-19T15:59:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 19, 2011, 3:59pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/1 "2011-02-19T15:59:46Z")

</div>

Hi,

We have sample programs in sample/ directory. If you  
installed Ruby/GTK2 as gem, you will find samples in  
$GEM\_HOME/gems/gtk2-0.90.7/sample/.

Some of samples aren’t Ruby 1.9 ready. We want to make all  
samples Ruby 1.9 ready. We want your help. Could you try  
all Ruby-GNOME2 (Ruby/GLib2, Ruby/GTK2 and so on) samples,  
fix not Ruby 1.9 ready samples and send a patch?

(We don’t have a list of all not Ruby 1.9 ready  
samples. Sorry.)

Here are main broken reasons:

1. not M17N ready  
Solution: add “# -_- coding: utf-8 -_-” at the top.

2. $LOAD\_PATH doesn’t have ‘.’  
Solution: add “$LOAD\_PATH.unshift(’.’)”.

We hope your help!

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 20, 2011, 9:50pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/2 "2011-02-20T21:50:49Z")

</div>

I try to help with that in the coming months but personally I am still  
using Ruby 1.8.x so it will take me some time before I manage to migrate  
to Ruby 1.9.x successfully 🙂

(I had and still have many problems with the encoding changes in Ruby  
1.9.x)

Thanks.

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 21, 2011, 4:39pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/3 "2011-02-21T16:39:15Z")

</div>

Hi.

Can I find sample codes in svn repo ?  
They have eluded me.

(I do not use gems.)

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 22, 2011, 5:38pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/4 "2011-02-22T17:38:48Z")

</div>

I have created a page on the hiki :  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples) .  
I have list all the ruby files I found in samples directories.  
I will test the glib2 samples soon.

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 22, 2011, 11:29pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/5 "2011-02-22T23:29:33Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [HELP] make samples Ruby 1.9 ready” on  
Sun, 20 Feb 2011 21:50:49 +0100,  
Marc H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I try to help with that in the coming months but personally I am still  
> using Ruby 1.8.x so it will take me some time before I manage to migrate  
> to Ruby 1.9.x successfully 🙂
> 
> (I had and still have many problems with the encoding changes in Ruby  
> 1.9.x)

Thanks!  
We’ll waiting for you!

–  
kou

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 22, 2011, 11:33pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/6 "2011-02-22T23:33:55Z")

</div>

Hi,

In [AANLkTi=removed\_email\_address@domain.invalid](mailto:AANLkTi=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [HELP] make samples Ruby 1.9 ready” on  
Mon, 21 Feb 2011 16:38:36 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can I find sample codes in svn repo ?

Yes.  
You can find sample codes in sample/ directory.

% svn co

> **[Ruby-GNOME 2](https://sourceforge.net/projects/ruby-gnome2/)**
>
> Download Ruby-GNOME 2 for free. This project is a set of Ruby language bindings for the various application development libraries included with the GNOME/GTK+ environment. This project is for GTK+2.0 or later.

ruby-gnome2  
% ruby-gnome2  
% ls -d \*/sample  
gdk\_pixbuf2/sample gstreamer/sample gtksourceview2/sample  
rsvg2/sample  
glib2/sample gtk2/sample pango/sample vte/sample  
goocanvas/sample gtkmozembed/sample poppler/sample

Hmm!? You already found sample codes!  
I’m sorry for my late response. :\<

–  
kou

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 22, 2011, 11:35pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/7 "2011-02-22T23:35:11Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [HELP] make samples Ruby 1.9 ready” on  
Tue, 22 Feb 2011 17:36:47 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have created a page on the hiki :  
> [http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples) .  
> I have list all the ruby files I found in samples directories.

Thanks! It’s very helpful!

> I will test the glib2 samples soon.

Thanks. We’ll waiting for your work.

–  
kou

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 23, 2011, 12:05am UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/8 "2011-02-23T00:05:12Z")

</div>

2011/2/22 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Thanks! It’s very helpful!
> 
> > I will test the glib2 samples soon.
> 
> Thanks. We’ll waiting for your work.

glib2 tests:

- bookmarkfile.rb gives a warning
- completion.rb and keyfile.rb gives an error
- I am not sure how to use iochannel.rb
- all other samples are ruby 1.9 ready

See [http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples#glib2](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples#glib2) .

> –  
> kou

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 25, 2011, 11:42am UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/9 "2011-02-25T11:42:37Z")

</div>

Hi,

In [AANLkTinAquRmm5=9=removed\_email\_address@domain.invalid](mailto:AANLkTinAquRmm5=9=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [HELP] make samples Ruby 1.9 ready” on  
Wed, 23 Feb 2011 00:04:55 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> glib2 tests:
> 
> - bookmarkfile.rb gives a warning
> - completion.rb and keyfile.rb gives an error
> - I am not sure how to use iochannel.rb
> - all other samples are ruby 1.9 ready
> 
> See [http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples#glib2](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Status+of+samples#glib2) .

Thanks for checking Ruby/GLib2 samples.  
Could someone fix the warning and error on Ruby 1.9?

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [February 28, 2011, 8:21pm UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/10 "2011-02-28T20:21:47Z")

</div>

Hi.

I have checked all the gtk-demo samples but the cairo ones.  
I will try to commit my changes (see diff file). Should I split them  
in 2 commits (main.rb and textview.rb).  
Does the syntax of Changelog is correct ?

For the commit should I use this URL  
svn+ssh://removed\_email\_address@domain.invalid/svnroot/ruby-gnome2  
or https protocole is enough ?

---

<div class="post-metadata">

**Author:** ![Kouhei\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Post date:** [March 1, 2011, 4:49am UTC](https://www.ruby-forum.com/t/help-make-samples-ruby-1-9-ready/203422/11 "2011-03-01T04:49:38Z")

</div>

Hi,

In [AANLkTi==removed\_email\_address@domain.invalid](mailto:AANLkTi==removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [HELP] make samples Ruby 1.9 ready” on  
Mon, 28 Feb 2011 20:21:12 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have checked all the gtk-demo samples but the cairo ones.

Thanks!

> I will try to commit my changes (see diff file). Should I split them  
> in 2 commits (main.rb and textview.rb).

I’ve checked your patch. It looks OK to me. Please commit it.

You don’t need to split them in 2 commits because both of  
them are fixes for Ruby 1.9. If changes aren’t relative,  
please split them in some commits.

> Does the syntax of Changelog is correct ?

A line following your name line is missing:

Before:  
+2011-02-28 Vincent C.

- 

```
  * sample/gtk-demo/main.rb: Add gtk-demo directory to $: to fix

```

- 

```
  bugs with ruby1.9.

```

- 

```
  * sample/gtk-demo/textview.rb: add coding header.

```

- 

After:  
+2011-02-28 Vincent C.  
+

- 

```
  * sample/gtk-demo/main.rb: Add gtk-demo directory to $: to fix

```

- 

```
  bugs with ruby1.9.

```

- 

```
  * sample/gtk-demo/textview.rb: add coding header.

```

- 

> For the commit should I use this URL  
> svn+ssh://removed\_email\_address@domain.invalid/svnroot/ruby-gnome2  
> or https protocole is enough ?

You can use https URL:  
[https://ruby-gnome2.svn.sourceforge.net/svnroot/ruby-gnome2/ruby-gnome2/trunk](https://ruby-gnome2.svn.sourceforge.net/svnroot/ruby-gnome2/ruby-gnome2/trunk)

## Thanks,

kou
