guard 2.7.3 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fe4d02f1b032eb80f48d28b9e2a96cedc706a8d
4
- data.tar.gz: 8835c817d58724daa4838a98688300cbde8c6118
3
+ metadata.gz: 0b526a83a981a77336113761579089329aad8a71
4
+ data.tar.gz: 66bee09b0f816bbd18092b115ca7e402c6df6382
5
5
  SHA512:
6
- metadata.gz: 42b4e420d55c5344df40f26ca6005da64cce67014d4dc06cbb08db146231fcb56c28a2b2c8a89434c3921e83cf3e946c8dcf3c821281fc948b038c5feb2a962c
7
- data.tar.gz: 793aa5c2052dd4d37778b6361ceddd42a1e50d8ad4cd7eac1b4434955dfc6d7afadc94cdf6f96a2e0895fd2f26b05e138ab05d25cacf83d36a664221b3469215
6
+ metadata.gz: 2845651127734112e666e48c11dbeba3d1a2b88ac350441f9b5fc9a40213bbfc3c9307a8982cf57a522001d8567a6ca14e5b419736806bcaa365d58135712ac1
7
+ data.tar.gz: 023b5f58b9a20b19d566b49e413b71b12195c4432bba7bb66321f98e3aa1a146235e20ce6ae9fbd5aa9c4349ae6b8d68bd1962f979bacfb4313bf061c1af13b4
data/README.md CHANGED
@@ -293,9 +293,10 @@ $ bundle exec guard start --no-bundler-warning
293
293
 
294
294
  #### `--show-deprecations`
295
295
 
296
- Turn on deprecation warnings.
296
+ This option is deprecated. No, seriously! Deprecations are now always shown.
297
+
298
+ (To *really* hide them, set the environment variable `GUARD_GEM_SILENCE_DEPRECATIONS=1`)
297
299
 
298
- *NOTE: They are OFF by default (see: [#298](https://github.com/guard/guard/issues/298))*
299
300
 
300
301
  #### `-l`/`--latency` option
301
302
 
data/lib/guard/cli.rb CHANGED
@@ -70,10 +70,11 @@ module Guard
70
70
  aliases: "-B",
71
71
  banner: "Turn off warning when Bundler is not present"
72
72
 
73
+ # DEPRECATED
73
74
  method_option :show_deprecations,
74
75
  type: :boolean,
75
76
  default: false,
76
- banner: "Turn on deprecation warnings"
77
+ banner: "DEPRECATED: it does nothing"
77
78
 
78
79
  # Listen options
79
80
  method_option :latency,
@@ -62,7 +62,8 @@ module Guard
62
62
  end
63
63
 
64
64
  def evaluator
65
- UI.deprecation(Deprecator::GUARD_EVALUATOR_DEPRECATION)
65
+ # TODO: probably deprecate once it isn't used internally
66
+ # UI.deprecation(Deprecator::GUARD_EVALUATOR_DEPRECATION)
66
67
  # TODO: this will be changed to the following when scope is reworked
67
68
  # ::Guard.session.evaluator
68
69
  ::Guard.instance_variable_get(:@evaluator)
@@ -2,7 +2,8 @@ require "guard/ui"
2
2
 
3
3
  module Guard
4
4
  class Deprecator
5
- UPGRADE_WIKI = "https://github.com/guard/guard/wiki"\
5
+ UPGRADE_WIKI =
6
+ "https://github.com/guard/guard/wiki" +
6
7
  "/Upgrade-guide-for-existing-guards-to-Guard-v1.1"
7
8
 
8
9
  MORE_INFO_ON_UPGRADING_TO_GUARD_1_1 = <<-EOS.gsub(/^\s*/, "")
@@ -128,10 +129,5 @@ module Guard
128
129
  Starting with Guard 2.7.1 it was discovered that this accessor was never
129
130
  initialized or used internally.
130
131
  EOS
131
-
132
- GUARD_EVALUATOR_DEPRECATION = <<-EOS.gsub(/^\s*/, "")
133
- Starting with Guard 2.7.1 ::Guard.session.evaluator should be used
134
- instead.
135
- EOS
136
132
  end
137
133
  end
data/lib/guard/guard.rb CHANGED
@@ -1,5 +1,63 @@
1
1
  require "guard/plugin/base"
2
2
 
3
+ module Guard
4
+ unless ENV["GUARD_GEM_SILENCE_DEPRECATIONS"] == "1"
5
+
6
+ UPGRADE_WIKI_URL =
7
+ "https://github.com/guard/guard/" +
8
+ "wiki/Upgrading-to-Guard-2.0#changes-in-guardguard"
9
+
10
+ STDERR.puts <<-EOS
11
+
12
+ ******** BIG DEPRECATION WARNING !! ********
13
+
14
+ Hi, Guard here.
15
+
16
+ You're including lib/guard/guard.rb ...
17
+
18
+ ... which contains code deprecated over a year ago!
19
+
20
+
21
+ This file will likely be removed in the next version, so make sure you're
22
+ not requiring it anywhere to ensure safe gem upgrades.
23
+
24
+ If this message is annoying and you can't quickly fix the issue (see below),
25
+ you have 2 options:
26
+
27
+ 1) Simply set the env variable "GUARD_GEM_SILENCE_DEPRECATIONS" to "1" to
28
+ skip this message
29
+
30
+ 2) Freeze the gem to a previous version (not recommended because upgrades
31
+ are cool and you might forget to unfreeze later!).
32
+
33
+ E.g. in your Gemfile:
34
+
35
+ if Time.now > Time.new(2014,11,10)
36
+ gem 'guard', '~> 2.8'
37
+ else
38
+ # Freeze until 2014-11-10 - in case we forget to change back ;)
39
+ gem 'guard', '= 2.7.3'
40
+ end
41
+
42
+ If you don't know which gem or plugin is requiring this file, here's a
43
+ backtrace:
44
+
45
+ #{Thread.current.backtrace[1..5].join("\n\t >> ")}"
46
+
47
+ Here's how to quickly upgrade/fix this (given you are a maintainer of the
48
+ offending plugin or you want to prepare a pull request yourself):
49
+
50
+ #{UPGRADE_WIKI_URL}
51
+
52
+ Have fun!
53
+
54
+ ******** END OF DEPRECATION MESSAGE ********
55
+
56
+ EOS
57
+
58
+ end
59
+ end
60
+
3
61
  module Guard
4
62
  # @deprecated Inheriting from `Guard::Guard` is deprecated, please inherit
5
63
  # from {Plugin} instead. Please note that the constructor signature has
@@ -16,7 +16,9 @@ module Guard
16
16
  # upgrade for Guard 2.0
17
17
  #
18
18
  def self.create_guardfile(options = {})
19
- UI.deprecation(Deprecator::CREATE_GUARDFILE_DEPRECATION)
19
+ # FIXME: used internally by Guard
20
+ # TODO: reenable after majore refactoring is finished
21
+ # UI.deprecation(Deprecator::CREATE_GUARDFILE_DEPRECATION)
20
22
  Generator.new(options).create_guardfile
21
23
  end
22
24
 
@@ -26,7 +28,9 @@ module Guard
26
28
  # upgrade for Guard 2.0
27
29
  #
28
30
  def self.initialize_template(plugin_name)
29
- UI.deprecation(Deprecator::INITIALIZE_TEMPLATE_DEPRECATION)
31
+ # FIXME: used internally by Guard
32
+ # TODO: reenable after majore refactoring is finished
33
+ # UI.deprecation(Deprecator::INITIALIZE_TEMPLATE_DEPRECATION)
30
34
  Generator.new.initialize_template(plugin_name)
31
35
  end
32
36
 
@@ -36,7 +40,9 @@ module Guard
36
40
  # upgrade for Guard 2.0
37
41
  #
38
42
  def self.initialize_all_templates
39
- UI.deprecation(Deprecator::INITIALIZE_ALL_TEMPLATES_DEPRECATION)
43
+ # FIXME: used internally by Guard
44
+ # TODO: reenable after majore refactoring is finished
45
+ # UI.deprecation(Deprecator::INITIALIZE_ALL_TEMPLATES_DEPRECATION)
40
46
  Generator.new.initialize_all_templates
41
47
  end
42
48
  end
data/lib/guard/setuper.rb CHANGED
@@ -15,7 +15,6 @@ module Guard
15
15
  guardfile: nil,
16
16
  no_interactions: false,
17
17
  no_bundler_warning: false,
18
- show_deprecations: false,
19
18
  latency: nil,
20
19
  force_polling: false,
21
20
  wait_for_delay: nil,
data/lib/guard/ui.rb CHANGED
@@ -97,7 +97,11 @@ module Guard
97
97
  def deprecation(message, options = {})
98
98
  msg = "neither ::Guard.setup nor ::Guard.reset_options was called"
99
99
  fail msg if ::Guard.options.nil?
100
- warning(message, options) if ::Guard.options[:show_deprecations]
100
+ unless ENV["GUARD_GEM_SILENCE_DEPRECATIONS"] == "1"
101
+ backtrace = Thread.current.backtrace[1..3].join("\n\t >")
102
+ msg = format("%s\nDeprecation backtrace: %s", message, backtrace)
103
+ warning(msg, options)
104
+ end
101
105
  end
102
106
 
103
107
  # Show a debug message that is prefixed with DEBUG and a timestamp.
data/lib/guard/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Guard
2
- VERSION = "2.7.3"
2
+ VERSION = "2.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.3
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil