aia 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/CHANGELOG.md +3 -0
- data/justfile +7 -0
- data/lib/aia/main.rb +12 -1
- data/lib/aia/prompt.rb +6 -1
- data/main.just +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35bff72b31591194079e96f6e1dfab9dc76db90fda1f635e962377aeb77b5662
|
4
|
+
data.tar.gz: 60704012ba00cca73bdb6bb344a4207df189b97b5dc2d686a53215836c5d27d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7b3f5bb0bee380f3863bfe80599e8898e16143587d374db27f99d27a718433d9e6869da1a8f44207016185c0b28935b5c5edbaf45d939992ad58ecd65a68fa9
|
7
|
+
data.tar.gz: 3f4fd8f0707e55cfc2147090d55ff4c865eba8c14bb22bb07831b3e46653530c9800a8d69f148e978bcb763a91d47ac3b58c1f2ab19e387019d6537b9446059e
|
data/.semver
CHANGED
data/CHANGELOG.md
CHANGED
data/justfile
CHANGED
@@ -112,6 +112,7 @@ mods_delete_all:
|
|
112
112
|
module_repo := "/Users/dewayne/sandbox/git_repos/repo.just"
|
113
113
|
module_gem := "/Users/dewayne/sandbox/git_repos/gem.just"
|
114
114
|
module_version := "/Users/dewayne/just_modules/version.just"
|
115
|
+
module_git := "/Users/dewayne/just_modules/git.just"
|
115
116
|
|
116
117
|
|
117
118
|
# Install Locally
|
@@ -185,3 +186,9 @@ alias inc := bump
|
|
185
186
|
@version what='' args='':
|
186
187
|
just -d . -f {{module_version}} {{what}} {{args}}
|
187
188
|
|
189
|
+
|
190
|
+
|
191
|
+
# Module git
|
192
|
+
@git what='' args='':
|
193
|
+
just -d . -f {{module_git}} {{what}} {{args}}
|
194
|
+
|
data/lib/aia/main.rb
CHANGED
@@ -56,6 +56,11 @@ class AIA::Main
|
|
56
56
|
|
57
57
|
# Function to prompt the user with a question using reline
|
58
58
|
def ask_question_with_reline(prompt)
|
59
|
+
if prompt.start_with?("\n")
|
60
|
+
puts
|
61
|
+
prompt = prompt[1..]
|
62
|
+
end
|
63
|
+
|
59
64
|
answer = Reline.readline(prompt)
|
60
65
|
Reline::HISTORY.push(answer) unless answer.nil? || Reline::HISTORY.to_a.include?(answer)
|
61
66
|
answer
|
@@ -109,6 +114,12 @@ class AIA::Main
|
|
109
114
|
|
110
115
|
result = backend.run
|
111
116
|
|
117
|
+
if STDOUT == AIA.config.out_file
|
118
|
+
result = result.wrap(indent: 2)
|
119
|
+
end
|
120
|
+
|
121
|
+
# TODO: consider using glow to render markdown to
|
122
|
+
# terminal `brew install glow`
|
112
123
|
AIA.config.out_file.write result
|
113
124
|
|
114
125
|
logger.prompt_result(@prompt, result)
|
@@ -139,7 +150,7 @@ class AIA::Main
|
|
139
150
|
|
140
151
|
speak response
|
141
152
|
|
142
|
-
puts "\nResponse
|
153
|
+
puts "\nResponse:\n#{response.wrap(indent: 2)}"
|
143
154
|
logger.info "Response: #{backend.run}"
|
144
155
|
|
145
156
|
# TODO: Allow user to enter a directive; loop
|
data/lib/aia/prompt.rb
CHANGED
@@ -150,6 +150,11 @@ class AIA::Prompt
|
|
150
150
|
|
151
151
|
# Function to prompt the user with a question using reline
|
152
152
|
def ask_question_with_reline(prompt)
|
153
|
+
if prompt.start_with?("\n")
|
154
|
+
puts
|
155
|
+
prompt = prompt[1..]
|
156
|
+
end
|
157
|
+
|
153
158
|
answer = Reline.readline(prompt)
|
154
159
|
Reline::HISTORY.push(answer) unless answer.nil? || Reline::HISTORY.to_a.include?(answer)
|
155
160
|
answer
|
@@ -178,7 +183,7 @@ class AIA::Prompt
|
|
178
183
|
if default&.empty?
|
179
184
|
user_prompt = "\n-=> "
|
180
185
|
else
|
181
|
-
user_prompt = "\n(#{default}) -=>"
|
186
|
+
user_prompt = "\n(#{default}) -=> "
|
182
187
|
end
|
183
188
|
|
184
189
|
a_string = ask_question_with_reline(user_prompt)
|
data/main.just
CHANGED
@@ -14,6 +14,7 @@ with ~/.justfile
|
|
14
14
|
module repo /Users/dewayne/sandbox/git_repos/repo.just
|
15
15
|
module gem /Users/dewayne/sandbox/git_repos/gem.just
|
16
16
|
module version /Users/dewayne/just_modules/version.just
|
17
|
+
module git /Users/dewayne/just_modules/git.just
|
17
18
|
|
18
19
|
|
19
20
|
# Install Locally
|