torigoya_kit 0.2.0 → 0.3.0
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/torigoya_kit/client.rb +4 -16
- data/lib/torigoya_kit/session.rb +7 -1
- data/lib/torigoya_kit/stream_result.rb +2 -2
- data/lib/torigoya_kit/version.rb +1 -1
- data/spec/cases/session_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cc3779077a6e9b51a8e4f428caff3c816c777f5
|
|
4
|
+
data.tar.gz: eaad88aa08265757ffbfef7afe3dbc1de4e4a163
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6728157a95a5897861e8112c2f6c10ed287e3b1dbff0e39788b64ce4f9413fa89a08c2e965380dcc8392dd4f08ce2fd17c9c63c77355ac47bb8704196891eeed
|
|
7
|
+
data.tar.gz: e92daf424ecd8b1e329d330ba641145b6e3c57c4e7ab9885388cbe1a2ff1f56e9c90c718c74193d0e3235c544f268031cf81aac8916706f5cff1954c4f8335da
|
data/lib/torigoya_kit/client.rb
CHANGED
|
@@ -8,33 +8,21 @@ module TorigoyaKit
|
|
|
8
8
|
def initialize(host, port)
|
|
9
9
|
@host = host
|
|
10
10
|
@port = port
|
|
11
|
+
@session = new_session()
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
####
|
|
14
15
|
def exec_ticket(ticket)
|
|
15
|
-
return
|
|
16
|
+
return @session.exec_ticket(ticket)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def exec_ticket_with_stream(ticket, &block)
|
|
19
|
-
return
|
|
20
|
+
return @session.exec_ticket_with_stream(ticket, &block)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
####
|
|
23
24
|
def update_packages()
|
|
24
|
-
return
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
####
|
|
28
|
-
def reload_proc_table()
|
|
29
|
-
return new_session().reload_proc_table()
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def update_proc_table()
|
|
33
|
-
return new_session().update_proc_table()
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def get_proc_table()
|
|
37
|
-
return new_session().get_proc_table()
|
|
25
|
+
return @session.update_packages()
|
|
38
26
|
end
|
|
39
27
|
|
|
40
28
|
private
|
data/lib/torigoya_kit/session.rb
CHANGED
|
@@ -73,8 +73,13 @@ module TorigoyaKit
|
|
|
73
73
|
|
|
74
74
|
elsif res.is_a?(StreamSystemError)
|
|
75
75
|
raise res.message
|
|
76
|
+
|
|
77
|
+
elsif res.is_a?(StreamExit)
|
|
78
|
+
break
|
|
79
|
+
|
|
76
80
|
else
|
|
77
81
|
raise "Unexpected error: unknown message was recieved (#{res.class})"
|
|
82
|
+
|
|
78
83
|
end
|
|
79
84
|
end
|
|
80
85
|
return result
|
|
@@ -141,8 +146,9 @@ module TorigoyaKit
|
|
|
141
146
|
obj = recv_frame_object()
|
|
142
147
|
raise "object is empty" if obj.nil?
|
|
143
148
|
|
|
144
|
-
|
|
149
|
+
will_terminate = obj.is_a?(StreamExit)
|
|
145
150
|
block.call(obj) unless block.nil?
|
|
151
|
+
break if will_terminate
|
|
146
152
|
end
|
|
147
153
|
end
|
|
148
154
|
|
data/lib/torigoya_kit/version.rb
CHANGED
data/spec/cases/session_spec.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require_relative '../spec_helper'
|
|
4
4
|
|
|
5
5
|
describe :session do
|
|
6
|
-
port =
|
|
6
|
+
port = 23456
|
|
7
7
|
|
|
8
8
|
it "session proc exec_ticket" do
|
|
9
9
|
s = TorigoyaKit::Session.new("localhost", port)
|
|
@@ -18,8 +18,10 @@ describe :session do
|
|
|
18
18
|
expect(t.link.result.exit_status).to eq 0
|
|
19
19
|
|
|
20
20
|
expect(t.run[0].result.system_error_status).to eq 0
|
|
21
|
-
expect(t.run[0].result.exited).to eq
|
|
22
|
-
expect(t.run[0].result.
|
|
21
|
+
expect(t.run[0].result.exited).to eq false
|
|
22
|
+
expect(t.run[0].result.signaled).to eq true
|
|
23
|
+
expect(t.run[0].result.signal).to eq 9
|
|
24
|
+
#expect(t.run[0].result.exit_status).to eq 0
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
it "session proc update_packages" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: torigoya_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yutopp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|