Sha256: 5f63a6c92f573ca58c8da5bd9afe52565ac9caedb099d82f2639a84deadc7261

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 Bytes

Contents

require "rails_imager/engine"

module RailsImager
  def self.const_missing(name)
    if name.to_s.end_with?("Controller")
      path = "#{File.dirname(__FILE__)}/../app/controllers/rails_imager/#{StringCases.camel_to_snake(name)}"
    elsif name.to_s.end_with?("Helper")
      path = "#{File.dirname(__FILE__)}/../app/helpers/rails_imager/#{StringCases.camel_to_snake(name)}"
    else
      path = "#{File.dirname(__FILE__)}/rails_imager/#{StringCases.camel_to_snake(name)}"
    end
    
    require path
    raise LoadError, "Not autoloaded: #{name}" unless const_defined?(name)
    return const_get(name)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_imager-0.0.16 lib/rails_imager.rb
rails_imager-0.0.15 lib/rails_imager.rb
rails_imager-0.0.14 lib/rails_imager.rb
rails_imager-0.0.13 lib/rails_imager.rb
rails_imager-0.0.12 lib/rails_imager.rb
rails_imager-0.0.11 lib/rails_imager.rb