lib/norseal/api.rb in norseal-api-0.1.2 vs lib/norseal/api.rb in norseal-api-0.1.3

- old
+ new

@@ -1,6 +1,7 @@ require 'her' +require 'faraday_middleware' require 'active_support/concern' require 'norseal/api/model' module Norseal module Api @@ -8,22 +9,22 @@ def self.configure(host, api_key, &block) @api = Her::API.new @api.setup :url => "http://#{host}/" do |c| - # c.use FaradayMiddleware::EncodeJson + c.use FaradayMiddleware::EncodeJson c.use Her::Middleware::AcceptJSON c.use Her::Middleware::FirstLevelParseJSON c.authorization :token, api_key yield c if block_given? c.adapter Faraday.default_adapter unless c.builder.handlers.include?(Faraday::Adapter::Test) end - require "api/resources/collection" - require "api/resources/product" + require "norseal/api/resources/collection" + require "norseal/api/resources/product" end def self.api raise ClientNotConfigured.new("Norseal") unless @api @api