Method: Jets::Preheat#classes

Defined in:
lib/jets/preheat.rb

#classesObject



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/jets/preheat.rb', line 105

def classes
  Jets::Commands::Build.app_files.map do |path|
    next if path.include?("preheat_job.rb") # dont want to cause an infinite loop, just in case
    next unless path =~ %r{app/controllers} # only prewarm controllers

    class_path = path.sub(%r{.*app/\w+/},'').sub(/\.rb$/,'')
    class_name = class_path.camelize
    # IE: PostsController
    class_name.constantize # load app/**/* class definition
  end.compact
end