Returns the constant version of the file that is referred to.
File.to_const("/some/path/foo_bar_controller.rb") # => FooBarController
6 7 8 9
# File 'lib/rucola/rucola_support/core_ext/ruby/file.rb', line 6 def to_const(file) file.match /(\w+)\.\w*$/ $1.to_const end