ninny 0.1.10 → 0.1.11

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: e3d651b7841febd9cbba4fd31c36dcb7882b010ca193ccda73d0260e480ff76e
4
- data.tar.gz: 28455776fb99b0e71d069aa1ebf27cd4fa8488723241a9a7686cc51f6ae76169
3
+ metadata.gz: cbd94550d42dd1d2280ae1838482dc22f67ec5abaea0abacdf57feccc6fedc23
4
+ data.tar.gz: 5801551978e1805825178d2544f3bd94554bf944f1e095b35f8448a7ed9e1ad5
5
5
  SHA512:
6
- metadata.gz: a437f827b80edb78e010deda666d4bec5ea25e5a09e5ecffdc43a44daef569038506174e37326f1da682185b119ad7c3f3e2c5707734a17a5b3f0aedb01aed18
7
- data.tar.gz: 9e9d7fea9d69fe4673bcf7acac292bf4ab87a46cd685b3c1f19b02265c8c4ad65e70f3435b26fff9576618592e873fcf20395306df3989efc9bbdbbf6e9e0f4a
6
+ metadata.gz: 53df5cd87f9193a26bb0976bf4bf0efbcb10a1e2c4e6c6cc25a1381ae11ad69f8279f60fcc05848f0127e19982d08a7505f2c7e49b9b62a785af957a6a717b11
7
+ data.tar.gz: a9534c205c2f24cab166a80795e11038040afa0bac73592da8af8d4762a1bd820224d39b1a85fb7930b5c1e637d6f24ce9d3c0e6032ca7d78c7aba3a6c014a38
data/.rubocop.yml CHANGED
@@ -20,5 +20,8 @@ Lint/EmptyBlock:
20
20
  Lint/MissingSuper:
21
21
  Enabled: false
22
22
 
23
+ Metrics/MethodLength:
24
+ Max: 15
25
+
23
26
  Style/OptionalBooleanParameter:
24
27
  Enabled: false
@@ -15,11 +15,20 @@ module Ninny
15
15
  def execute(output: $stdout)
16
16
  try_reading_user_config
17
17
 
18
- prompt_for_gitlab_private_token
18
+ private_token = prompt_for_gitlab_private_token
19
19
 
20
- config.write(force: true)
21
- # Command logic goes here ...
22
- output.puts "User config #{@result}"
20
+ begin
21
+ # TODO: This only works with thor gem < 1. So, we need to make this work when TTY
22
+ # releases versions compatible with thor versions >= 1 as well.
23
+ config.write(force: true)
24
+ rescue StandardError
25
+ puts ' Unable to write config file via TTY... continuing anyway...'
26
+ File.open("#{ENV['HOME']}/.ninny.yml", 'w') do |file|
27
+ file.puts "gitlab_private_token: #{private_token}"
28
+ end
29
+ end
30
+
31
+ output.puts "User config #{@result}!"
23
32
  end
24
33
 
25
34
  def try_reading_user_config
@@ -39,7 +48,16 @@ module Ninny
39
48
  return unless prompt.yes?("Do you have a#{new_token_text} GitLab private token?")
40
49
 
41
50
  private_token = prompt.ask('Enter private token:', required: true)
42
- config.set(:gitlab_private_token, value: private_token)
51
+
52
+ begin
53
+ # TODO: This only works with thor gem < 1. So, we need to make this work when TTY
54
+ # releases versions compatible with thor versions >= 1 as well.
55
+ config.set(:gitlab_private_token, value: private_token)
56
+ rescue ArgumentError
57
+ puts ' Unable to set new token via TTY... continuing anyway...'
58
+ end
59
+
60
+ private_token
43
61
  end
44
62
  end
45
63
  end
data/lib/ninny/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ninny
4
- VERSION = '0.1.10'
4
+ VERSION = '0.1.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dispatch Engineers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git