rake-tilde 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rake/tilde.rb +22 -9
- data/lib/rake/tilde/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f819477ad14b1b01204f0ec6ce88f3863ac35629
|
4
|
+
data.tar.gz: 46f034c96e23c72df0f23e558a7c5aeec231e417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae19740a1e631d544be51076941fe69da2aa7e30817fc038af4366634d0deb2d4f0b0dcb610485454feaf81e2eca9d69c734fabccd33efc8e617383ded7cd773
|
7
|
+
data.tar.gz: 8c197b1762f57e84b7a7454e203a79e68e9ad3458c846479bf7500a640958dab9216d20c43c95bf5a94f2d58a17c62bb36882489765f90f4a1319939cbfc2357
|
data/lib/rake/tilde.rb
CHANGED
@@ -43,8 +43,8 @@ module Rake
|
|
43
43
|
listener = Listen.to(paths, opts) do |modified, added, removed|
|
44
44
|
$stdout.puts "** File system changed"
|
45
45
|
begin
|
46
|
-
|
47
|
-
|
46
|
+
pid = spawn("rake #{task.name}")
|
47
|
+
Process.wait pid
|
48
48
|
blk.call(modified, added, removed) if blk
|
49
49
|
rescue StandardError => exception
|
50
50
|
$stderr.puts "** Task failed to run successfully with tilde"
|
@@ -55,10 +55,23 @@ module Rake
|
|
55
55
|
listeners.push listener
|
56
56
|
listener.start
|
57
57
|
end
|
58
|
+
|
59
|
+
def sleep_forever
|
60
|
+
begin
|
61
|
+
sleep
|
62
|
+
rescue Interrupt
|
63
|
+
puts
|
64
|
+
end
|
65
|
+
end
|
58
66
|
end
|
59
67
|
end
|
60
68
|
|
61
69
|
module OverrideInvoke
|
70
|
+
def top_level
|
71
|
+
super
|
72
|
+
Rake::Tilde.sleep_forever if tilde?
|
73
|
+
end
|
74
|
+
|
62
75
|
def invoke_task(task_string)
|
63
76
|
task_string = task_string.gsub(/^\~/, '')
|
64
77
|
task_name, args = parse_task_string(task_string)
|
@@ -73,6 +86,10 @@ module OverrideInvoke
|
|
73
86
|
def tilde_tasks
|
74
87
|
@__tilde_tasks ||= []
|
75
88
|
end
|
89
|
+
|
90
|
+
def tilde?
|
91
|
+
tilde_tasks.any?
|
92
|
+
end
|
76
93
|
end
|
77
94
|
|
78
95
|
Rake.application.extend OverrideInvoke
|
@@ -92,12 +109,8 @@ def listen(**args, &blk)
|
|
92
109
|
Rake::Tilde.listen(**args, &blk)
|
93
110
|
end
|
94
111
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
sleep
|
99
|
-
rescue Interrupt
|
100
|
-
puts
|
101
|
-
end
|
112
|
+
namespace :tilde do
|
113
|
+
task :sleep do
|
114
|
+
Rake::Tilde.sleep_forever unless Rake.application.tilde?
|
102
115
|
end
|
103
116
|
end
|
data/lib/rake/tilde/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-tilde
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- myobie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|