Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

release v0.0.1 #2

Merged
merged 10 commits into from
Nov 13, 2017
Merged

release v0.0.1 #2

merged 10 commits into from
Nov 13, 2017

Conversation

lbiedinger
Copy link
Member

No description provided.

@lbiedinger lbiedinger requested a review from rwd October 20, 2017 11:31
thumbnail.respond_to?(:file) ? thumbnail.file.url(:medium) : thumbnail
end

def media_object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not belong in this Engine. It should not make assumptions about classes defined elsewhere. In the case of europeana-portal-collections, ::MediaObject implement #hash_source_url but it is conceivable that another Rails app using this Engine would have a ::MediaObject model that did not.

We need to move the #media_object and #thumbnail_url logic out of here and back into europeana-portal-collections, refactored there.

end
end

def media_object_url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to just #url

@@ -1,14 +1,16 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle exec bin/console does not work.

spec.homepage = 'https://github.org/europeana/europeana-feed-jobs'
spec.license = 'EUPL-1.1'

spec.files = Dir['{config,lib}/**/*', '.rubocop.yml', 'Gemfile', 'LICENSE.md', 'README.md']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There is no config directory.
  2. There are app and bin directories which should be included in a built gem.


spec.files = Dir['{config,lib}/**/*', '.rubocop.yml', 'Gemfile', 'LICENSE.md', 'README.md']

spec.bindir = 'exe'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bindir is bin, not exe.

spec.require_paths = ['lib']

spec.add_dependency 'rails', '~> 4.2.9'
spec.add_dependency 'dotenv-rails', '~> 2.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is dotenv-rails used?

require 'europeana/feed_jobs/engine'

module Europeana
module FeedJobs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced this is a great name for the Engine/gem/repo because there is already more than just the job in here. I think Europeana::Feeds would be better.


module Europeana
module FeedJobs
class FeedJob < ActiveJob::Base
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the class to FetchJob to avoid the repetition with the module name.

module Europeana
module FeedJobs
class FeedJob < ActiveJob::Base
queue_as :cache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be tempted to name the queue after the Engine.

# Global nav uses some feeds, and is cached so needs to be expired when those
# feeds are updated.
# Cached pages need to be expired should they be using the updated feed.
after_perform do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not belong here in the Engine.

I suggest:

  1. Removing the after_perform block from here
  2. Creating a new job class in europeana-portal-collections which sub-classes this one
  3. Adding the after_perform block in to the app-specific job class


def perform(url, download_media = false)
@url = url
@download_media = download_media
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does nothing inside the engine/gem itself and should be removed, along with the argument.

@@ -1,14 +1,18 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# frozen_string_literal: true needs to come after #!/usr/bin/env ruby, and the file should be made executable.

{ tag: :video, attr: :poster }
].freeze

# @param entry [Feedjira::Parser::RSSEntry]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param feed_entry

@rwd
Copy link
Contributor

rwd commented Nov 10, 2017

@lbiedinger this looks fine to me now. Feel free to merge and create a first release when ready.

@lbiedinger lbiedinger merged commit 012eb86 into master Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants