Sha256: f497239c06fa854f0047713c07b79ad3d7390ab7490b4709525217fccef4c175

Contents?: true

Size: 791 Bytes

Versions: 39

Compression:

Stored size: 791 Bytes

Contents

module Ddr
  module Derivatives
    # @abstract
    class Generator

      attr_reader :options

      GeneratorResult = Struct.new(:output_path, :stdout, :stderr, :status)

      def initialize(options=nil)
        @options = options
      end

      # The mime type of the output generated.
      # Implemented in each subclass.
      def self.output_mime_type
        raise NotImplementedError
      end

      # The extension to use for the output generated.
      # Implemented in each subclass
      def self.output_extension
        raise NotImplementedError
      end

      # The actions required to generate the output from the source.
      # Implemented in each subclass.
      def generate(source_path, output_path)
        raise NotImplementedError
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ddr-models-3.0.8 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.7 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.6 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.5 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.4 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.3 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.2 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.1 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc6 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc5 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc4 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc3 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc2 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.rc1 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.beta.22 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.beta.21 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.beta.20 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.beta.18 lib/ddr/derivatives/generators/generator.rb
ddr-models-3.0.0.beta.17 lib/ddr/derivatives/generators/generator.rb