Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
16 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
module Polipus | ||
module Plugin | ||
class Cleaner | ||
include Polipus::Plugin::Base | ||
|
||
on_initialize do |plugin_instance| | ||
if plugin_instance.options[:reset] | ||
@logger.info {"Cleaning all: url_tracker, storage, queue"} | ||
@logger.info { 'Cleaning all: url_tracker, storage, queue' } | ||
url_tracker.clear | ||
storage.clear | ||
queue_factory.clear | ||
@options[:queue_overflow_adapter].clear if @options[:queue_overflow_adapter] | ||
else | ||
@logger.info {"Cleaner plugin is disable, add :reset => true to the plugin if you really know what you are doing"} | ||
@logger.info { 'Cleaner plugin is disable, add :reset => true to the plugin if you really know what you are doing' } | ||
end | ||
end | ||
|
||
def plugin_registered | ||
puts "Plugin #{self.class.name} registered with options: #{plugin_options}" | ||
@options[:reset] ||= false | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
module Polipus | ||
module Plugin | ||
class Sample | ||
|
||
include Polipus::Plugin::Base | ||
|
||
on_initialize do |plugin_instance| | ||
on_initialize do |_plugin_instance| | ||
puts 'on_initialize called' | ||
puts '-------------------------------------' | ||
@options.each { |k,v| @logger.info { "Polipus configuration: #{k.to_s} => #{v}" } } | ||
@options.each { |k, v| @logger.info { "Polipus configuration: #{k} => #{v}" } } | ||
puts '-------------------------------------' | ||
end | ||
|
||
def plugin_registered | ||
puts "Plugin registered with options: #{plugin_options}" | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters