Sha256: 895cd66a0fd5e657073a973bbd9aa2753b7ecd4fcfb600221a57c4314c1985fe

Contents?: true

Size: 745 Bytes

Versions: 8

Compression:

Stored size: 745 Bytes

Contents

module Reflection
  module Command
    class Base
      attr_accessor :config
      
      def self.run!(config)
        command = self.new(config)
        command.validate! if command.respond_to?(:validate!)
        command.run!
      end
      
      def initialize(new_config)
        self.config = new_config
      end      
      
      def validate
        Reflection::Validations
      end
      
      def verify_that_target_is_not_a_repository(target_directory)
        if Repository.exists?(target_directory.path)
          Support.exit_with_error "The specified --directory is a repository. Reflection is afraid of breaking something, so it won't touch it. Pleace specify another one.."
        end
      end
      
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
basiszwo-reflection-0.5.1 lib/reflection/command/base.rb
reflection-0.5.0 lib/reflection/command/base.rb
reflection-0.4.6 lib/reflection/command/base.rb
reflection-0.4.5 lib/reflection/command/base.rb
reflection-0.4.4 lib/reflection/command/base.rb
reflection-0.4.3 lib/reflection/command/base.rb
reflection-0.4.1 lib/reflection/command/base.rb
reflection-0.4.0 lib/reflection/command/base.rb