tqbf / ruckus

A DOM-Inspired Ruby Smart Fuzzer
56 stars 6 forks source link

demo case of reale_size and relate_value not working - `block in relate': wrong number of arguments (1 for 0) (ArgumentError) #1

Open gmanfunky opened 11 years ago

gmanfunky commented 11 years ago

The provided demo

!/usr/bin/env ruby

require 'ruckus'

class Foo < Ruckus::Structure byte :id byte :len str :string relate_size :string, :to => :len relate_value :len, :to => :string, :through => :size end

r = Foo.new r.string = "HAHAHAHA" pp r.to_human

returns: $ ruby test_rucus.rb /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/relate.rb:17:in block in relate': wrong number of arguments (1 for 0) (ArgumentError) from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/initializers.rb:11:ininstance_eval' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/initializers.rb:11:in block in final_initialization_hook' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/initializers.rb:11:ineach' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/initializers.rb:11:in final_initialization_hook' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure/defaults.rb:13:infinal_initialization_hook' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure.rb:115:in final_initialization_hook' from /usr/lib/ruby/gems/1.9.1/gems/ruckus-0.6.0/lib/ruckus/structure.rb:172:ininitialize' from test_rucus.rb:12:in new' from test_rucus.rb:12:in

'

rfzabick commented 8 years ago

If you're using a newer ruby, you can edit your ruckus source to fix this.

Change line 16 of relate.rb from self.initializers << lambda do to self.initializers << lambda do |ignore|