haveapi-client 0.26.2 → 0.26.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
  SHA256:
3
- metadata.gz: 0167a2a447473ea9c29f3f4e2e6901993f5c20a7cf57fa6abb3330f45d30c5ae
4
- data.tar.gz: 64ec04717e12568819426a862ee3d1acce20323e6be6a607fb6fa0f165431c3e
3
+ metadata.gz: 990c16577799341bfe013e588b33b15e52c3acf973869a84ba3b051b99de57fd
4
+ data.tar.gz: 14d4be7d907a1ef7857f5e7fc56cf39a408958e20aa1d7f0e10f4737d9cc3309
5
5
  SHA512:
6
- metadata.gz: 512b1e74055011e5c3ffaad932e0a35663c546d7fc41494a15b842a15bf206be1b0c1398860913591f8518ed2cec58c1e03a16eec5e0c6b1a66d235202ceed6b
7
- data.tar.gz: 5a332edfd9a64aeae38296b21b8ba45ffe0f3e486cad8f5927c7f0cbff253e3a8f648fd70893e9d29fae7c1a83480873849a268b209bf7aebeb9cf6141ded707
6
+ metadata.gz: 28eefedb8c494cf33f0b81729b34dfcc558affdcb9d3acabf8c58f49b6a0ec9cb55a9f6e8b4c32ad72da42e4f66a78125710aa861284bcc1fbe119f230998306
7
+ data.tar.gz: d42f140abba3ffa5851bb68a410061e64e23fd7a7e312d20ed82f36d6a143a1016e496773beb675aaf86248bf33809de994d0a55aba4d1d48324f4f119346325
@@ -641,12 +641,22 @@ module HaveAPI::CLI
641
641
  "#{Dir.home}/.haveapi-client.yml"
642
642
  end
643
643
 
644
+ def system_config_path
645
+ '/etc/haveapi-client.yml'
646
+ end
647
+
644
648
  def write_config
645
649
  File.write(config_path, YAML.dump(@config))
646
650
  end
647
651
 
648
652
  def read_config
649
- @config = YAML.load_file(config_path) if File.exist?(config_path)
653
+ path = if File.exist?(config_path)
654
+ config_path
655
+ elsif File.exist?(system_config_path)
656
+ system_config_path
657
+ end
658
+
659
+ @config = YAML.load_file(path) if path
650
660
  end
651
661
 
652
662
  def server_config(url)
@@ -11,7 +11,7 @@ module HaveAPI::Client
11
11
  return len >= opts[:min] if opts[:min] && !opts[:max]
12
12
  return len <= opts[:max] if !opts[:min] && opts[:max]
13
13
 
14
- len >= opts[:min] && len <= opts[:max]
14
+ len.between?(opts[:min], opts[:max])
15
15
  end
16
16
  end
17
17
  end
@@ -1,6 +1,6 @@
1
1
  module HaveAPI
2
2
  module Client
3
3
  PROTOCOL_VERSION = '2.0'.freeze
4
- VERSION = '0.26.2'.freeze
4
+ VERSION = '0.26.4'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haveapi-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.2
4
+ version: 0.26.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
- rubygems_version: 3.6.6
172
+ rubygems_version: 3.7.2
173
173
  specification_version: 4
174
174
  summary: Ruby API and CLI for HaveAPI
175
175
  test_files: []