From 8ac449a86d64bb4d10976c403342164c1771ecd1 Mon Sep 17 00:00:00 2001 From: Vijay Swamidass Date: Tue, 4 Jun 2024 11:58:49 -0700 Subject: [PATCH 1/4] fix document doc --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65ace9d..aac37fe 100644 --- a/README.md +++ b/README.md @@ -320,9 +320,19 @@ Each object in the `questions` array includes: ##### Example cURL > ```javascript -> curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer " -d '{"document":"Document Content", "library_id":"your_library_id", "external_id":"optional_unique_id"}' http://localhost:3000/api/v1/documents +> curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer " -d '{"document": {"document":"Document Content", "library_id":"your_library_id", "external_id":"optional_unique_id"}}' http://localhost:3000/api/v1/documents > ``` +Example POST data. Make sure you have the top level "document" attribute. +> ```javascript +{ +> "document": { +> "document": "Restart your computer to fix it.", +> "title": "How to fix a computer", +> "library_id": 23, +> }, +> } +> ``` From 1feba339f139bcd5fbd5fcdbae0464a970be4970 Mon Sep 17 00:00:00 2001 From: Vijay Swamidass Date: Tue, 4 Jun 2024 12:00:47 -0700 Subject: [PATCH 2/4] edit --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index aac37fe..94864d7 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,16 @@ Each object in the `questions` array includes: > | library_id | required | text | The ID of the library to which this document will be added | > | external_id | optional | text | A unique ID provided by the client. If a POST request includes the same external_id as an existing record, the record will be updated instead of created. | +##### Example POST data. +Make sure you have the top level "document" attribute. +> ```javascript +> "document": { +> "document": "Restart your computer to fix it.", +> "title": "How to fix a computer", +> "library_id": 23, +> }, +> +> ``` ##### Responses @@ -322,17 +332,6 @@ Each object in the `questions` array includes: > ```javascript > curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer " -d '{"document": {"document":"Document Content", "library_id":"your_library_id", "external_id":"optional_unique_id"}}' http://localhost:3000/api/v1/documents > ``` - -Example POST data. Make sure you have the top level "document" attribute. -> ```javascript -{ -> "document": { -> "document": "Restart your computer to fix it.", -> "title": "How to fix a computer", -> "library_id": 23, -> }, -> } -> ``` From 4e3e22bce2a8de331fb818f67a6d3d1c357c51d3 Mon Sep 17 00:00:00 2001 From: Vijay Swamidass Date: Tue, 4 Jun 2024 12:40:53 -0700 Subject: [PATCH 3/4] x --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94864d7..c86aaa5 100644 --- a/README.md +++ b/README.md @@ -309,15 +309,14 @@ Each object in the `questions` array includes: > | library_id | required | text | The ID of the library to which this document will be added | > | external_id | optional | text | A unique ID provided by the client. If a POST request includes the same external_id as an existing record, the record will be updated instead of created. | -##### Example POST data. +##### Example POST Data Make sure you have the top level "document" attribute. > ```javascript > "document": { > "document": "Restart your computer to fix it.", > "title": "How to fix a computer", > "library_id": 23, -> }, -> +> } > ``` ##### Responses From 3d3b17e84d5e237c37672c394343290d3ba8a9aa Mon Sep 17 00:00:00 2001 From: Vijay Swamidass Date: Tue, 4 Jun 2024 13:08:54 -0700 Subject: [PATCH 4/4] fix lint issue --- Gemfile | 4 +- Gemfile.lock | 283 ++++++++++++++++++++++++++++----------------------- 2 files changed, 155 insertions(+), 132 deletions(-) diff --git a/Gemfile b/Gemfile index 84e6adc..0c08e7a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.2.2' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem 'rails', '~> 7.0.8.1' +gem 'rails', '~> 7.1.0' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' @@ -56,7 +56,7 @@ group :development, :test do gem 'shoulda-matchers', '~> 4.0' - gem 'rspec-rails', '~> 5.0.0' + gem 'rspec-rails', '~> 6.1' # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] gem 'capybara' gem 'factory_bot_rails' diff --git a/Gemfile.lock b/Gemfile.lock index 7bf4c2b..edb8f97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,78 +1,89 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.1) - actionpack (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.1) - actionview (= 7.0.8.1) - activesupport (= 7.0.8.1) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.1) - actionpack (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.1) - activesupport (= 7.0.8.1) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.1) - activesupport (= 7.0.8.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.0.8.1) - activesupport (= 7.0.8.1) - activerecord (7.0.8.1) - activemodel (= 7.0.8.1) - activesupport (= 7.0.8.1) - activestorage (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activesupport (= 7.0.8.1) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.1) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) acts_as_votable (0.14.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) + base64 (0.2.0) bcrypt (3.1.20) + bigdecimal (3.1.8) bindex (0.8.1) - bootsnap (1.17.1) + bootsnap (1.18.3) msgpack (~> 1.2) brakeman (6.1.2) racc @@ -82,20 +93,22 @@ GEM bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) - capybara (3.39.2) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) + connection_pool (2.4.1) crass (1.0.6) + csv (3.3.0) daemons (1.4.1) date (3.3.4) - debug (1.9.1) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) delayed_job (4.1.11) @@ -103,38 +116,40 @@ GEM delayed_job_active_record (4.1.8) activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) - diff-lcs (1.5.0) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) + diff-lcs (1.5.1) + dotenv (3.1.2) + dotenv-rails (3.1.2) + dotenv (= 3.1.2) + railties (>= 6.1) + drb (2.2.1) erubi (1.12.0) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.2.3) + faker (3.4.1) i18n (>= 1.8.11, < 2) globalid (1.2.1) activesupport (>= 6.1) - httparty (0.21.0) + httparty (0.22.0) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) importmap-rails (2.0.1) actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.7.2) - irb (1.11.1) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) - jbuilder (2.11.5) + jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) - json (2.7.1) + json (2.7.2) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -158,14 +173,15 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) mini_mime (1.1.5) - minitest (5.21.2) + minitest (5.23.1) msgpack (1.7.2) - multi_xml (0.6.0) + multi_xml (0.7.1) + bigdecimal (~> 3.1) + mutex_m (0.2.0) neighbor (0.3.2) activerecord (>= 6.1) - net-imap (0.4.10) + net-imap (0.4.12) date net-protocol net-pop (0.1.2) @@ -174,48 +190,53 @@ GEM timeout net-smtp (0.5.0) net-protocol - nio4r (2.7.0) + nio4r (2.7.3) nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) nokogiri (1.16.5-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) - optparse (0.4.0) + optparse (0.5.0) parallel (1.24.0) - parser (3.3.0.4) + parser (3.3.2.0) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.6) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) pgvector (0.2.2) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) - pundit (2.3.1) + pundit (2.3.2) activesupport (>= 3.0.0) - racc (1.7.3) - rack (2.2.9) + racc (1.8.0) + rack (3.0.11) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.1) - actioncable (= 7.0.8.1) - actionmailbox (= 7.0.8.1) - actionmailer (= 7.0.8.1) - actionpack (= 7.0.8.1) - actiontext (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activemodel (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.0.8.1) + railties (= 7.1.3.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -227,42 +248,43 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) - method_source + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.6.3.1) + rdoc (6.7.0) psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) - regexp_parser (2.9.0) - reline (0.4.2) + regexp_parser (2.9.2) + reline (0.5.8) io-console (~> 0.5) rexml (3.2.8) strscan (>= 3.0.9) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.0.3) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.1) - rubocop (1.60.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -270,11 +292,11 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) ruby-saml (1.16.0) nokogiri (>= 1.13.10) @@ -297,18 +319,18 @@ GEM railties (>= 6.0.0) stringio (3.1.0) strscan (3.1.0) - tailwindcss-rails (2.3.0-arm64-darwin) - railties (>= 6.0.0) - tailwindcss-rails (2.3.0-x86_64-darwin) - railties (>= 6.0.0) - tailwindcss-rails (2.3.0-x86_64-linux) - railties (>= 6.0.0) - thor (1.3.0) - tiktoken_ruby (0.0.6-arm64-darwin) - tiktoken_ruby (0.0.6-x86_64-darwin) - tiktoken_ruby (0.0.6-x86_64-linux) + tailwindcss-rails (2.6.0-arm64-darwin) + railties (>= 7.0.0) + tailwindcss-rails (2.6.0-x86_64-darwin) + railties (>= 7.0.0) + tailwindcss-rails (2.6.0-x86_64-linux) + railties (>= 7.0.0) + thor (1.3.1) + tiktoken_ruby (0.0.9-arm64-darwin) + tiktoken_ruby (0.0.9-x86_64-darwin) + tiktoken_ruby (0.0.9-x86_64-linux) timeout (0.4.1) - turbo-rails (1.5.0) + turbo-rails (2.0.5) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) @@ -324,13 +346,14 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) + webrick (1.8.1) websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.6.15) PLATFORMS arm64-darwin-22 @@ -361,11 +384,11 @@ DEPENDENCIES pgvector puma (~> 6.0) pundit (~> 2.3) - rails (~> 7.0.8.1) + rails (~> 7.1.0) rails-controller-testing redcarpet redis (~> 4.0) - rspec-rails (~> 5.0.0) + rspec-rails (~> 6.1) rubocop ruby-saml selenium-webdriver