Skip to content

Instantly share code, notes, and snippets.

@mathrick
Created November 11, 2013 22:46
Show Gist options
  • Save mathrick/7421944 to your computer and use it in GitHub Desktop.
Save mathrick/7421944 to your computer and use it in GitHub Desktop.
require_relative 'Settings'
module BadBehaviour
class Settings
include DefaultSettings
extend self # make all methods class methods
end
end
module BadBehaviour
module DefaultSettings
def strict
false
end
def verbose
false
end
end
end
$ irb
irb(main):001:0> require './config'
TypeError: wrong argument type Class (expected Module)
from /home/mathrick/Dev/bad-behaviour/ruby/config.rb:58:in `extend'
from /home/mathrick/Dev/bad-behaviour/ruby/config.rb:58:in `<class:Settings>'
from /home/mathrick/Dev/bad-behaviour/ruby/config.rb:4:in `<module:BadBehaviour>'
from /home/mathrick/Dev/bad-behaviour/ruby/config.rb:3:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment