Sha256: 4d607fe2756823a612e3458c3758a76e4a03b1d424c6bcca4799d095db55a951

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 Bytes

Contents

module Compass
  module Commands
    class Base
      def self.register(command_name)
        Compass::Commands[command_name] = self
      end

      include Actions

      attr_accessor :working_path, :options

      def initialize(working_path, options)
        self.working_path = working_path.to_s
        self.options = options
      end
      
      def execute
        perform
      end

      def perform
        raise StandardError.new("Not Implemented")
      end

      def successful?
        !@failed
      end

      def failed!
        @failed = true
      end

      protected

      def framework
        unless Compass::Frameworks[options[:framework]]
          raise Compass::Error.new("No such framework: #{options[:framework].inspect}")
        end
        Compass::Frameworks[options[:framework]]
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
compass-sourcemaps-0.12.3.sourcemaps.a4836f1 lib/compass/commands/base.rb
compass-sourcemaps-0.12.2.sourcemaps.57a186c lib/compass/commands/base.rb