zold 0.3.4 → 0.4

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: 310bfd7583912cdc9abc3b2bb8ff1c3a2d8bdc9a
4
- data.tar.gz: 6b9c43db3c2534bedf560a2baf8519596e52d187
3
+ metadata.gz: 51f052404d2cb4a53a1a15c304bd264a5c19762f
4
+ data.tar.gz: 17aa5f67c5b295fc68c2ca50bde2dd1be8236477
5
5
  SHA512:
6
- metadata.gz: 34802e906d21aec4e14ba10f01e4625df22c2e767c470b0167d9879bd7337a83018ea4d7bc506dc9e3deda52c4bbf32624bcd01d8cb4f406bbfd539a82b533e9
7
- data.tar.gz: 6a4f768f29cea3a6246e7c55261ade7444e3149cfccac4a367a361484b695be2170fabd8e3e9246640ed7bfebf68c15ef41e303d780b78268ab32c73ae38a07f
6
+ metadata.gz: c9413af92527b0f5a07e856b7ff986e0a656736173b0282440821543f3b7f5dd91b13eceb5e8b7020c5682a0c60a986ad16a7363fe0e8d359ceb00d462f462ec
7
+ data.tar.gz: 94f2c08f15b3539a2478b2934adb7c389ce4f9b4b0eaf3ee5e421be1867b254a9cb6f5c704696eee445eca41fb8e87ab3edfc539caf94e204ab4d3fca28d0632
data/bin/zold CHANGED
@@ -41,7 +41,19 @@ Encoding.default_internal = Encoding::UTF_8
41
41
  log = Zold::Log.new
42
42
 
43
43
  begin
44
- opts = Slop.parse(ARGV, strict: false, suppress_errors: true) do |o|
44
+ args = []
45
+ config = File.expand_path('~/.zold')
46
+ if File.exist?(config)
47
+ body = File.read(config)
48
+ extra = body.split(/[\r\n]+/).map(&:strip)
49
+ args += extra
50
+ log.debug("Found #{body.split(/\n/).length} lines in #{config}")
51
+ else
52
+ log.debug("Default config file #{config} not found")
53
+ end
54
+ args += ARGV
55
+
56
+ opts = Slop.parse(args, strict: false, suppress_errors: true) do |o|
45
57
  o.banner = "Usage: zold [options] command [arguments]
46
58
  Available commands:
47
59
  #{Rainbow('remote').green}
@@ -58,9 +58,8 @@ module Zold
58
58
  if request.env[Http::SCORE_HEADER]
59
59
  s = Score.parse(request.env[Http::SCORE_HEADER])
60
60
  error(400, 'The score is invalid') unless s.valid?
61
- error(400, 'The score is too small') if s.value < 3
62
61
  error(400, 'The score is weak') if s.strength < Score::STRENGTH
63
- settings.remotes.add(s.host, s.port)
62
+ settings.remotes.add(s.host, s.port) if s.value > 3
64
63
  end
65
64
  end
66
65
 
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.3.4'.freeze
26
+ VERSION = '0.4'.freeze
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko