adding active_support lib

parent 1f1c8c55
......@@ -8,6 +8,7 @@ gem 'json'
gem 'resource_kit'
gem 'faraday'
gem 'net-http-persistent'
gem 'activesupport'
group :development, :spec do
gem 'minitest', '~> 5.8.3'
......
......@@ -2,7 +2,7 @@ require "forwardable"
require "json"
require "resource_kit"
require "faraday"
require "active_support"
require "active_support/all"
require_relative "dspace/version"
require_relative "dspace/resources/community_resource"
......
......@@ -7,13 +7,14 @@ module Dspace
def initialize(options = {})
@access_token = options.with_indifferent_access[:access_token]
@dspace_api = options.with_indifferent_access[:dspace_api]
@logger = options.with_indifferent_access[:logger]
end
def connection
Faraday.new(connection_options) do |req|
req.request :multipart
req.request :url_encoded
req.use Faraday::Response::Logger, Logger.new('faraday.log')
req.use(Faraday::Response::Logger, @logger) unless @logger.nil?
req.adapter :net_http_persistent
end
end
......
......@@ -2,6 +2,6 @@ require_relative 'lib/dspace'
require 'faraday'
faraday = Faraday.new('https://demo.dspace.org/', {ssl: {verify: false}, headers: {content_type: 'application/json',
accept: 'application/json'}})
accept: 'application/json'}})
r = Dspace::Resources::CommunityResource.new(connection: faraday)
\ No newline at end of file
r = Dspace::Resources::AuthenticationResource.new(connection: faraday)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment