Class: GitReflow::Workflows::Core

Inherits:
Object
  • Object
show all
Includes:
GitReflow::Workflow
Defined in:
lib/git_reflow/workflows/core.rb

Overview

This class contains the core workflow for git-reflow. Going forward, this will act as the base class for customizing and extending git-reflow.

Class Method Summary collapse

Methods included from GitReflow::Workflow

current, included, reset!

Class Method Details

.load_raw_workflow(workflow_string) ⇒ Object

Evaluates the provided string in the context of this class

Parameters:

  • workflow_string (String)

    the contents of a Workflow file to eval



23
24
25
26
27
# File 'lib/git_reflow/workflows/core.rb', line 23

def self.load_raw_workflow(workflow_string)
  return if workflow_string.strip.empty?
  logger.debug "Evaluating workflow..."
  binding.eval(workflow_string)
end

.load_workflow(workflow_path) ⇒ Object

Reads and evaluates the provided file in the context of this class

Parameters:

  • workflow_path (String)

    the path of the Workflow file to eval



14
15
16
17
18
# File 'lib/git_reflow/workflows/core.rb', line 14

def self.load_workflow(workflow_path)
  return unless workflow_path.length > 0 and File.exists?(workflow_path)
  logger.debug "Using workflow: #{workflow_path}"
  self.load_raw_workflow(File.read(workflow_path))
end