rubymon 0.0.10 → 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/rubymon.rb +14 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1618731a0b414426b8681bcae6de5609aa84c8b8
|
4
|
+
data.tar.gz: 5986ebcac23f8bc3904fbb54623af946c7fc41a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb6cf15773a6687b175e7654d0190e3943e8f90d1321a9b5dbe7d4b6bb5cb5661311e1c0ec48f71f55f12cca179000b78d05e5fa4456d8a5c493527d0c399e6
|
7
|
+
data.tar.gz: d4336276b0905394f7e20fe508823015731501a1a2b792dce5511bd1004be9d6e6f3657d81fbe792ef69a54e80709986d4b3e3bf814fe97faeee294aa8ec147c
|
data/lib/rubymon.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
class Rubymon
|
2
2
|
|
3
|
+
$thr = Thread.new{}
|
4
|
+
|
5
|
+
def self.execute_file modified
|
6
|
+
puts "RubyMon executing file #{modified} ..."
|
7
|
+
puts "************************\n"
|
8
|
+
system("ruby #{modified}")
|
9
|
+
puts "************************"
|
10
|
+
puts "End of file ..."
|
11
|
+
end
|
12
|
+
|
3
13
|
def self.dir
|
4
14
|
begin
|
5
15
|
puts "Can't run RubyMon in the home directory. Exiting ..." if Dir.pwd == Dir.home
|
@@ -9,11 +19,8 @@ class Rubymon
|
|
9
19
|
|
10
20
|
listener = Listen.to(Dir.pwd, only: /\.rb$/) { |modified|
|
11
21
|
if modified.join("").include?(".rb")
|
12
|
-
|
13
|
-
|
14
|
-
system("ruby #{modified.join("")}")
|
15
|
-
puts "************************"
|
16
|
-
puts "End of file ..."
|
22
|
+
$thr.exit
|
23
|
+
$thr = Thread.new{Rubymon.execute_file(modified.join(""))}
|
17
24
|
end
|
18
25
|
}
|
19
26
|
listener.start
|
@@ -41,11 +48,8 @@ class Rubymon
|
|
41
48
|
|
42
49
|
listener = Listen.to(Dir.pwd) { |modified|
|
43
50
|
if modified.join("") == @path
|
44
|
-
|
45
|
-
|
46
|
-
system("ruby #{modified.join("")}")
|
47
|
-
puts "************************"
|
48
|
-
puts "End of file ..."
|
51
|
+
$thr.exit
|
52
|
+
$thr = Thread.new{Rubymon.execute_file(modified.join(""))}
|
49
53
|
end
|
50
54
|
}
|
51
55
|
listener.start
|