W
Wybo Dekker
This works OK:
#!/usr/bin/ruby
require 'tk'
class TkVariable
def to_m
"%.2f" % [self.to_i.abs/100.0]
end
end
puts TkVariable.new(12345).to_m
-> 123.45
But when I add the -w option to the first line, I get:
/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding
123.45
Segmentation fault
and this takes 45 seconds.
What's wrong?
#!/usr/bin/ruby
require 'tk'
class TkVariable
def to_m
"%.2f" % [self.to_i.abs/100.0]
end
end
puts TkVariable.new(12345).to_m
-> 123.45
But when I add the -w option to the first line, I get:
/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding
123.45
Segmentation fault
and this takes 45 seconds.
What's wrong?