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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14633535a651d2eed693fbb35eac9fef4bd27f32
4
- data.tar.gz: 5cbd3f8a8ae6eb31641b6088224062dd3297c0e6
3
+ metadata.gz: d50626f322bbe6a03f8f5f9ad0d47333a0cf2828
4
+ data.tar.gz: b9fea18e95609538fe62d7f8f3d6cb47eeeb0287
5
5
  SHA512:
6
- metadata.gz: 14f924f97a17f83e9a7ac46e052eec91c084aec84b483898a610c7e9f49b69ea0f9141c1b6e24765a1cecee6ff3cadd2a1fc1f403cfed4b293f0600fccbea7dc
7
- data.tar.gz: 15c73d9273a578942614305cec46593fccf675ba7d067d3cbae72971eeabda25644b1e8b7e645b3ab5c772c4b9a91a91be62e50aee34eb395770b6de4d976dfb
6
+ metadata.gz: 6db64c5ca17c0ce07125b2ece35a588cdeb6fadff72a8461ed8a03fb46f339bffe01e2c8ecba1c2ac49d83a6ca796d95e613c4a6a4a4ce60b0885bb5f67c4c03
7
+ data.tar.gz: 111cebddcd0655854933c233fed75f360b896315ff28986f6223711014448e9203a608fe99bc205f003a6ae945040ca07684a18bf975b0fa87a3756ff371a6d1
@@ -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, srv) unless dry_run?
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
@@ -1,4 +1,6 @@
1
1
  require 'rspec/core/rake_task'
2
+ require 'dotenv'
3
+ Dotenv.load
2
4
  RSpec::Core::RakeTask.new(:spec)
3
5
  task :default => :spec
4
6
 
data/lib/slnky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slnky
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slnky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Catanzarite