clearsight 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/cs +11 -3
- data/lib/clearsight.rb +31 -1
- data/lib/clearsight/version.rb +1 -1
- 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: 3d0bf01b2705f26d7ba617aaac1e5a0cddb54e96
|
4
|
+
data.tar.gz: cbb58e74ac61ddb08aacef6b734c4d00ead3e795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f62a2bd3642ee45a72534ab5d59d000f599c908d8a7792f33b56c5a94bae4798672fcf3fb78e47e92764f3811da5fc5697d5398dbaa0bdcaf488e324e16b90ab
|
7
|
+
data.tar.gz: a6850e1d024fc3e499827a84783337dbde5009f9ac2cefc4865ec841e1fb1bb09ab36612e3160d4be897904add7a3ef4fece3906a19e3559f83dce45b62809a2
|
data/Gemfile.lock
CHANGED
data/bin/cs
CHANGED
@@ -13,7 +13,7 @@ class App
|
|
13
13
|
# them below in the show_help method.
|
14
14
|
main do |command, *args|
|
15
15
|
case command.to_s.to_sym
|
16
|
-
when :deploy then
|
16
|
+
when :deploy then CS::Deploy.deploy(args)
|
17
17
|
when :update then update
|
18
18
|
when :help then show_help
|
19
19
|
else
|
@@ -31,11 +31,19 @@ class App
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.update
|
34
|
-
print "Updating
|
35
|
-
|
34
|
+
print "Updating."
|
35
|
+
start_progress do
|
36
|
+
sh "gem update clearsight"
|
37
|
+
end
|
36
38
|
puts "done."
|
37
39
|
end
|
38
40
|
|
41
|
+
def self.start_progress
|
42
|
+
@t = CS::Timer.new 0.5 do print "." end
|
43
|
+
yield
|
44
|
+
@t.stop
|
45
|
+
end
|
46
|
+
|
39
47
|
arg :args, :optional
|
40
48
|
|
41
49
|
version Clearsight::VERSION
|
data/lib/clearsight.rb
CHANGED
@@ -1,6 +1,36 @@
|
|
1
1
|
require "clearsight/version"
|
2
2
|
require "clearsight/deploy"
|
3
|
+
require 'thread'
|
3
4
|
|
4
5
|
module Clearsight
|
5
|
-
|
6
|
+
class Timer
|
7
|
+
def initialize(interval, &handler)
|
8
|
+
@run = true
|
9
|
+
@semaphore = Mutex.new
|
10
|
+
|
11
|
+
@th = Thread.new do
|
12
|
+
t = Time.now
|
13
|
+
while run?
|
14
|
+
t += interval
|
15
|
+
(sleep(t - Time.now) rescue nil) and handler.call rescue nil
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def stop
|
21
|
+
@semaphore.synchronize do
|
22
|
+
@run = false
|
23
|
+
end
|
24
|
+
@th.join
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def run?
|
30
|
+
@semaphore.synchronize do
|
31
|
+
@run
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
6
35
|
end
|
36
|
+
::CS = ::Clearsight
|
data/lib/clearsight/version.rb
CHANGED