guard 2.14.2 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/guard/jobs/pry_wrapper.rb +10 -2
- data/lib/guard/plugin_util.rb +1 -1
- data/lib/guard/templates/Guardfile +1 -1
- data/lib/guard/version.rb +1 -1
- data/lib/guard/watcher.rb +7 -0
- data/lib/guard/watcher/pattern/matcher.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d3499725d20725a5a0e1259e9e3f74694798f4a43e503f67f28bd218553bbe8
|
4
|
+
data.tar.gz: a20150e135df2bef124397c8532d85b20a5ea6d7b78259763465175c512c637e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adcd66a415123303070578f425ea3aab1ccbbd1d0fad175054232d08da2dfa8365eb12e558cc6b1bf83874d29bb467a75cd636b3a8e5330f8e1dc6d408728988
|
7
|
+
data.tar.gz: 9138af75c456be233f5df7b92acedb73ca8c257ade2020a2a1eedb0b2ac1b8e7b42922a94f7169cff4084f5b1d8fdf56942086a6978a3263af8840a85f678ea5
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Guard
|
2
2
|
|
3
|
-
**IMPORTANT: [Ruby 2.1 is officially outdated and unsupported!](https://www.ruby-lang.org/en/news/2016/03/30/ruby-2-1-9-released/) Please upgrade to Ruby >=2.3 or >=2.2.
|
3
|
+
**IMPORTANT: [Ruby 2.1 is officially outdated and unsupported!](https://www.ruby-lang.org/en/news/2016/03/30/ruby-2-1-9-released/) Please upgrade to Ruby >=2.3 or >=2.2.9 before installing Guard! To install for older versions, update Bundler at least 1.12: `gem update bundler` and Bundler should correctly resolve to earlier gems for your given Ruby version.**
|
4
4
|
|
5
5
|
:exclamation: Guard is currently accepting more maintainers. Please [read this](https://github.com/guard/guard/wiki/Maintainers) if you're interested in joining the team.
|
6
6
|
|
@@ -32,7 +32,7 @@ Before you file an issue, make sure you have read the _[known issues](#issues)_
|
|
32
32
|
* File system changes handled by our awesome [Listen](https://github.com/guard/listen) gem.
|
33
33
|
* Support for visual system notifications.
|
34
34
|
* Huge eco-system with [more than 220](https://rubygems.org/search?query=guard-) Guard plugins.
|
35
|
-
* Tested against Ruby 2.2.
|
35
|
+
* Tested against Ruby 2.2.9, 2.3.6, 2.4.3, 2.5.0, JRuby & Rubinius.
|
36
36
|
|
37
37
|
## Screencast
|
38
38
|
|
@@ -276,11 +276,10 @@ module Guard
|
|
276
276
|
#
|
277
277
|
def _prompt(ending_char)
|
278
278
|
proc do |target_self, nest_level, pry|
|
279
|
-
history = pry.input_array.size
|
280
279
|
process = Guard.listener.paused? ? "pause" : "guard"
|
281
280
|
level = ":#{ nest_level }" unless nest_level.zero?
|
282
281
|
|
283
|
-
"[#{
|
282
|
+
"[#{ _history(pry) }] #{ _scope_for_prompt }#{ process }"\
|
284
283
|
"(#{ _clip_name(target_self) })#{ level }#{ ending_char } "
|
285
284
|
end
|
286
285
|
end
|
@@ -288,6 +287,15 @@ module Guard
|
|
288
287
|
def _clip_name(target)
|
289
288
|
Pry.view_clip(target)
|
290
289
|
end
|
290
|
+
|
291
|
+
def _history(pry)
|
292
|
+
# https://github.com/pry/pry/blob/5bf2585d0a49a4a3666a9eae80ee31153e3ffcf4/CHANGELOG.md#v0120-november-5-2018
|
293
|
+
if Gem::Version.new(Pry::VERSION) < Gem::Version.new("0.12.0")
|
294
|
+
return pry.input_array.size
|
295
|
+
end
|
296
|
+
|
297
|
+
pry.input_ring.size
|
298
|
+
end
|
291
299
|
end
|
292
300
|
end
|
293
301
|
end
|
data/lib/guard/plugin_util.rb
CHANGED
@@ -55,7 +55,7 @@ module Guard
|
|
55
55
|
def initialize_plugin(options)
|
56
56
|
klass = plugin_class
|
57
57
|
fail "Could not load class: #{_constant_name.inspect}" unless klass
|
58
|
-
if klass.
|
58
|
+
if klass.ancestors.include?(Guard)
|
59
59
|
klass.new(options.delete(:watchers), options)
|
60
60
|
else
|
61
61
|
begin
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
## Uncomment and set this to only include directories you want to watch
|
5
5
|
# directories %w(app lib config test spec features) \
|
6
|
-
# .select{|d| Dir.
|
6
|
+
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
7
|
|
8
8
|
## Note: if you are using the `directories` clause above and you are not
|
9
9
|
## watching the project directory ('.'), then you will want to move
|
data/lib/guard/version.rb
CHANGED
data/lib/guard/watcher.rb
CHANGED
@@ -26,6 +26,13 @@ module Guard
|
|
26
26
|
@pattern = Pattern.create(pattern)
|
27
27
|
end
|
28
28
|
|
29
|
+
# Compare with other watcher
|
30
|
+
# @param other [Guard::Watcher] other watcher for comparing
|
31
|
+
# @return [true, false] equal or not
|
32
|
+
def ==(other)
|
33
|
+
action == other.action && pattern == other.pattern
|
34
|
+
end
|
35
|
+
|
29
36
|
# Finds the files that matches a Guard plugin.
|
30
37
|
#
|
31
38
|
# @param [Guard::Plugin] guard the Guard plugin which watchers are used
|
@@ -2,10 +2,20 @@ module Guard
|
|
2
2
|
class Watcher
|
3
3
|
class Pattern
|
4
4
|
class Matcher
|
5
|
+
attr_reader :matcher
|
6
|
+
|
5
7
|
def initialize(obj)
|
6
8
|
@matcher = obj
|
7
9
|
end
|
8
10
|
|
11
|
+
# Compare with other matcher
|
12
|
+
# @param other [Guard::Watcher::Pattern::Matcher]
|
13
|
+
# other matcher for comparing
|
14
|
+
# @return [true, false] equal or not
|
15
|
+
def ==(other)
|
16
|
+
matcher == other.matcher
|
17
|
+
end
|
18
|
+
|
9
19
|
def match(string_or_pathname)
|
10
20
|
@matcher.match(normalized(string_or_pathname))
|
11
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.7.
|
238
|
+
rubygems_version: 2.7.6
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Guard keeps an eye on your file modifications
|