diff --git a/Gemfile b/Gemfile index 06bf9a1..4b06d65 100644 --- a/Gemfile +++ b/Gemfile @@ -47,6 +47,10 @@ gem "ferrum" # Math markup conversion (OMML ↔ MathML ↔ LaTeX ↔ AsciiMath) gem "plurimath", github: "jcasimir/plurimath", branch: "main" +# Pin plurimath's own markup dependencies: newer releases restructure APIs +# (e.g. mml drops `mml/configuration`) that this plurimath revision requires. +gem "mml", "= 2.0.3" +gem "lutaml-model", "= 0.7.7" group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem diff --git a/Gemfile.lock b/Gemfile.lock index 455c9b7..942c879 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GIT GEM remote: https://rubygems.org/ specs: - action_text-trix (2.1.17) + action_text-trix (2.1.19) railties actioncable (8.1.3) actionpack (= 8.1.3) @@ -89,7 +89,7 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - addressable (2.8.9) + addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) base64 (0.3.0) @@ -105,7 +105,7 @@ GEM bundler-audit (0.9.3) bundler (>= 1.2.0) thor (~> 1.0) - concurrent-ruby (1.3.7) + concurrent-ruby (1.3.8) connection_pool (3.0.2) crass (1.0.7) date (3.5.1) @@ -122,7 +122,7 @@ GEM sxp (~> 2.0) unicode-types (~> 1.8) ed25519 (1.4.0) - erb (6.0.5) + erb (6.0.6) erubi (1.13.1) et-orbi (1.4.0) tzinfo @@ -203,8 +203,8 @@ GEM lutaml-model moxml moxml (0.1.10) - msgpack (1.8.1) - net-imap (0.6.3) + msgpack (1.8.3) + net-imap (0.6.4.1) date net-protocol net-pop (0.1.2) @@ -256,7 +256,7 @@ GEM activesupport (>= 7.0.0) rack public_suffix (7.0.5) - puma (7.2.0) + puma (8.0.2) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) @@ -428,7 +428,7 @@ GEM bindex (>= 0.4.0) railties (>= 8.0.0) webrick (1.9.2) - websocket-driver (0.8.0) + websocket-driver (0.8.2) base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -455,6 +455,8 @@ DEPENDENCIES importmap-rails jbuilder kamal + lutaml-model (= 0.7.7) + mml (= 2.0.3) pg (~> 1.1) plurimath! propshaft diff --git a/config/routes.rb b/config/routes.rb index 85e0c7b..00ef916 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,10 +3,10 @@ root "grades#index" - resources :grades, only: [:show] do - resources :content_modules, only: [:show], path: "modules" do - resources :topics, only: [:show] do - resources :lessons, only: [:show] + resources :grades, only: [ :show ] do + resources :content_modules, only: [ :show ], path: "modules" do + resources :topics, only: [ :show ] do + resources :lessons, only: [ :show ] end end end diff --git a/db/migrate/20260324160002_create_modules.rb b/db/migrate/20260324160002_create_modules.rb index 47c5d7c..3a39c4f 100644 --- a/db/migrate/20260324160002_create_modules.rb +++ b/db/migrate/20260324160002_create_modules.rb @@ -10,7 +10,7 @@ def change t.timestamps end - add_index :content_modules, [:grade_id, :number], unique: true - add_index :content_modules, [:grade_id, :position] + add_index :content_modules, [ :grade_id, :number ], unique: true + add_index :content_modules, [ :grade_id, :position ] end end diff --git a/db/migrate/20260324160003_create_topics.rb b/db/migrate/20260324160003_create_topics.rb index 32eb0e8..3cd3a82 100644 --- a/db/migrate/20260324160003_create_topics.rb +++ b/db/migrate/20260324160003_create_topics.rb @@ -10,7 +10,7 @@ def change t.timestamps end - add_index :topics, [:content_module_id, :letter], unique: true - add_index :topics, [:content_module_id, :position] + add_index :topics, [ :content_module_id, :letter ], unique: true + add_index :topics, [ :content_module_id, :position ] end end diff --git a/db/migrate/20260324160004_create_lessons.rb b/db/migrate/20260324160004_create_lessons.rb index 4df5aec..8df15c2 100644 --- a/db/migrate/20260324160004_create_lessons.rb +++ b/db/migrate/20260324160004_create_lessons.rb @@ -9,7 +9,7 @@ def change t.timestamps end - add_index :lessons, [:topic_id, :number], unique: true - add_index :lessons, [:topic_id, :position] + add_index :lessons, [ :topic_id, :number ], unique: true + add_index :lessons, [ :topic_id, :position ] end end diff --git a/db/migrate/20260324160009_create_assessments.rb b/db/migrate/20260324160009_create_assessments.rb index d8761ca..9a51936 100644 --- a/db/migrate/20260324160009_create_assessments.rb +++ b/db/migrate/20260324160009_create_assessments.rb @@ -10,6 +10,6 @@ def change t.timestamps end - add_index :assessments, [:content_module_id, :assessment_type], unique: true + add_index :assessments, [ :content_module_id, :assessment_type ], unique: true end end diff --git a/db/migrate/20260324160010_create_problems.rb b/db/migrate/20260324160010_create_problems.rb index 044cce4..21ffba8 100644 --- a/db/migrate/20260324160010_create_problems.rb +++ b/db/migrate/20260324160010_create_problems.rb @@ -10,6 +10,6 @@ def change t.timestamps end - add_index :problems, [:source_type, :source_id, :position], unique: true + add_index :problems, [ :source_type, :source_id, :position ], unique: true end end diff --git a/db/migrate/20260324160012_create_standard_taggings.rb b/db/migrate/20260324160012_create_standard_taggings.rb index 2d1e005..5ab52de 100644 --- a/db/migrate/20260324160012_create_standard_taggings.rb +++ b/db/migrate/20260324160012_create_standard_taggings.rb @@ -7,7 +7,7 @@ def change t.timestamps end - add_index :standard_taggings, [:standard_id, :taggable_type, :taggable_id], + add_index :standard_taggings, [ :standard_id, :taggable_type, :taggable_id ], unique: true, name: "idx_standard_taggings_uniqueness" end end diff --git a/db/migrate/20260324223010_create_supplemental_resources.rb b/db/migrate/20260324223010_create_supplemental_resources.rb index ef76598..fd81960 100644 --- a/db/migrate/20260324223010_create_supplemental_resources.rb +++ b/db/migrate/20260324223010_create_supplemental_resources.rb @@ -14,7 +14,7 @@ def change end add_index :supplemental_resources, - [:resourceable_type, :resourceable_id, :resource_type], + [ :resourceable_type, :resourceable_id, :resource_type ], name: "idx_supplemental_resources_lookup" add_index :supplemental_resources, :resource_type add_index :supplemental_resources, :source diff --git a/db/migrate/20260325120001_create_expressions.rb b/db/migrate/20260325120001_create_expressions.rb index 277f786..720020e 100644 --- a/db/migrate/20260325120001_create_expressions.rb +++ b/db/migrate/20260325120001_create_expressions.rb @@ -15,7 +15,7 @@ def change t.timestamps end - add_index :expressions, [:source_type, :source_id, :position], unique: true, + add_index :expressions, [ :source_type, :source_id, :position ], unique: true, name: "idx_expressions_source_position" add_index :expressions, :conversion_status end diff --git a/lib/engageny/html_parser.rb b/lib/engageny/html_parser.rb index a15e9d5..a25713d 100644 --- a/lib/engageny/html_parser.rb +++ b/lib/engageny/html_parser.rb @@ -62,7 +62,7 @@ def self.wrap_section(head_html, section_html) def split_document # Find the boundary between head and body content body_match = @html.match(/\A(.*?
]*>)(.*)\z/m) - return ["", [], ""] unless body_match + return [ "", [], "" ] unless body_match head = body_match[1] body = body_match[2] @@ -77,7 +77,7 @@ def split_document body_close = body.index("") || body.length if section_starts.empty? - return [head + body[0...body_close], [], body[body_close..]] + return [ head + body[0...body_close], [], body[body_close..] ] end # Head includes everything up to and including the first section's start @@ -92,7 +92,7 @@ def split_document tail = body[body_close..] - [full_head, sections, tail] + [ full_head, sections, tail ] end def find_student_section_indices diff --git a/lib/engageny/math_converter.rb b/lib/engageny/math_converter.rb index 682e58a..e217453 100644 --- a/lib/engageny/math_converter.rb +++ b/lib/engageny/math_converter.rb @@ -101,7 +101,7 @@ def manifest_summary # We keep only the final (inserted) content and discard deletions. def try_strip_track_changes(xml) # Check for ins/del in either namespace - return [xml, nil] unless xml.match?(/(?:<[mw]:ins\b|<[mw]:del\b)/) + return [ xml, nil ] unless xml.match?(/(?:<[mw]:ins\b|<[mw]:del\b)/) doc = Nokogiri::XML(xml) word_ns = "http://schemas.openxmlformats.org/wordprocessingml/2006/main" @@ -110,7 +110,7 @@ def try_strip_track_changes(xml) changed = false # Remove