Skip to content

Instantly share code, notes, and snippets.

@Gizmokid2005
Created December 16, 2014 21:38
Show Gist options
  • Save Gizmokid2005/3478babb57d39a94d4bd to your computer and use it in GitHub Desktop.
Save Gizmokid2005/3478babb57d39a94d4bd to your computer and use it in GitHub Desktop.
Dynamically gather plugins
plugins = Array.new
Dir["../plugins/*.rb"].each_with_index do |file, i|
IO.foreach(file) do |p|
if p.match(/^class/)
plugins.push(p.split('class ').last.strip)
#puts plugins.inspect
#puts plugins.class
else
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment