tldr 0.9.0 → 0.9.1
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/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/lib/tldr/version.rb +1 -1
- data/lib/tldr/watcher.rb +9 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6d49bfa66698f5e33451a20655ab442e6a6e50e76ec3b048b49d93baf7d8c66
|
4
|
+
data.tar.gz: f64c38ecd633686bc7616d4cf377fd49d2d91387dadaad09d81bf960ae2c39b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 524382d1fe9004b821bc7c7ea9b33779221ed60b35f51cf78924412c15a2c3cf07bb2ad46f8d5815f0890f3bd2ccfec868310521b00def3196ab93069e9153b0
|
7
|
+
data.tar.gz: 11313f640b6f2443063dbd79083f6810dca5778411c8093a36ebd5284b306c3db6be9dbc9e7bf53c4f63500734075371051243e75a665fb7e0e952ce28fdbe23
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -170,6 +170,9 @@ of the configured load paths (`["test", "lib"]` by default) and then execute
|
|
170
170
|
your tests each time a file is changed. To keep the output up-to-date and easy
|
171
171
|
to scan, it will also clear your console before each run.
|
172
172
|
|
173
|
+
Note that this feature requires you have
|
174
|
+
[fswatch](https://github.com/emcrisostomo/fswatch) installed and on your `PATH`
|
175
|
+
|
173
176
|
Here's what that might look like:
|
174
177
|
|
175
178
|

|
data/lib/tldr/version.rb
CHANGED
data/lib/tldr/watcher.rb
CHANGED
@@ -2,10 +2,17 @@ class TLDR
|
|
2
2
|
class Watcher
|
3
3
|
def watch config
|
4
4
|
require_fs_watch!
|
5
|
-
|
5
|
+
tldr_command = "#{"bundle exec " if defined?(Bundler)}tldr #{config.to_full_args(ensure_args: ["--i-am-being-watched"])}"
|
6
|
+
command = "fswatch -o #{config.load_paths.reverse.join(" ")} | xargs -n1 -I{} #{tldr_command}"
|
6
7
|
|
7
8
|
puts <<~MSG
|
8
|
-
|
9
|
+
|
10
|
+
Watching for changes in #{config.load_paths.map(&:inspect).join(", ")}...
|
11
|
+
|
12
|
+
When a file changes, TLDR will run this command:
|
13
|
+
|
14
|
+
$ #{tldr_command}
|
15
|
+
|
9
16
|
MSG
|
10
17
|
|
11
18
|
exec command
|
@@ -24,9 +31,5 @@ class TLDR
|
|
24
31
|
MSG
|
25
32
|
exit 1
|
26
33
|
end
|
27
|
-
|
28
|
-
def tldr_command
|
29
|
-
"#{"bundle exec " if defined?(Bundler)}tldr"
|
30
|
-
end
|
31
34
|
end
|
32
35
|
end
|