Sha256: fc49eb17e39111756bb05f82ce043c5dc7ab1970106e4fe914f366c6155e8efc

Contents?: true

Size: 1019 Bytes

Versions: 35

Compression:

Stored size: 1019 Bytes

Contents

require "foreman"
require "foreman/helpers"
require "pathname"

module Foreman::Export
  extend Foreman::Helpers

  class Exception < ::Exception; end

  def self.formatter(format)
    begin
      require "foreman/export/#{ format.tr('-', '_') }"
      classy_format = classify(format)
      formatter     = constantize("Foreman::Export::#{ classy_format }")
    rescue NameError => ex
      error "Unknown export format: #{format} (no class Foreman::Export::#{ classy_format })."
    rescue LoadError => ex
      error "Unknown export format: #{format} (unable to load file 'foreman/export/#{ format.tr('-', '_') }')."
    end
  end

  def self.error(message)
    raise Foreman::Export::Exception.new(message)
  end

end

require "foreman/export/base"
require "foreman/export/inittab"
require "foreman/export/upstart"
require "foreman/export/daemon"
require "foreman/export/bluepill"
require "foreman/export/runit"
require "foreman/export/supervisord"
require "foreman/export/launchd"
require "foreman/export/systemd"

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
foreman-0.75.0 lib/foreman/export.rb
foreman-0.74.0 lib/foreman/export.rb
foreman-0.73.0 lib/foreman/export.rb
foreman-0.71.0 lib/foreman/export.rb
foreman-0.70.0 lib/foreman/export.rb
foreman-0.69.0-mingw32 lib/foreman/export.rb
foreman-0.69.0 lib/foreman/export.rb
foreman-0.67.0-mingw32 lib/foreman/export.rb
foreman-0.67.0-java lib/foreman/export.rb
foreman-0.67.0 lib/foreman/export.rb
foreman-0.66.0-mingw32 lib/foreman/export.rb
foreman-0.66.0-java lib/foreman/export.rb
foreman-0.66.0 lib/foreman/export.rb
foreman-0.65.0 lib/foreman/export.rb
foreman-0.64.0 lib/foreman/export.rb