Sha256: 1fb5073bd50529964e691227af989d67dfb7e04acd16107c3e9bf4951fe2c06d

Contents?: true

Size: 1.35 KB

Versions: 16

Compression:

Stored size: 1.35 KB

Contents

require "guard/config"
fail "Deprecations disabled (strict mode)" if Guard::Config.new.strict?

module Guard
  module Deprecated
    module Dsl
      def self.add_deprecated(dsl_klass)
        dsl_klass.send(:extend, ClassMethods)
      end

      MORE_INFO_ON_UPGRADING_TO_GUARD_2 = <<-EOS.gsub(/^\s*/, "")
        For more information on how to upgrade for Guard 2.0, please head over
        to: https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0%s
      EOS

      module ClassMethods
        # @deprecated Use
        # `Guard::Guardfile::Evaluator.new(options).evaluate_guardfile`
        # instead.
        #
        # @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How
        # to upgrade for Guard 2.0
        #
        EVALUATE_GUARDFILE = <<-EOS.gsub(/^\s*/, "")
          Starting with Guard 2.0 'Guard::Dsl.evaluate_guardfile(options)' is
          deprecated.

          Please use
          'Guard::Guardfile::Evaluator.new(options).evaluate_guardfile'
          instead.

          #{MORE_INFO_ON_UPGRADING_TO_GUARD_2 % "#deprecated-methods-1"}
        EOS

        def evaluate_guardfile(options = {})
          require "guard/guardfile/evaluator"
          require "guard/ui"

          UI.deprecation(EVALUATE_GUARDFILE)
          ::Guard::Guardfile::Evaluator.new(options).evaluate_guardfile
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
guard-2.12.4 lib/guard/deprecated/dsl.rb
guard-2.12.3 lib/guard/deprecated/dsl.rb
guard-2.12.2 lib/guard/deprecated/dsl.rb
guard-2.12.1 lib/guard/deprecated/dsl.rb
guard-2.12.0 lib/guard/deprecated/dsl.rb
guard-2.11.1 lib/guard/deprecated/dsl.rb
guard-2.11.0 lib/guard/deprecated/dsl.rb
guard-2.10.5 lib/guard/deprecated/dsl.rb
guard-2.10.4 lib/guard/deprecated/dsl.rb
guard-2.10.3 lib/guard/deprecated/dsl.rb
guard-2.10.2 lib/guard/deprecated/dsl.rb
guard-2.10.1 lib/guard/deprecated/dsl.rb
guard-2.10.0 lib/guard/deprecated/dsl.rb
guard-2.9.2 lib/guard/deprecated/dsl.rb
guard-2.9.1 lib/guard/deprecated/dsl.rb
guard-2.9.0 lib/guard/deprecated/dsl.rb