lib/picky/application.rb in picky-1.2.4 vs lib/picky/application.rb in picky-1.3.0

- old
+ new

@@ -174,36 +174,36 @@ # Parameters: # * name: The identifier of the index. Used: # - to identify an index (e.g. by you in Rake tasks). # - in the frontend to describe which index a result came from. # - index directory naming (index/development/the_identifier/<lots of indexes>) - # * source: The source the data comes from. See Sources::Base. # TODO Sources (all). + # * source: The source the data comes from. See Sources::Base. # # Options: # * result_identifier: Use if you'd like a different identifier/name in the results JSON than the name of the index. # def index name, source, options = {} IndexAPI.new name, source, options end # Routes. # - delegate :route, :root, :to => :routing + delegate :route, :root, :to => :rack_adapter # # API # A Picky application implements the Rack interface. # # Delegates to its routing to handle a request. # def call env - routing.call env + rack_adapter.call env end - def routing # :nodoc: - @routing ||= Routing.new + def rack_adapter # :nodoc: + @rack_adapter ||= FrontendAdapters::Rack.new end # Finalize the subclass as soon as it # has finished loading. # @@ -221,11 +221,11 @@ end # Finalizes the routes. # def finalize # :nodoc: check - routing.freeze + rack_adapter.finalize end # Checks app for missing things. # # Warns if something is missing. # @@ -235,16 +235,17 @@ warnings = [] warnings << check_external_interface puts "\n#{warnings.join(?\n)}\n\n" unless warnings.all? &:nil? end def check_external_interface - "WARNING: No routes defined for application configuration in #{self.class}." if routing.empty? + "WARNING: No routes defined for application configuration in #{self.class}." if rack_adapter.empty? end # TODO Add more info if possible. # def to_s # :nodoc: - "#{self.name}:\n#{routing}" + "#{self.name}:\n#{rack_adapter}" end end + end \ No newline at end of file