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 +4 -4
- data/.rubocop.yml +3 -0
- data/lib/ninny/commands/setup.rb +23 -5
- data/lib/ninny/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbd94550d42dd1d2280ae1838482dc22f67ec5abaea0abacdf57feccc6fedc23
|
4
|
+
data.tar.gz: 5801551978e1805825178d2544f3bd94554bf944f1e095b35f8448a7ed9e1ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53df5cd87f9193a26bb0976bf4bf0efbcb10a1e2c4e6c6cc25a1381ae11ad69f8279f60fcc05848f0127e19982d08a7505f2c7e49b9b62a785af957a6a717b11
|
7
|
+
data.tar.gz: a9534c205c2f24cab166a80795e11038040afa0bac73592da8af8d4762a1bd820224d39b1a85fb7930b5c1e637d6f24ce9d3c0e6032ca7d78c7aba3a6c014a38
|
data/.rubocop.yml
CHANGED
data/lib/ninny/commands/setup.rb
CHANGED
@@ -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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|