class Roger::Release::Processors::Base

Abstract Processor class

Attributes

name[W]
options[R]
release[R]

Public Class Methods

name() click to toggle source

Name of this processor

# File lib/roger/release/processors.rb, line 13
def name
  @name || raise(ArgumentError, "Implement in subclass")
end

Public Instance Methods

call(release, options = {}) click to toggle source
# File lib/roger/release/processors.rb, line 30
def call(release, options = {})
  @release = release
  @options = {}.update(default_options)
  @options.update(options) if options
  @options.update(my_project_options)

  # Stop immideatly if we've been disabled
  return if @options[:disable]

  perform
end
default_options() click to toggle source

Default options for this processor

# File lib/roger/release/processors.rb, line 19
def default_options
  {}
end
name() click to toggle source

Name of this processor.

  • Can be set by setting the :name config in the release block

  • Can be overwritten in implementation if needed

# File lib/roger/release/processors.rb, line 26
def name
  options && options[:name] || self.class.name
end

Protected Instance Methods

my_project_options() click to toggle source

The options passed through the project. This can contain command line options

# File lib/roger/release/processors.rb, line 46
def my_project_options
  project_options = release.project.options
  project_options[:release] && project_options[:release][name] || {}
end
perform() click to toggle source
# File lib/roger/release/processors.rb, line 51
def perform
  raise ArgumentError, "Implement in subclass"
end