aia 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.semver +1 -1
  3. data/CHANGELOG.md +3 -0
  4. data/lib/aia/prompt.rb +12 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e8cad3b88bdc76e72dce9b7fa202923ab655f2da811039bf18df52c5fe714ae
4
- data.tar.gz: 57ae0a1dd04c0fbd237ba8daa3210ae273a8db21e0efe5c154ffbe72c9afd0e5
3
+ metadata.gz: 84dc61c76d34c0a5c37db65b31c8412e3c81fb74b4aa33bf6550747601948727
4
+ data.tar.gz: 481d77b6a396f420f260c517d74b66406197002e5350808f22bb2182cf1beff6
5
5
  SHA512:
6
- metadata.gz: 0cc90b667bd99aae7688231286c58ee3cc7a3ad4a1b4202c531a71113911d24c084f6ccce5d154d57e0059a2a0b3d6d1706f3ee9a5fae5bf229b2604d1982d4d
7
- data.tar.gz: 18dafdbfdeb257a2597f53070feebcb05f409f101b06ff17fdbe81cc813ebbf335833a0eace414638e437425ca47298b26655768890737cb065e3b15cfbf405e
6
+ metadata.gz: b241f244f12d35b26ebaec39eeedbf709784e49b3f5b3e79bbd3bbf636f7b2bdc225924fda305a99a366c1880b222b2b40de3c2fb4d9117c63183ae6e2e9a114
7
+ data.tar.gz: b9514f576ef22a7f828815cf50885014d64a7c4f1fa728fcfd2072b3a40708ec636aeb9fdc5cfd3fa7b9e0a6a39235690b6fea308dbf68c37b9c8492db75663c
data/.semver CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 4
4
- :patch: 3
4
+ :patch: 4
5
5
  :special: ''
6
6
  :metadata: ''
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
- @prompt.save
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer