aidp 0.49.17 → 0.49.18

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: 58a524647b6ac1b6ef0c819508de7693794689414d6f5bde4f1cba5cddf8799f
4
- data.tar.gz: 6c7da67512e7c04941c0afa6db927b348fcd9f31809526723a107b419ab91866
3
+ metadata.gz: 72094343c4cb811f45802e8bca991151f1217682bfe9924fdef242f8c8053004
4
+ data.tar.gz: 80c5d64fa5345ada2c37d957ad1fe9663a5311ae7a4643941c80aececcb1a2d3
5
5
  SHA512:
6
- metadata.gz: 56a49eaffe7e9f81e0fa4457634814622867fb335e54ac182b4fd31b05c3063ad726790c7376820101e6b57bd2b07c7b4ac6c3ac8b0f69220f248681a0ba8e65
7
- data.tar.gz: 610e7e0a8e151208fd5c623a3937974ec3cdab2ca72741d421bb6bab003cb6514ff8dc449d35f52c06ca0083dd3e40b2ef114a54269703137ed00cc95bfefe0b
6
+ metadata.gz: 369997eba3b55c78bc6319ea393e4a35a087fa019e7c8592147da40a0514ba859ce9cf74d5724b5a95e9805983fbb3de36cf3eb04623d7c75c645f3db7a77739
7
+ data.tar.gz: b0e5be3533c78df9ed64a68a1419547e6f73d1b25e601fc4b8f92215040f07224e69d92d771c44fd8196befa0b3a6313c61e7178ee1edea54205185e47fb926f
@@ -81,10 +81,26 @@ module Aidp
81
81
  build_commands.any? { |cmd| run_project_command(cmd) }
82
82
  end
83
83
 
84
- # Run a detected command in the project directory without building a
85
- # shell command string from the library-provided project path
84
+ # Run a detected command in the project directory. The command line is
85
+ # tokenized with Shellwords and executed in argument form, so the shell
86
+ # never interprets the library-provided command string. The [cmdname,
87
+ # argv0] pair forces argument form even for a single-token command,
88
+ # which system would otherwise execute via /bin/sh -c.
86
89
  def run_project_command(cmd)
87
- system(cmd, chdir: @project_dir, out: File::NULL, err: File::NULL)
90
+ require "shellwords"
91
+ argv = Shellwords.split(cmd).flat_map { |arg| expand_arg(arg) }
92
+ return false if argv.empty?
93
+
94
+ system([argv[0], argv[0]], *argv.drop(1), chdir: @project_dir, out: File::NULL, err: File::NULL)
95
+ end
96
+
97
+ # Expand shell-style glob tokens (e.g. test/**/*_test.rb) within the
98
+ # project directory, since argument-form execution skips shell globbing.
99
+ def expand_arg(arg)
100
+ return [arg] unless arg.match?(/[*?\[{}]/)
101
+
102
+ matches = Dir.chdir(@project_dir) { Dir.glob(arg) }
103
+ matches.empty? ? [arg] : matches
88
104
  end
89
105
 
90
106
  def documentation_complete?
data/lib/aidp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aidp
4
- VERSION = "0.49.17"
4
+ VERSION = "0.49.18"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aidp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.17
4
+ version: 0.49.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan