Adds validation for Tumblr class definition

This commit is contained in:
Dean Putney 2014-09-29 00:41:27 -07:00
parent 05563022c7
commit 5489f80cb6

View file

@ -7,6 +7,8 @@ module Agents
cannot_be_scheduled!
description <<-MD
#{'## Include `tumblr_client` and `omniauth-tumblr` in your Gemfile to use this Agent!' if dependencies_missing?}
The TumblrPublishAgent publishes Tumblr posts from the events it receives.
To be able to use this Agent you need to authenticate with Tumblr in the [Services](/services) section first.
@ -55,6 +57,10 @@ module Agents
Set `expected_update_period_in_days` to the maximum amount of time that you'd expect to pass between Events being created by this Agent.
MD
def gem_dependency_check
defined?(Tumblr)
end
def validate_options
errors.add(:base, "expected_update_period_in_days is required") unless options['expected_update_period_in_days'].present?
end