clearsight 1.2.0.rc1 → 1.2.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/clearsight/ssh.rb +15 -0
- data/lib/clearsight/timer.rb +33 -0
- data/lib/clearsight/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64e9fd746a8f6b5722548589048845597dc98df
|
4
|
+
data.tar.gz: cdbd88c334d38e4a07ca9a909ebb8b3329d0c1a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 828da4790d34f21ca1fcf8bf3c1ad7c1880809066b15ee86cef0ea6a23e4d80c6036e0696019c1e43ece0e9ffb8ac32409d3e5e4cb20cd5eb337a8ca0b457d66
|
7
|
+
data.tar.gz: 1bae486397f4e4cc6894d2d90b4e6ffe80db7348ef0b0db9484cd22654d6e124934d40a067f77b9b693dcc80fe227d60a8711b39f59624d7a4420eb0bb7a66d8
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Clearsight
|
2
|
+
class SSH
|
3
|
+
|
4
|
+
def initialize(host)
|
5
|
+
@host = host
|
6
|
+
end
|
7
|
+
|
8
|
+
def sshify(keyname)
|
9
|
+
# sh "cat ~/.ssh/#{keyname} | ssh #{host} 'cat >> ~/.ssh/authorized_keys'"
|
10
|
+
sh "ssh-copy-id -i ~/.ssh/#{keyname} #{@host}"
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
Clearsight::Ssh = Clearsight::SSH
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
3
|
+
module Clearsight
|
4
|
+
class Timer
|
5
|
+
def initialize(interval, &handler)
|
6
|
+
@run = true
|
7
|
+
@semaphore = Mutex.new
|
8
|
+
|
9
|
+
@th = Thread.new do
|
10
|
+
t = Time.now
|
11
|
+
while run?
|
12
|
+
t += interval
|
13
|
+
(sleep(t - Time.now) rescue nil) and handler.call rescue nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def stop
|
19
|
+
@semaphore.synchronize do
|
20
|
+
@run = false
|
21
|
+
end
|
22
|
+
@th.join
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def run?
|
28
|
+
@semaphore.synchronize do
|
29
|
+
@run
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/clearsight/version.rb
CHANGED
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: 1.2.0.
|
4
|
+
version: 1.2.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -130,6 +130,8 @@ files:
|
|
130
130
|
- lib/clearsight.rb
|
131
131
|
- lib/clearsight/deploy.rb
|
132
132
|
- lib/clearsight/middleman.rb
|
133
|
+
- lib/clearsight/ssh.rb
|
134
|
+
- lib/clearsight/timer.rb
|
133
135
|
- lib/clearsight/version.rb
|
134
136
|
- lib/clearsight/xcode.rb
|
135
137
|
- test/tc_something.rb
|