sleeproom 0.4.1 → 0.4.3
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/Gemfile.lock +1 -1
- data/lib/sleeproom/utils.rb +17 -13
- data/lib/sleeproom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16490f0f3a48428466310c0a5ab4c89a7395aeeb9c71aaba2679b43894c145db
|
4
|
+
data.tar.gz: e03f35faf54bd848151501bbb0dd14c56ea935647fe7bc1e8b9f00095d665691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 819b5780ed280aefcc693986715e30c014128da80d110fc8abb35a23992efdda1f3344ec9b343a1ce746b29a8bd89cf2f90d1beb3989abf9c3d333b8b8f03d5c
|
7
|
+
data.tar.gz: 90a9e5e52b573c39b8627521b04ac7811067a8a1c6f379d597f7c35fbdb7b94a345980feaf74ef4bd49df793d35f40d6135b9e3984633937517d045d6b32140c
|
data/Gemfile.lock
CHANGED
data/lib/sleeproom/utils.rb
CHANGED
@@ -110,7 +110,7 @@ module SleepRoom
|
|
110
110
|
logger: {
|
111
111
|
console: true,
|
112
112
|
file: {
|
113
|
-
use:
|
113
|
+
use: false,
|
114
114
|
path: "#{sleeproom_dir}/log"
|
115
115
|
}
|
116
116
|
}
|
@@ -142,7 +142,8 @@ module SleepRoom
|
|
142
142
|
end
|
143
143
|
true
|
144
144
|
rescue Errno::ENOENT => e
|
145
|
-
|
145
|
+
info("Creating configuration...")
|
146
|
+
init_base
|
146
147
|
false
|
147
148
|
end
|
148
149
|
|
@@ -165,7 +166,7 @@ module SleepRoom
|
|
165
166
|
|
166
167
|
def self.running?(pid=nil)
|
167
168
|
pid = SleepRoom.load_config(:pid) if pid.nil?
|
168
|
-
Process.
|
169
|
+
Process.kill(0, pid)
|
169
170
|
true
|
170
171
|
rescue
|
171
172
|
false
|
@@ -194,35 +195,38 @@ module SleepRoom
|
|
194
195
|
# @param string [String]
|
195
196
|
# @return [nil]
|
196
197
|
def self.info(string)
|
197
|
-
log(:info,
|
198
|
+
log(:info, string)
|
198
199
|
end
|
199
200
|
|
200
201
|
# @param string [String]
|
201
202
|
# @return [nil]
|
202
203
|
def self.warning(string)
|
203
|
-
log(:warning,
|
204
|
+
log(:warning, string)
|
204
205
|
end
|
205
206
|
|
206
207
|
# @param string [String]
|
207
208
|
# @return [nil]
|
208
209
|
def self.error(string)
|
209
|
-
log(:error,
|
210
|
+
log(:error, string)
|
210
211
|
end
|
211
212
|
|
212
213
|
def self.log(type, log)
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
214
|
+
if configatron.logger.console == true
|
215
|
+
case type
|
216
|
+
when :info
|
217
|
+
puts("[INFO] #{log}".colorize(:white))
|
218
|
+
when :warning
|
219
|
+
warn("[WARN] #{log}".colorize(:yellow))
|
220
|
+
when :error
|
221
|
+
puts("[ERROR] #{log}".colorize(:red))
|
222
|
+
end
|
220
223
|
end
|
221
224
|
file_logger(type, log) if configatron.logger.file.use == true
|
222
225
|
end
|
223
226
|
|
224
227
|
def self.file_logger(type, log)
|
225
228
|
path = configatron.logger.file.path
|
229
|
+
mkdir(File.dirname(path)) unless Dir.exist?(File.dirname(path))
|
226
230
|
logger = Logger.new(path)
|
227
231
|
case type
|
228
232
|
when :info
|
data/lib/sleeproom/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.3
|
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-
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|