prompt_manager 0.5.5 → 0.5.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5163d8125c7442be07115fd1fb8a20c143f28a05bd6cf9918ff987893ddb3ba9
4
- data.tar.gz: 5b5135be217b02f326c415d0a0eb902eadd57f3621b0787346ee2e0a38b6a419
3
+ metadata.gz: 7e471d6dde897f90fcedcabaacdd7a2fb78528b43f73812382b88da07ff655ef
4
+ data.tar.gz: d077a281f07a40eae6ab59caa06278d175abb42855088ccf98659fc97e95a003
5
5
  SHA512:
6
- metadata.gz: 71a5744768aad0b1459d8b1dd0043070ec69f871e2723dff0ca1720c55f0d2aaa1a6080b4f00f6ee3eaa770872fa5cbf267b9a89a6cefdb3b5321a06192a942a
7
- data.tar.gz: 9a711c31b0a1029e2561bb5c0b2debe6239e5ed036ce49861c939bd56db8190b4d34e498d269ceb7556adf7bed500c47a0d52e65921a08558013479f7f14dc6c
6
+ metadata.gz: bdb1c938936daa947678e48c27f55b4e7e66d05d2fbe791db4e45a3da94aebda1cdb2a7bb8f303e36b1d5c97a704d6a0588d2c852c6fd1e6c5f7c20ca1dabe6b
7
+ data.tar.gz: 83395ce83ea16edab586f36fec2e04370c573324053bb2cc0f59e81f0c3188a51408ac08b23ecfd095d7412a256ef264f713c1965ca6ac1cb014902e8814f5fb
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
3
  ## Released
4
+ ### [0.5.6] = 2025-06-04
5
+ - fixed a problem where shell integration was not working correctly for $(shell command)
6
+
4
7
  ### [0.5.5] = 2025-05-21
5
8
  - fixed bug in parameter substitution when value is an Array now uses last entry
6
9
 
@@ -159,6 +159,21 @@ class PromptManager::Prompt
159
159
  def substitute_env_vars(input_text)
160
160
  return input_text unless envar?
161
161
 
162
+ # First, handle shell command substitution $(command)
163
+ input_text = input_text.gsub(/\$\(([^\)]+)\)/) do |match|
164
+ cmd = $1.strip
165
+ begin
166
+ # Execute the shell command and capture its output
167
+ result = `#{cmd}`.chomp
168
+ result.empty? ? match : result
169
+ rescue => e
170
+ # If command execution fails, log the error and keep the original text
171
+ warn "Shell command execution failed: #{e.message}"
172
+ match
173
+ end
174
+ end
175
+
176
+ # Then handle environment variables as before
162
177
  input_text.gsub(/\$(\w+)|\$\{(\w+)\}/) do |match|
163
178
  env_var = $1 || $2
164
179
  ENV[env_var] || match
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PromptManager
4
- VERSION = "0.5.5"
4
+ VERSION = "0.5.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prompt_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer