Skip to content

Instantly share code, notes, and snippets.

@AlexWayfer
Last active November 7, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexWayfer/bca7e0a0ff336731b2c8e00c53501353 to your computer and use it in GitHub Desktop.
Save AlexWayfer/bca7e0a0ff336731b2c8e00c53501353 to your computer and use it in GitHub Desktop.
Example for meta including
# Including neccessary modules from ./base/modules
Dir.glob(File.join 'base', 'modules', '*.rb').each do |mod|
require mod
basename = File.basename mod, '.*'
include const_get basename.split('_').map(&:capitalize).join
# With helpers:
# include basename.camelize.constantize
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment