diff --git a/Gemfile b/Gemfile index 10daaa97..980b1cfb 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,8 @@ gem 'warden' gem 'nokogiri' +gem 'borrow_direct' + group :production do gem 'mysql2', '~> 0.5' gem 'newrelic_rpm' diff --git a/Gemfile.lock b/Gemfile.lock index 2b65eae5..e9a2d5d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,8 @@ GEM autoprefixer-rails (>= 9.1.0) popper_js (>= 1.14.3, < 2) sassc-rails (>= 2.0.0) + borrow_direct (1.2.0) + httpclient (~> 2.4) builder (3.2.3) bundler-audit (0.6.1) bundler (>= 1.2.0, < 3) @@ -155,6 +157,7 @@ GEM domain_name (~> 0.5) http-form_data (2.1.1) http_parser.rb (0.6.0) + httpclient (2.8.3) i18n (1.6.0) concurrent-ruby (~> 1.0) jaro_winkler (1.5.3) @@ -365,6 +368,7 @@ PLATFORMS DEPENDENCIES bootsnap (>= 1.1.0) bootstrap (~> 4.3) + borrow_direct byebug capistrano (~> 3.0) capistrano-passenger diff --git a/config/initializers/borrow_direct.rb b/config/initializers/borrow_direct.rb new file mode 100644 index 00000000..3b194309 --- /dev/null +++ b/config/initializers/borrow_direct.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +BorrowDirect::Defaults.api_key = Settings.borrow_direct.api_key + +BorrowDirect::Defaults.library_symbol = 'STANFORD' + +BorrowDirect::Defaults.api_base = BorrowDirect::Defaults::PRODUCTION_API_BASE if Rails.env.production? diff --git a/config/settings.yml b/config/settings.yml index 3aa3f9b3..708ffa66 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -1,4 +1,6 @@ GOOGLE_ANALYTICS_ID: +borrow_direct: + api_key: '' symws: url: headers: {} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 822934bb..0d8eb687 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -103,5 +103,6 @@ # Mock all requests to symphony for feature tests config.before type: :feature do stub_request(:any, %r{example.com/symws}).to_rack(FakeSymphony) + stub_request(:any, /rc\.relais-host\.com/).to_return(status: 200) end end