slackbot_frd 0.2.8 → 0.2.9
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/bin/slackbot-frd +14 -8
- data/lib/slackbot_frd/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ffc381e9ce6ec71a7454fc1b5149467b68f0735
|
4
|
+
data.tar.gz: 492ee45b4ecf16b697c64c1179429286f18ac3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea3381601043e30939c03363fe0c82a17946a2cbff891f71d7bc9e4f12dbec92aaee0a709b2860c3a2d61f5916e75d6613798d5c51aa118e01bbb16b2b37962
|
7
|
+
data.tar.gz: 6cab09aa37ce70ec106458da6da16c0982321f4959c0db08d4328237ce9aa12cfcaa62b4ac2f2712418fb4c63c185cb9378dbe3e461fb507d2302d8c9beca65e
|
data/bin/slackbot-frd
CHANGED
@@ -127,25 +127,25 @@ class SlackbotFrdBin < Thor
|
|
127
127
|
daemonize = false
|
128
128
|
daemonize = $slackbotfrd_conf['daemonize'] if $slackbotfrd_conf['daemonize']
|
129
129
|
if ENV['SLACKBOT_FRD_DAEMONIZE']
|
130
|
-
daemonize = ENV['SLACKBOT_FRD_DAEMONIZE']
|
130
|
+
daemonize = ENV['SLACKBOT_FRD_DAEMONIZE'].chomp
|
131
131
|
daemonize = daemonize == 'true' || daemonize == '1'
|
132
132
|
end
|
133
133
|
daemonize = options[:daemonize] if options[:daemonize]
|
134
134
|
|
135
135
|
botdir = Dir.pwd
|
136
136
|
botdir = $slackbotfrd_conf['botdir'] if $slackbotfrd_conf['botdir']
|
137
|
-
botdir = ENV['SLACKBOT_FRD_BOTDIR'] if ENV['SLACKBOT_FRD_BOTDIR']
|
137
|
+
botdir = ENV['SLACKBOT_FRD_BOTDIR'].chomp if ENV['SLACKBOT_FRD_BOTDIR']
|
138
138
|
botdir = options[:botdir] if options[:botdir]
|
139
139
|
botdir = File.expand_path(botdir)
|
140
140
|
|
141
141
|
SlackbotFrd::Log.logfile = "#{botdir}/#{LOG_FILE}"
|
142
142
|
SlackbotFrd::Log.logfile = $slackbotfrd_conf['log_file'] if $slackbotfrd_conf['log_file']
|
143
|
-
SlackbotFrd::Log.logfile = ENV['SLACKBOT_FRD_LOG_FILE'] if ENV['SLACKBOT_FRD_LOG_FILE']
|
143
|
+
SlackbotFrd::Log.logfile = ENV['SLACKBOT_FRD_LOG_FILE'].chomp if ENV['SLACKBOT_FRD_LOG_FILE']
|
144
144
|
SlackbotFrd::Log.logfile = options['log-file'] if options['log-file']
|
145
145
|
|
146
146
|
SlackbotFrd::Log.level = :info
|
147
147
|
SlackbotFrd::Log.level = $slackbotfrd_conf['log_level'] if $slackbotfrd_conf['log_level']
|
148
|
-
SlackbotFrd::Log.level = ENV['SLACKBOT_FRD_LOG_LEVEL'] if ENV['SLACKBOT_FRD_LOG_LEVEL']
|
148
|
+
SlackbotFrd::Log.level = ENV['SLACKBOT_FRD_LOG_LEVEL'].chomp if ENV['SLACKBOT_FRD_LOG_LEVEL']
|
149
149
|
SlackbotFrd::Log.level = options['log-level'] if options['log-level']
|
150
150
|
|
151
151
|
# If we got a number for log level that is valid, just use that
|
@@ -366,21 +366,27 @@ class SlackbotFrdBin < Thor
|
|
366
366
|
slackbotfrd_conf ||= {}
|
367
367
|
slackbotfrd_conf.keys.inject(slackbotfrd_conf) do |acc, key|
|
368
368
|
slackbotfrd_conf_key_to_keys(key).each do |k|
|
369
|
-
acc[k] = acc[key]
|
369
|
+
acc[k] = chomp_if_string(acc[key])
|
370
370
|
end
|
371
371
|
acc
|
372
372
|
end
|
373
373
|
# Copy env vars into the config so they can be used easily
|
374
374
|
ENV.keys.inject(slackbotfrd_conf) do |acc, key|
|
375
375
|
if key =~ /^SLACKBOT_FRD/i
|
376
|
-
acc[key] = ENV[key]
|
377
|
-
acc[key.downcase] = ENV[key]
|
378
|
-
acc[key.gsub(/SLACKBOT_FRD_?/i, '').downcase] = ENV[key]
|
376
|
+
acc[key] = chomp_if_string(ENV[key])
|
377
|
+
acc[key.downcase] = chomp_if_string(ENV[key])
|
378
|
+
acc[key.gsub(/SLACKBOT_FRD_?/i, '').downcase] = chomp_if_string(ENV[key])
|
379
379
|
end
|
380
380
|
acc
|
381
381
|
end
|
382
382
|
slackbotfrd_conf
|
383
383
|
end
|
384
|
+
|
385
|
+
private
|
386
|
+
def chomp_if_string(str)
|
387
|
+
return str.chomp if str.is_a?(String)
|
388
|
+
str
|
389
|
+
end
|
384
390
|
end
|
385
391
|
|
386
392
|
if !ARGV.empty? && %w[-v --version].include?(ARGV.first)
|