slnky 0.12.0 → 0.12.1
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/slnky/cli/notify.rb +13 -13
- data/lib/slnky/template/service/Rakefile.erb +2 -0
- data/lib/slnky/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: d50626f322bbe6a03f8f5f9ad0d47333a0cf2828
|
4
|
+
data.tar.gz: b9fea18e95609538fe62d7f8f3d6cb47eeeb0287
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db64c5ca17c0ce07125b2ece35a588cdeb6fadff72a8461ed8a03fb46f339bffe01e2c8ecba1c2ac49d83a6ca796d95e613c4a6a4a4ce60b0885bb5f67c4c03
|
7
|
+
data.tar.gz: 111cebddcd0655854933c233fed75f360b896315ff28986f6223711014448e9203a608fe99bc205f003a6ae945040ca07684a18bf975b0fa87a3756ff371a6d1
|
data/lib/slnky/cli/notify.rb
CHANGED
@@ -17,25 +17,25 @@ module Slnky
|
|
17
17
|
attributes, they will be moved to their own keyspace
|
18
18
|
DESC
|
19
19
|
def execute
|
20
|
+
Slnky::Config.configure('cli')
|
20
21
|
attributes = {}
|
21
|
-
if file
|
22
|
-
begin
|
23
|
-
yaml = YAML.load_file(file)
|
24
|
-
attributes.merge!(yaml)
|
25
|
-
rescue => e
|
26
|
-
puts "ERROR: reading file #{file}"
|
27
|
-
exit(1)
|
28
|
-
end
|
29
|
-
end
|
22
|
+
attributes.merge!(yaml_file(file)) if file
|
30
23
|
attributes.merge!(dothash(kvs)) if kvs
|
31
24
|
chat = attributes.delete(:chat)
|
32
25
|
msg = Slnky::Message.new({name: name, attributes: attributes, chat: chat})
|
33
|
-
cfg = Slnky.config
|
34
|
-
srv = server || cfg['slnky']['url']
|
35
26
|
|
36
27
|
puts 'sending message:'
|
37
|
-
puts JSON.pretty_generate(msg.to_h)
|
38
|
-
Slnky.notify(msg
|
28
|
+
puts JSON.pretty_generate(msg.to_h) if dry_run?
|
29
|
+
Slnky.notify(msg) unless dry_run?
|
30
|
+
end
|
31
|
+
|
32
|
+
def yaml_file(file)
|
33
|
+
begin
|
34
|
+
YAML.load_file(file)
|
35
|
+
rescue => e
|
36
|
+
puts "ERROR: reading file #{file}"
|
37
|
+
exit(1)
|
38
|
+
end
|
39
39
|
end
|
40
40
|
|
41
41
|
# convert list of dot notation key.name=value into nested hash
|
data/lib/slnky/version.rb
CHANGED