aia 0.4.3 → 0.4.4
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/lib/aia/prompt.rb +12 -1
- 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: 84dc61c76d34c0a5c37db65b31c8412e3c81fb74b4aa33bf6550747601948727
|
4
|
+
data.tar.gz: 481d77b6a396f420f260c517d74b66406197002e5350808f22bb2182cf1beff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b241f244f12d35b26ebaec39eeedbf709784e49b3f5b3e79bbd3bbf636f7b2bdc225924fda305a99a366c1880b222b2b40de3c2fb4d9117c63183ae6e2e9a114
|
7
|
+
data.tar.gz: b9514f576ef22a7f828815cf50885014d64a7c4f1fa728fcfd2072b3a40708ec636aeb9fdc5cfd3fa7b9e0a6a39235690b6fea308dbf68c37b9c8492db75663c
|
data/.semver
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
## [Unreleased]
|
2
|
+
## [0.4.4] 2023-01-01
|
3
|
+
- fixed first issue of the year. Issue 14 with te --role option actually writing the role content into the prime prompts file.
|
4
|
+
|
2
5
|
## [0.4.3] 2023-12-31
|
3
6
|
- added --env to process embedded system environment variables and shell commands within a prompt.
|
4
7
|
- added --erb to process Embedded RuBy within a prompt because have embedded shell commands will only get you in a trouble. Having ERB will really get you into trouble. Remember the simple prompt is usually the best prompt.
|
data/lib/aia/prompt.rb
CHANGED
@@ -14,6 +14,7 @@ class AIA::Prompt
|
|
14
14
|
def path = '_fake_'
|
15
15
|
def keywords = []
|
16
16
|
def directives = []
|
17
|
+
def text = ''
|
17
18
|
def to_s = ''
|
18
19
|
end
|
19
20
|
|
@@ -32,6 +33,8 @@ class AIA::Prompt
|
|
32
33
|
end
|
33
34
|
|
34
35
|
get_prompt
|
36
|
+
|
37
|
+
@prompt_text_before_role = @prompt.text.dup
|
35
38
|
|
36
39
|
unless @role.nil?
|
37
40
|
@prompt.text.prepend @role.text
|
@@ -77,11 +80,19 @@ class AIA::Prompt
|
|
77
80
|
unless @prompt.keywords.empty?
|
78
81
|
replace_keywords
|
79
82
|
@prompt.build
|
80
|
-
@
|
83
|
+
save(@prompt_text_before_role)
|
81
84
|
end
|
82
85
|
end
|
83
86
|
|
84
87
|
|
88
|
+
def save(original_text)
|
89
|
+
temp_text = @prompt.text
|
90
|
+
@prompt.text = original_text
|
91
|
+
@prompt.save
|
92
|
+
@prompt.text = temp_text
|
93
|
+
end
|
94
|
+
|
95
|
+
|
85
96
|
# inserts environmant variables and dynamic content into a prompt
|
86
97
|
# replaces patterns like $HOME and ${HOME} with the value of ENV['HOME']
|
87
98
|
# replaces patterns like $(shell command) with the output of the shell command
|