module GitReflow::Workflow

Public Class Methods

current() click to toggle source

@nodoc

# File lib/git_reflow/workflow.rb, line 13
def self.current
  return @current unless @current.nil?
  # First look for a "Workflow" file in the current directory, then check
  # for a global Workflow file stored in git-reflow git config.
  loaded_local_workflow  = GitReflow::Workflows::Core.load_workflow "#{GitReflow.git_root_dir}/Workflow"
  loaded_global_workflow = false

  unless loaded_local_workflow
    loaded_global_workflow = GitReflow::Workflows::Core.load_workflow GitReflow::Config.get('reflow.workflow')
  end

  @current = GitReflow::Workflows::Core
end
included(base) click to toggle source
# File lib/git_reflow/workflow.rb, line 8
def self.included base
  base.extend ClassMethods
end
reset!() click to toggle source

@nodoc This is primarily a helper method for tests. Due to the nature of how the tests load many different workflows, this helps start fresh and isolate the scenario at hand.

# File lib/git_reflow/workflow.rb, line 31
def self.reset!
  GitReflow.logger.debug "Resetting GitReflow workflow..."
  current.commands = {}
  current.callbacks = { before: {}, after: {}}
  @current = nil
  # We'll need to reload the core class again in order to clear previously
  # eval'd content in the context of the class
  load File.expand_path('../workflows/core.rb', __FILE__)
end