lib/turf/lookup.rb in turf-1.0.0 vs lib/turf/lookup.rb in turf-1.1.0
- old
+ new
@@ -2,10 +2,11 @@
def find(message)
lookup_path.each do |obj|
return obj.send(message) if obj.respond_to?(message)
end
+ raise "No Turf classes found... these must be defined and required" if classes.empty?
raise NoMethodError, "The #{message} method could not be found in any of these Turf configuration classes: #{classes.join(", ")}"
end
private
@@ -39,9 +40,11 @@
rescue NameError
end
end
def env
- ENV['RAILS_ENV'] || 'development'
+ return Rails.env if defined?(Rails)
+ raise "The RAILS_ENV environment variable must be set" unless ENV['RAILS_ENV']
+ ENV['RAILS_ENV']
end
end; end