sinisterchipmunk/rink — Issue #1: Tabulation is broken
Author: flagos
Created: 2011-11-27 09:03:38+00:00
State: open

Hi,

I've try your library for having a console. I run one of your test presented in the tutorial, with ruby 1.9.3 ( I've no 1.8 install to test):

require 'rink'

class Person
attr_reader :first_name

def initialize
@first_name = "Colin"
end
end

class MyConsole < Rink::Console
option :namespace => Person.new
end

MyConsole.new

When I run this, i've a console. I type "firs" and then to have autocompletion, I have this error:
MyConsole > firs/usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:311:in `autocomplete': undefined method `ns' for # (NoMethodError)
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:109:in `block in apply_options'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/input_method/readline.rb:28:in `call'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/input_method/readline.rb:28:in `readline'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/input_method/readline.rb:28:in `gets'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:291:in `enter_input_loop'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:70:in `block in run'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:80:in `temporary_options'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:68:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/rink-1.0.1/lib/rink/console.rb:16:in `initialize'
from test_rink.rb:15:in `new'
from test_rink.rb:15:in `

'

On my understanding, namespace in this case refers to a method, .ns is useless. But I really do not understand how the entire script does work. I will made a pull request just for suggestion, in my case it has corrected the error but I don't know what is expected.