sparoid 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a97b0d586778f3f851e5c42039bffaf461bb2e8927d9fea86cd69c8cfa0e1e9
4
- data.tar.gz: b66ff9a2c806838408c546d38c3698c7bc5334d3b11aba00d1e4de8f9e848f05
3
+ metadata.gz: 3c8737279c5f4eae1d6b5c38e14fc6d43ec3978bb445196a2873dbcb24c33146
4
+ data.tar.gz: 72b1d744ecac0c6afa993b7365f2023ba17d6306ee64d58ae5a27378d082f667
5
5
  SHA512:
6
- metadata.gz: 1f2643b8599ab7c78e30b3e6927ad79e405becebfa8cfe617a0d7245e82ec4d0b11c9fcbf9cff2365403b59d2472260b4ab8b290e897991d8f3e6b1b19736e1e
7
- data.tar.gz: '048ecd5b85d177c044626fb11cf304fbbc14b906d366566e34c7afa535ec419ba4b8a9369108ab67fc121496908e4a3ac0f42a2821db723bb7771a46ab26ab7e'
6
+ metadata.gz: 671a2b3ad5df6752f29f5de76c6e3f1613088b75406d187154a4be4da514b93e1c0a9ee19b99c430133321029db3f088565d917860f9794ef15558c467ed2532
7
+ data.tar.gz: 57d624c615d9067eaa2d4fd6f23fe3d5213b953674b00738da08f995b917244fb85fb8e1bddf3ccd0013b292a5101ade4014b9da1b5155a35c2d78732ce5c7b6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.8] - 2021-04-27
2
+
3
+ - Get ENV variables if config file is missing
4
+
1
5
  ## [1.0.7] - 2021-04-27
2
6
 
3
7
  - Get key and hmac key from ENV variables
data/lib/sparoid/cli.rb CHANGED
@@ -41,14 +41,17 @@ module Sparoid
41
41
  private
42
42
 
43
43
  def send_auth(host, port, config)
44
- key = ENV["SPAROID_KEY"]
45
- hmac_key = ENV["SPAROID_HMAC_KEY"]
46
- key, hmac_key = get_keys(parse_ini(config)) if config
44
+ key, hmac_key = get_keys(parse_ini(config))
47
45
  Sparoid.auth(key, hmac_key, host, port.to_i)
48
46
  end
49
47
 
50
48
  def parse_ini(path)
51
49
  File.readlines(File.expand_path(path)).map! { |line| line.split("=", 2).map!(&:strip) }.to_h
50
+ rescue Errno::ENOENT
51
+ {
52
+ "key" => ENV["SPAROID_KEY"],
53
+ "hmac-key" => ENV["SPAROID_HMAC_KEY"]
54
+ }
52
55
  end
53
56
 
54
57
  def get_keys(config)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sparoid
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Hörberg