abide_dev_utils 0.4.1 → 0.4.2

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: ecd985f39afeac37bf8f2305dc65c782f34722f95a655249d7219b975952012f
4
- data.tar.gz: 9123b33054f39149ba2deb34464b56bcac404438ac161f64a02e93fc1d33b340
3
+ metadata.gz: 71c8c65ce60fc385fdc289f00b98328f35e0b343b397864fea49010683ab274c
4
+ data.tar.gz: 1060f161729e0330efadf391bc35f9a84544522cc443364833c56beeec8fb308
5
5
  SHA512:
6
- metadata.gz: 595556633f91088d8b34ac1d17d5f012c9d84ca7c03d45ef31bd59ccc45278b008f967b5e096909fa625c8eac7911163584ac7d0d4cc46caa1bd062b14eb1f7c
7
- data.tar.gz: 0dc612075817afeae37820a7c2d097a29af5ed3ee491b7ab2c61743e209b0345e5fd5fff6f5aab53b3d85b9f0e5b9c07cf16cefff5092ec981c679523fd141e2
6
+ metadata.gz: 608138ff9fecf9835094848f5d7967b8b9ba87d9da766e943e1ec053936cc605e823befa0e5c893579dd4a8ad9a3b8dff49b4129624e9a338cb5cf0775f32272
7
+ data.tar.gz: 3610c0fae0872a7883a5608e703c0a025ff529b39e025315f984c40f6a63bc09206eaa9e874a11a180c2ad392c9afb14cd2eb18974129fecfee8eed4bbb2470e
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
+ require 'abide_dev_utils/config'
4
5
  require 'abide_dev_utils/jira'
5
6
 
6
7
  module Abide
7
8
  module CLI
9
+ CONFIG = AbideDevUtils::Config
8
10
  JIRA = AbideDevUtils::Jira
9
11
 
10
12
  class JiraCommand < CmdParse::Command
@@ -7,13 +7,17 @@ module AbideDevUtils
7
7
  DEFAULT_PATH = "#{File.expand_path('~')}/.abide_dev.yaml"
8
8
 
9
9
  def self.to_h(path = DEFAULT_PATH)
10
+ return {} unless File.file?(path)
11
+
10
12
  h = YAML.safe_load(File.open(path), [Symbol])
11
13
  h.transform_keys(&:to_sym)
12
14
  end
13
15
 
14
16
  def self.config_section(section, path = DEFAULT_PATH)
15
17
  h = to_h(path)
16
- s = h[section.to_sym]
18
+ s = h.fetch(section.to_sym, nil)
19
+ return {} if s.nil?
20
+
17
21
  s.transform_keys(&:to_sym)
18
22
  end
19
23
 
@@ -86,6 +86,8 @@ module AbideDevUtils
86
86
 
87
87
  def self.client(options: {})
88
88
  opts = merge_options(options)
89
+ return client_from_prompts if opts.empty?
90
+
89
91
  opts[:username] = AbideDevUtils::Prompt.username if opts[:username].nil?
90
92
  opts[:password] = AbideDevUtils::Prompt.password if opts[:password].nil?
91
93
  opts[:site] = AbideDevUtils::Prompt.single_line('Jira URL') if opts[:site].nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AbideDevUtils
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abide_dev_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heston Snodgrass
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri