librelist archives

« back to archive

error with shoes no superclass method

error with shoes no superclass method

From:
Olivier Morel
Date:
2014-04-28 @ 15:37
hy all
 i develop an interface with shoes(GUI) for the commerciales.
Below theyre is my script for connect to ldap server and check if the user
exist, i can enter the login and the password. When i click on the button
"login" with login or without it .
I dont understand the error .

Error

 may not work as

expected/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/ruby.rb:14:in
`exit_application': super: no superclass method `exit_application' for
GLib:Module (NoMethodError)
        from 
/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/main.rb:123:in
`main'


Script:

require 'green_shoes'
require 'net/ldap'
Shoes.app(:title => "Authentification",:width => 300, :height => 300) do


   class ConnectLdap
   @myApp

        def initialize(myapp, connect = nil)
           @connect = connect
           @myApp = myapp
        end

        def connect(login,pwd)
          @myApp.app do
           ldap = Net::LDAP.new
           ldap.host = "78.110.xx.xx"
           ldap.port = 389
           ldap.auth "cn=admin,dc=domaine,dc=com", "password"

            filter = Net::LDAP::Filter.eq("uid","#{login}")
            dn = ["dn"]
            @connect = ldap.bind_as(:base => "dc=domaine,dc=com",
:filter => filter, :attributes => dn, :password => "#{pwd}")
         end
        end

        def connect?
           if !!@connect == true
             alert "Successful login"
            else
             alert "wrong password or login"
           end
        end
   end

 stack do
        @myActions = ConnectLdap.new(self)
        para "login"
         login = edit_line

        para "password"
         password = edit_line
        button "login" do
         @myactions.connect(login.text,password,text)
    end
 endend

Re: [shoes] error with shoes no superclass method

From:
Sebastjan Hribar
Date:
2014-05-03 @ 11:59
Hi,

sorry for late reply.

I confirm your error with the script below.

There are two mistakes in the button block:

|1. @myactionsshould be  ||@myActionsas declared

and

||2. password,text should be password.text

After these fixes I get no more errors.

hth
regards
seba
|






On 28. 04. 2014 17:37, Olivier Morel wrote:
>
> hy all
>  i develop an interface with shoes(GUI) for the commerciales.
> Below theyre is my script for connect to ldap server and check if the 
> user exist, i can enter the login and the password. When i click on 
> the button "login" with login or without it .
> I dont understand the error .
>
> Error
> |  maynot  work as expected
> 
/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/ruby.rb:14:in
`exit_application': super: no superclass method `exit_application' for 
GLib:Module (NoMethodError)
>          from 
/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/main.rb:123:in
`main'|
>
> Script:
> |require'green_shoes'
> require'net/ldap'
>
> Shoes.app(:title=>  "Authentification",:width=>  300,  :height=>  300)  do
>
>
>     class  ConnectLdap
>     @myApp
>
>          def  initialize(myapp,  connect=  nil)
>             @connect  =  connect
>             @myApp  =  myapp
>          end
>
>          def  connect(login,pwd)
>            @myApp.appdo
>             ldap=  Net::LDAP.new
>             ldap.host=  "78.110.xx.xx"
>             ldap.port=  389
>             ldap.auth"cn=admin,dc=domaine,dc=com",  "password"
>
>              filter=  Net::LDAP::Filter.eq("uid","#{login}")
>              dn=  ["dn"]
>              @connect  =  ldap.bind_as(:base=>  "dc=domaine,dc=com",  
:filter=>  filter,  :attributes=>  dn,  :password=>  "#{pwd}")
>           end
>          end
>
>          def  connect?
>             if  !!@connect  ==  true
>               alert"Successful login"
>              else
>               alert"wrong password or login"
>             end
>          end
>     end
>
>   stackdo
>          @myActions  =  ConnectLdap.new(self)
>          para"login"
>           login=  edit_line
>
>          para"password"
>           password=  edit_line
>          button"login"  do
>           @myactions.connect(login.text,password,text)
>      end
>   end
> end|
>
>
>
>
>
>
>

Re: [shoes] error with shoes no superclass method

From:
Olivier Morel
Date:
2014-05-05 @ 13:17
Thanks for you answear sebastjan i didn't see my stupid error  @myActions =
ConnnectLdap.new(self)
and after some line i write @myactions  pfff...
i'm really st..

thanks again men :)


2014-05-03 13:59 GMT+02:00 Sebastjan Hribar <sebastjan.hribar@gmail.com>:

>  Hi,
>
> sorry for late reply.
>
> I confirm your error with the script below.
>
> There are two mistakes in the button block:
>
> 1. @myactions should be @myActions as declared
> and
> 2. password,text should be password.text
>
> After these fixes I get no more errors.
>
> hth
> regards
> seba
>
>
>
>
>
>
> On 28. 04. 2014 17:37, Olivier Morel wrote:
>
>
> hy all
>  i develop an interface with shoes(GUI) for the commerciales.
> Below theyre is my script for connect to ldap server and check if the user
> exist, i can enter the login and the password. When i click on the button
> "login" with login or without it .
>  I dont understand the error .
>
>  Error
>
>  may not work as 
expected/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/ruby.rb:14:in
`exit_application': super: no superclass method `exit_application' for 
GLib:Module (NoMethodError)
>         from 
/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/main.rb:123:in
`main'
>
>
>  Script:
>
> require 'green_shoes'
> require 'net/ldap'
> Shoes.app(:title => "Authentification",:width => 300, :height => 300) do
>
>
>    class ConnectLdap
>    @myApp
>
>         def initialize(myapp, connect = nil)
>            @connect = connect
>            @myApp = myapp
>         end
>
>         def connect(login,pwd)
>           @myApp.app do
>            ldap = Net::LDAP.new
>            ldap.host = "78.110.xx.xx"
>            ldap.port = 389
>            ldap.auth "cn=admin,dc=domaine,dc=com", "password"
>
>             filter = Net::LDAP::Filter.eq("uid","#{login}")
>             dn = ["dn"]
>             @connect = ldap.bind_as(:base => "dc=domaine,dc=com", 
:filter => filter, :attributes => dn, :password => "#{pwd}")
>          end
>         end
>
>         def connect?
>            if !!@connect == true
>              alert "Successful login"
>             else
>              alert "wrong password or login"
>            end
>         end
>    end
>
>  stack do
>         @myActions = ConnectLdap.new(self)
>         para "login"
>          login = edit_line
>
>         para "password"
>          password = edit_line
>         button "login" do
>          @myactions.connect(login.text,password,text)
>     end
>  endend
>
>
>
>
>
>
>
>
>
>


-- 
Cordialement

Olivier Morel

Re: [shoes] error with shoes no superclass method

From:
Sebastjan Hribar
Date:
2014-05-05 @ 13:24
Hi,

no problem:)

You can avoid these overlooks by using some sort of autosuggest function in
your editor. I can speak for gedit which I use and it saves me a lot of
trouble:)
While you type you get a list of suggestions based on the already used
words.

regards,
seba


2014-05-05 15:17 GMT+02:00 Olivier Morel <oliviermo75@gmail.com>:

> Thanks for you answear sebastjan i didn't see my stupid error  @myActions
> = ConnnectLdap.new(self)
> and after some line i write @myactions  pfff...
> i'm really st..
>
> thanks again men :)
>
>
> 2014-05-03 13:59 GMT+02:00 Sebastjan Hribar <sebastjan.hribar@gmail.com>:
>
>  Hi,
>>
>> sorry for late reply.
>>
>> I confirm your error with the script below.
>>
>> There are two mistakes in the button block:
>>
>> 1. @myactions should be @myActions as declared
>> and
>> 2. password,text should be password.text
>>
>> After these fixes I get no more errors.
>>
>> hth
>> regards
>> seba
>>
>>
>>
>>
>>
>>
>> On 28. 04. 2014 17:37, Olivier Morel wrote:
>>
>>
>> hy all
>>  i develop an interface with shoes(GUI) for the commerciales.
>> Below theyre is my script for connect to ldap server and check if the
>> user exist, i can enter the login and the password. When i click on the
>> button "login" with login or without it .
>>  I dont understand the error .
>>
>>  Error
>>
>>  may not work as 
expected/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/ruby.rb:14:in
`exit_application': super: no superclass method `exit_application' for 
GLib:Module (NoMethodError)
>>         from 
/home/zyriuse/.rvm/gems/ruby-1.9.3-p484/gems/green_shoes-1.1.374/lib/shoes/main.rb:123:in
`main'
>>
>>
>>  Script:
>>
>> require 'green_shoes'
>> require 'net/ldap'
>> Shoes.app(:title => "Authentification",:width => 300, :height => 300) do
>>
>>
>>    class ConnectLdap
>>    @myApp
>>
>>         def initialize(myapp, connect = nil)
>>            @connect = connect
>>            @myApp = myapp
>>         end
>>
>>         def connect(login,pwd)
>>           @myApp.app do
>>            ldap = Net::LDAP.new
>>            ldap.host = "78.110.xx.xx"
>>            ldap.port = 389
>>            ldap.auth "cn=admin,dc=domaine,dc=com", "password"
>>
>>             filter = Net::LDAP::Filter.eq("uid","#{login}")
>>             dn = ["dn"]
>>             @connect = ldap.bind_as(:base => "dc=domaine,dc=com", 
:filter => filter, :attributes => dn, :password => "#{pwd}")
>>          end
>>         end
>>
>>         def connect?
>>            if !!@connect == true
>>              alert "Successful login"
>>             else
>>              alert "wrong password or login"
>>            end
>>         end
>>    end
>>
>>  stack do
>>         @myActions = ConnectLdap.new(self)
>>         para "login"
>>          login = edit_line
>>
>>         para "password"
>>          password = edit_line
>>         button "login" do
>>          @myactions.connect(login.text,password,text)
>>     end
>>  endend
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> Cordialement
>
> Olivier Morel
>
>