rubymon 0.0.10 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubymon.rb +14 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cd53d0bf9c33377b87768ef653c7e1be294ef2c
4
- data.tar.gz: 192302e7ef5560b259a924470d97b3fa874ddad5
3
+ metadata.gz: 1618731a0b414426b8681bcae6de5609aa84c8b8
4
+ data.tar.gz: 5986ebcac23f8bc3904fbb54623af946c7fc41a0
5
5
  SHA512:
6
- metadata.gz: d84721595264092f58f62efa801434b1c5bb0c8d816c55057099c0bb0fab2a21d00b131509c923e01fc53c8d98f6faf33762cf2f9cda8809f6a485dc36087636
7
- data.tar.gz: c006b82a8b68202bedad3956321c663d89afa011eba28c30963b6c25474ea54a5b3c142852d570764260926bb5db3669c8ce44ab7468f0d7329c694c1fc3c5b7
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
- puts "RubyMon executing file #{modified.join("")} ..."
13
- puts "************************\n"
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
- puts "RubyMon executing file #{modified.join("")} .."
45
- puts "************************\n"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubymon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick