kenichi / angelo

Sinatra-like DSL for Reel that supports WebSockets and SSE
Other
303 stars 23 forks source link

"main" style breaks with ruby 2.3.1 #67

Closed kenichi closed 8 years ago

kenichi commented 8 years ago

this commit breaks the "main" style feature added by @tommay because it makes Forwardable call method_defined? which is not present on main.

tried replacing the forward/def_delegators stuff in lib/angelo/main.rb with this but am running into errors i'm not understanding immediately:

  Angelo::Base::DSL.instance_methods.each do |bim|
    define_method bim do |*a|
      @angelo_app.__send__ bim, *a
    end
  end
tommay commented 8 years ago

I might be able to spend some cycles on this.

kenichi commented 8 years ago

i'm dumb and forgot that *a doesn't swallow blocks. doing this:

  Angelo::Base::DSL.instance_methods.each do |bim|
    define_method bim do |*a, &block|
      @angelo_app.__send__ bim, *a, &block
    end
  end

makes it "work" but main only test still fails. 😕

kenichi commented 8 years ago

i wound up using define_singleton_method which made the main only test pass. let me know if that doesn't sound correct.