diff --git a/.ruby-version b/.ruby-version index f13c6f4..e391e18 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-3.3.5 +ruby-3.3.6 diff --git a/Gemfile b/Gemfile index 85e5f4f..33e366a 100644 --- a/Gemfile +++ b/Gemfile @@ -7,8 +7,8 @@ ruby File.read(File.join(__dir__, '.ruby-version')).chomp.delete_prefix('ruby-') gem 'area' gem 'async-http' gem 'csv' -gem 'drb' gem 'dotenv' +gem 'drb' gem 'falcon' gem 'falcon-capybara' gem 'gender_detector' diff --git a/Gemfile.lock b/Gemfile.lock index 3a05a6b..dedd05f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,12 +46,12 @@ GEM selenium-webdriver coderay (1.1.3) concurrent-ruby (1.3.4) - console (1.29.0) + console (1.29.2) fiber-annotation fiber-local (~> 1.1) json - csv (3.3.0) - dotenv (3.1.4) + csv (3.3.1) + dotenv (3.1.6) drb (2.2.1) falcon (0.48.3) async @@ -70,7 +70,7 @@ GEM capybara (~> 3.37) falcon selenium-webdriver - faraday (2.12.1) + faraday (2.12.2) faraday-net_http (>= 2.0, < 3.5) json logger @@ -86,14 +86,14 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-endpoint (0.14.0) - io-event (1.7.4) + io-event (1.7.5) io-stream (0.6.1) json (2.9.0) jwt (2.9.3) base64 language_server-protocol (3.17.0.3) localhost (1.3.1) - logger (1.6.2) + logger (1.6.3) mapping (1.1.1) matrix (0.4.2) method_source (1.1.0) @@ -108,9 +108,9 @@ GEM bigdecimal (~> 3.1) net-http (0.6.0) uri - nokogiri (1.16.8-x86_64-darwin) + nokogiri (1.17.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.8-x86_64-linux) + nokogiri (1.17.2-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -126,7 +126,7 @@ GEM snaky_hash (~> 2.0) version_gem (~> 1.1) openssl (3.2.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) parser (3.3.6.0) ast (~> 2.4.1) @@ -142,7 +142,7 @@ GEM protocol-http2 (0.22.0) protocol-hpack (~> 1.4) protocol-http (~> 0.18) - protocol-rack (0.11.0) + protocol-rack (0.11.1) protocol-http (~> 0.43) rack (>= 1.0) pry (0.15.0) @@ -161,13 +161,13 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.3) - rexml (3.3.9) + rexml (3.4.0) roda (3.86.0) rack roda-route_list (2.1.0) roda rollbar (3.6.0) - rubocop (1.69.1) + rubocop (1.69.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -177,7 +177,7 @@ GEM rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.36.2) + rubocop-ast (1.37.0) parser (>= 3.3.1.0) rubocop-performance (1.23.0) rubocop (>= 1.48.1, < 2.0) @@ -249,7 +249,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.3.5p100 + ruby 3.3.6p108 BUNDLED WITH - 2.5.23 + 2.5.22 diff --git a/app.rb b/app.rb index 7d06eb6..0a4f3e9 100644 --- a/app.rb +++ b/app.rb @@ -64,7 +64,7 @@ class App < Roda r.redirect '/auth/shelves' rescue OAuth::Unauthorized - flash[:error] = 'Please authenticate first' + flash[:error] = 'Fetched details! Click login' r.redirect '/' end end diff --git a/lib/goodreads.rb b/lib/goodreads.rb index 5a7283c..90e0175 100644 --- a/lib/goodreads.rb +++ b/lib/goodreads.rb @@ -114,7 +114,7 @@ def fetch_user request_token response = access_token.get uri.to_s xml = Nokogiri::XML response.body user_id = xml.xpath('//user').first.attributes.first[1].value - name = xml.xpath('//user').first.children[1].children.text + xml.xpath('//user').first.children[1].children.text [user_id, goodreads_token, goodreads_secret] end diff --git a/lib/overdrive.rb b/lib/overdrive.rb index 41332e2..81e8807 100644 --- a/lib/overdrive.rb +++ b/lib/overdrive.rb @@ -45,6 +45,7 @@ def self.local_libraries zip_code def initialize book_info, consortium_id @book_info = book_info @token = token + @collection_token = collection_token consortium_id, @token @books = async_books_with_overdrive_info.wait end @@ -113,9 +114,9 @@ def add_library_availability_to_books body['availability'].each do |result| # fail occurs here - book = @books.find { |title, _| + book = @books.find do |title, _| title.id = result['reserveId'] - }.first + end.first book.copies_available = result['copiesAvailable'] book.copies_owned = result['copiesOwned'] end