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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ade6c690137138348369f2ee4614b28ca8f2f9a0
4
- data.tar.gz: ece7951de8a3c079e0f180416b6729233116edad
3
+ metadata.gz: 3d0bf01b2705f26d7ba617aaac1e5a0cddb54e96
4
+ data.tar.gz: cbb58e74ac61ddb08aacef6b734c4d00ead3e795
5
5
  SHA512:
6
- metadata.gz: d2228cdfb8d518137fe6cbf9dd5c8dbcd93e7b9f0e0eca34ada1a582b3bfb7ccc51aa352cfbdaf07bbb823f0b76d75f310e1f98693f2c0b735597228a0635cd9
7
- data.tar.gz: 9bc9f3c85aed5c0f75422d2172dfde42751228367f31a7f84a7183de35faea18790771f42628692ee42efe5456cb692e299af56c29d3e76a897d11e1a6dbba02
6
+ metadata.gz: f62a2bd3642ee45a72534ab5d59d000f599c908d8a7792f33b56c5a94bae4798672fcf3fb78e47e92764f3811da5fc5697d5398dbaa0bdcaf488e324e16b90ab
7
+ data.tar.gz: a6850e1d024fc3e499827a84783337dbde5009f9ac2cefc4865ec841e1fb1bb09ab36612e3160d4be897904add7a3ef4fece3906a19e3559f83dce45b62809a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clearsight (0.0.4)
4
+ clearsight (0.0.5)
5
5
  methadone (~> 1.3.0)
6
6
 
7
7
  GEM
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 Clearsight::Deploy.deploy(args)
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
- sh "gem update clearsight"
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
- # Your code goes here...
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
@@ -1,3 +1,3 @@
1
1
  module Clearsight
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearsight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren