Skip to content

Commit

Permalink
WEB-6548: We either require widths or don't
Browse files Browse the repository at this point in the history
  • Loading branch information
jellodiil committed Oct 12, 2023
1 parent dfe3b14 commit 4a3efbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/lib/runner/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def render_book(publish_file:, local: false)
parser = Parser::Publish.new(file: publish_file)
book = parser.parse
image_extractor = ImageProvider::BookExtractor.new(book)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor, width_required: true)
image_provider&.process
renderer = Renderer::Book.new(book, image_provider:)
renderer.render
Expand All @@ -31,7 +31,7 @@ def publish_book(publish_file:)
parser = Parser::Publish.new(file: publish_file)
book = parser.parse
image_extractor = ImageProvider::BookExtractor.new(book)
image_provider = ImageProvider::Provider.new(extractor: image_extractor)
image_provider = ImageProvider::Provider.new(extractor: image_extractor, width_required: true)
image_provider.process
Renderer::Book.new(book, image_provider:).render
Api::Alexandria::BookUploader.upload(book)
Expand Down Expand Up @@ -60,7 +60,7 @@ def render_video_course(release_file:, local: false)
parser = Parser::Release.new(file: release_file)
video_course = parser.parse
image_extractor = ImageProvider::VideoCourseExtractor.new(video_course)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor, width_required: false)
image_provider&.process
renderer = Renderer::VideoCourse.new(video_course, image_provider:)
renderer.render
Expand Down Expand Up @@ -112,7 +112,7 @@ def publish_pablo(source:, output:)
output ||= default_pablo_output

image_extractor = ImageProvider::DirectoryExtractor.new(source)
image_provider = ImageProvider::Provider.new(extractor: image_extractor)
image_provider = ImageProvider::Provider.new(extractor: image_extractor, width_required: false)
image_provider.process

paths = image_extractor.categories.map { "/#{_1}" }.push('/', '/license', '/instructions', '/styles.css', '/javascript/search.js')
Expand All @@ -130,7 +130,7 @@ def render_content_module(module_file:, local: false)
parser = Parser::Circulate.new(file: module_file)
content_module = parser.parse
image_extractor = ImageProvider::ContentModuleExtractor.new(content_module)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor)
image_provider = local ? nil : ImageProvider::Provider.new(extractor: image_extractor, width_required: false)
image_provider&.process
renderer = Renderer::ContentModule.new(content_module, image_provider:)
renderer.render
Expand All @@ -156,7 +156,7 @@ def circulate_content_module(module_file:)
content_module = parser.parse

image_extractor = ImageProvider::ContentModuleExtractor.new(content_module)
image_provider = ImageProvider::Provider.new(extractor: image_extractor)
image_provider = ImageProvider::Provider.new(extractor: image_extractor, width_required: false)
image_provider.process
Renderer::ContentModule.new(content_module, image_provider:).render
Api::Alexandria::ContentModuleUploader.upload(content_module)
Expand Down

0 comments on commit 4a3efbd

Please sign in to comment.