Sha256: 3a8bf8cb6846c15a7270557336076726a40aebd057440a3848bb9bbd800c30bc

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

module CM
module Facade

  #-----------------------------------------------------------------------------
  # Configuration settings

  def config_path
    ENV['CM_CONFIG_PATH'] || '/etc/cm'
  end

  #-----------------------------------------------------------------------------
  # Core plugin type facade

  def plan(name, options = {}, provider = nil)
    Nucleon.plugin(:CM, :plan, provider, Nucleon::Config.ensure(options).import({ :name => name }))
  end

  def plans(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :plan, data, build_hash, keep_array)
  end

  #---

  def configuration(options, provider = nil)
    Nucleon.plugin(:CM, :configuration, provider, options)
  end

  def configurations(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :configuration, data, build_hash, keep_array)
  end

  #-----------------------------------------------------------------------------
  # Processor plugin type facade

  #---

  def sequence(options = {}, provider = nil)
    Nucleon.plugin(:CM, :sequence, provider, options)
  end

  def sequences(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :sequence, data, build_hash, keep_array)
  end

  #---

  def batch(options, provider = nil)
    Nucleon.plugin(:CM, :batch, provider, options)
  end

  def batches(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :batch, data, build_hash, keep_array)
  end

  #---

  def job(options, provider = nil)
    Nucleon.plugin(:CM, :job, provider, options)
  end

  def jobs(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :job, data, build_hash, keep_array)
  end

  #---

  def function(options, provider = nil)
    Nucleon.plugin(:CM, :function, provider, options)
  end

  def functions(data, build_hash = false, keep_array = false)
    Nucleon.plugins(:CM, :function, data, build_hash, keep_array)
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cm-0.1.4 lib/core/facade.rb