sleeproom 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0154be3d205feeac7e626a12dce7c76e54253c9731d926e35aab1478e046f5f5
4
- data.tar.gz: 93ed191055cbe4af6c73890bb50daadef4296857ba1f90f2b924547aefbfa92d
3
+ metadata.gz: 602c623c73913b772f7b1375ce6a7d9c3415df23bcd564d78ae58ddb21fd7b7b
4
+ data.tar.gz: 3b6859da62f1a29c1f8f05b65d039a593f78ba6e5e6b4fa9d9c9636d5f6c56ca
5
5
  SHA512:
6
- metadata.gz: d9d8f2c0ddb0cad2c30c8bb9c3f9719eb9585c1895b0e114f97f11d534c52372925225a9b61dfbb89be05605e6e6637e801ba547417626dfde035b1b7ea94620
7
- data.tar.gz: 5d1b0e70df00ae7e069f9af9a41c751445d8a9ab24f0223f573ab7e8e61064eb2ab82a91193ebf65c0e94face9e906254928b85335bd72ca6b37621fd2281a76
6
+ metadata.gz: 2af5ad3283bcaa58d7b6524a12413b81ef1aaf294d0d5bc95e5abfdae9892a876bb7a7cd32f6a8ad56154054afe3c3e61f5f0fe69bb445f37935fe1c80fbca5f
7
+ data.tar.gz: 881a889d97e13a3a3c78c7a98a94563ddb1d2ecd338809ba313ae3748e4f10403dde1a6c8b48f70c0200c7426446a71da96671516be82f5bb9cd9940c94ab1a7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sleeproom (0.1.1)
4
+ sleeproom (0.1.2)
5
5
  async
6
6
  async-http-faraday
7
7
  async-websocket
@@ -19,12 +19,12 @@ module SleepRoom
19
19
  def record(reconnection: false)
20
20
  room = @room
21
21
  Async do |task|
22
- api = API::RoomAPI.new(room)
22
+ set_room_info
23
23
  task.async do |t|
24
- while api.live?
24
+ while @is_live
25
25
  if status = SleepRoom.load_config(:status).find{|hash| hash[:room] == room}
26
26
  if !status[:pid].nil?
27
- break if SleepRoom.running?(pid) == false
27
+ break if SleepRoom.running?(status[:pid]) == false
28
28
  else
29
29
  break
30
30
  end
@@ -34,11 +34,6 @@ module SleepRoom
34
34
  t.sleep 60
35
35
  end
36
36
  end.wait
37
- @room_id = api.room_id
38
- @room_name = api.room_name
39
- @is_live = api.live?
40
- @broadcast_host = api.broadcast_host
41
- @broadcast_key = api.broadcast_key
42
37
  if @is_live
43
38
  start_time = Time.now
44
39
  log("Live broadcast.")
@@ -55,12 +50,7 @@ module SleepRoom
55
50
  if @running == false && @reconnection == false
56
51
  start_websocket
57
52
  elsif @reconnection == true
58
- api = API::RoomAPI.new(room)
59
- @room_id = api.room_id
60
- @room_name = api.room_name
61
- @is_live = api.live?
62
- @broadcast_host = api.broadcast_host
63
- @broadcast_key = api.broadcast_key
53
+ set_room_info
64
54
  start_websocket
65
55
  @reconnection = false
66
56
  end
@@ -139,6 +129,15 @@ module SleepRoom
139
129
  @running = false
140
130
  end
141
131
  end
132
+
133
+ def set_room_info
134
+ api = API::RoomAPI.new(room)
135
+ @room_id = api.room_id
136
+ @room_name = api.room_name
137
+ @is_live = api.live?
138
+ @broadcast_host = api.broadcast_host
139
+ @broadcast_key = api.broadcast_key
140
+ end
142
141
 
143
142
  def parse_streaming_url(task: Async::Task.current)
144
143
  api = API::StreamingAPI.new(@room_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SleepRoom
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleeproom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize