Sha256: aa23928776360e928ff8ea558929f7f722427bec46a91b2b3d9546e88b217bfb

Contents?: true

Size: 709 Bytes

Versions: 17

Compression:

Stored size: 709 Bytes

Contents

require "foreman/export"
require "foreman/utils"

class Foreman::Export::Base

  attr_reader :engine

  def initialize(engine)
    @engine = engine
  end

  def export
    raise "export method must be overridden"
  end

private ######################################################################

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

  def say(message)
    puts "[foreman export] %s" % message
  end

  def export_template(name)
    File.read(File.expand_path("../../../../data/export/#{name}", __FILE__))
  end

  def write_file(filename, contents)
    say "writing: #{filename}"

    File.open(filename, "w") do |file|
      file.puts contents
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman-0.18.0 lib/foreman/export/base.rb
foreman-0.17.0 lib/foreman/export/base.rb
foreman-0.16.0 lib/foreman/export/base.rb
foreman-0.15.0 lib/foreman/export/base.rb
foreman-0.14.0 lib/foreman/export/base.rb
foreman-0.13.1 lib/foreman/export/base.rb
foreman-0.13.0 lib/foreman/export/base.rb
foreman-0.12.0 lib/foreman/export/base.rb
foreman-0.12.0.pre1 lib/foreman/export/base.rb
foreman-0.11.1 lib/foreman/export/base.rb
foreman-0.11.0 lib/foreman/export/base.rb
foreman-0.10.1 lib/foreman/export/base.rb
foreman-0.10.0 lib/foreman/export/base.rb
foreman-0.9.2 lib/foreman/export/base.rb
foreman-0.9.1 lib/foreman/export/base.rb
foreman-0.9.0 lib/foreman/export/base.rb
foreman-0.9.0.beta.1 lib/foreman/export/base.rb