Sha256: 3d95a53d5a3a91a937fde72337e93a1c633075ed9dcf31796325203e0957fb0f

Contents?: true

Size: 1.35 KB

Versions: 45

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

45 entries across 45 versions & 10 rubygems

Version Path
guard-2.19.0 lib/guard/deprecated/dsl.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/guard-2.18.1/lib/guard/deprecated/dsl.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/guard-2.18.1/lib/guard/deprecated/dsl.rb
guard-2.18.1 lib/guard/deprecated/dsl.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/guard-2.18.0/lib/guard/deprecated/dsl.rb
guard-2.18.0 lib/guard/deprecated/dsl.rb
guard-2.17.0 lib/guard/deprecated/dsl.rb
qiita_org-0.1.35 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.34 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.33 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.32 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.31 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.30 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.29 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.28 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.27 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.26 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
qiita_org-0.1.25 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/deprecated/dsl.rb
guard-2.16.2 lib/guard/deprecated/dsl.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/guard-2.15.0/lib/guard/deprecated/dsl.rb