Sha256: 7ee1f4f23d6d1069e9b4cc5554432f8cde5c55ca0ee0546baad58d5e6a2339f8

Contents?: true

Size: 837 Bytes

Versions: 8

Compression:

Stored size: 837 Bytes

Contents

module Locomotive
  module Import
    class Base

      include Logger

      attr_reader :context, :options

      def initialize(context, options)
        @context = context
        @options = options
        self.log "*** starting to process ***"
      end

      def self.process(context, options)
        self.new(context, options).process
      end

      def process
        raise 'this method has to be overidden'
      end

      def log(message)
        super(message, self.class.name.demodulize.underscore)
      end

      protected

      def site
        @context[:site]
      end

      def database
        @context[:database]
      end

      def theme_path
        @context[:theme_path]
      end

      def open_sample_asset(url)
        File.open(File.join(self.theme_path, 'public', url))
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 lib/locomotive/import/base.rb
locomotive_cms-1.0.0.beta lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta12 lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta11 lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta10 lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta9 lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta8 lib/locomotive/import/base.rb
locomotive_cms-0.0.4.beta7 lib/locomotive/import/base.rb