Skip to content

Commit

Permalink
Add the borrow_direct gem and configure it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeck committed Jul 27, 2019
1 parent 12d8523 commit f0977f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ gem 'warden'

gem 'nokogiri'

gem 'borrow_direct'

group :production do
gem 'mysql2', '~> 0.5'
gem 'newrelic_rpm'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -365,6 +368,7 @@ PLATFORMS
DEPENDENCIES
bootsnap (>= 1.1.0)
bootstrap (~> 4.3)
borrow_direct
byebug
capistrano (~> 3.0)
capistrano-passenger
Expand Down
7 changes: 7 additions & 0 deletions config/initializers/borrow_direct.rb
Original file line number Diff line number Diff line change
@@ -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?
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
GOOGLE_ANALYTICS_ID:
borrow_direct:
api_key: ''
symws:
url:
headers: {}
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f0977f6

Please sign in to comment.