elelem-tools 0.3.1 → 0.3.2

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: 10aa9e5c6d188839babb049a12bda733529bba33063b108b70127c8976efac55
4
- data.tar.gz: bd1256329222423cb5de4fe00319b439d505ac14533433f627c77d01a64a33ff
3
+ metadata.gz: bf04632fb0d1d8cfa052ede2d40d796339161312d9a8982881ae340cdc87e7d1
4
+ data.tar.gz: ab4a1b4db0f0fd1f79f3de38efd3d5650443438bd1912897d42dfe074c956e53
5
5
  SHA512:
6
- metadata.gz: 7ce98f45638a1a42c19a3daab5774b90a992e103bac2fe9342b58bc9c98e6d3600b9138d115e83adbf33157ff64a44d70151e5e3e09650b7cb4849ca76528c9c
7
- data.tar.gz: 1a52f22764dadb4a61bf709f560fb0f2161a6501d95f6804645ca98801283d203b7031010140f906798aea9cfbdb907240b9eff624b37eacc8ac9dffc729cadb
6
+ metadata.gz: e4d02d6c9d57b831fac8df017c3712491116f1b805ad97c352dd5785756ba769d3fa3b05c2ebb002345a59e5fa5e7566c0864eee7c3819611195c991f2ec3e5e
7
+ data.tar.gz: d92010fdf65d4b611d33f997fe0af5b661e00603f78b43a073f69adafebf241d3fb06cfb5ae30b7696b0db709d8300fbfc8a50eed4c8825799064e9af75ebdb7
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.1"
2
+ ".": "0.3.2"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2](https://github.com/elelem-sh/tools/compare/v0.3.1...v0.3.2) (2026-11-18)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * register git, glob, grep, list and verify only when execute runs in bash ([c59a754](https://github.com/elelem-sh/tools/commit/c59a754fa4b7e8b18db2893571dafd1a0794ab42))
9
+
3
10
  ## [0.3.1](https://github.com/elelem-sh/tools/compare/v0.3.0...v0.3.1) (2026-11-18)
4
11
 
5
12
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  Elelem.configure do |config|
4
4
  config.setup(:git) do |agent|
5
+ next unless Elelem::Builtins.shell == :bash
6
+
5
7
  agent.toolbox.add("git",
6
8
  description: "Run git command",
7
9
  params: { command: { type: "string" }, args: { type: "array", items: { type: "string" } } },
@@ -2,6 +2,8 @@
2
2
 
3
3
  Elelem.configure do |config|
4
4
  config.setup(:glob) do |agent|
5
+ next unless Elelem::Builtins.shell == :bash
6
+
5
7
  agent.toolbox.add("glob",
6
8
  description: "Find files matching pattern",
7
9
  params: { pattern: { type: "string" }, path: { type: "string" } },
@@ -2,6 +2,8 @@
2
2
 
3
3
  Elelem.configure do |config|
4
4
  config.setup(:grep) do |agent|
5
+ next unless Elelem::Builtins.shell == :bash
6
+
5
7
  agent.toolbox.add("grep",
6
8
  description: "Search file contents",
7
9
  params: { pattern: { type: "string" }, path: { type: "string" }, glob: { type: "string" } },
@@ -2,6 +2,8 @@
2
2
 
3
3
  Elelem.configure do |config|
4
4
  config.setup(:list) do |agent|
5
+ next unless Elelem::Builtins.shell == :bash
6
+
5
7
  agent.toolbox.add("list",
6
8
  description: "List directory contents",
7
9
  params: { path: { type: "string" }, recursive: { type: "boolean" } },
@@ -2,6 +2,8 @@
2
2
 
3
3
  Elelem.configure do |config|
4
4
  config.setup(:shell) do |agent|
5
+ next if Gem.win_platform?
6
+
5
7
  strip_ansi = lambda do |text|
6
8
  text
7
9
  .gsub(/^Script started.*?\n/, "")
@@ -30,6 +30,8 @@ end
30
30
 
31
31
  Elelem.configure do |config|
32
32
  config.setup(:verify) do |agent|
33
+ next unless Elelem::Builtins.shell == :bash
34
+
33
35
  agent.toolbox.add("verify",
34
36
  description: "Verify file syntax and run tests",
35
37
  params: { path: { type: "string" } },
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Elelem
4
4
  module Tools
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.2"
6
6
  end
7
7
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe "tools that need bash" do
4
+ def tool_names(shell)
5
+ allow(Elelem::Builtins).to receive(:shell).and_return(shell)
6
+ Elelem::Config.build_session("demo", input: Elelem::NullInput.new, output: Elelem::NullOutput.new)
7
+ .toolbox.to_a.map { |tool| tool.dig(:function, :name) }
8
+ end
9
+
10
+ it "are registered when execute runs in bash" do
11
+ expect(tool_names(:bash)).to include("git", "glob", "grep", "list", "verify", "edit", "execute")
12
+ end
13
+
14
+ it "are left out when execute runs in cmd.exe" do
15
+ names = tool_names(:cmd)
16
+
17
+ expect(names).not_to include("git", "glob", "grep", "list", "verify")
18
+ expect(names).to include("edit", "execute", "read", "write")
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elelem-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.13.1
18
+ version: 0.14.3
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1'
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 0.13.1
28
+ version: 0.14.3
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: '1'
@@ -100,6 +100,7 @@ files:
100
100
  - spec/elelem/tools/fallback_spec.rb
101
101
  - spec/elelem/tools/git_spec.rb
102
102
  - spec/elelem/tools/permissions_spec.rb
103
+ - spec/elelem/tools/shell_gate_spec.rb
103
104
  - spec/elelem/tools/verify_spec.rb
104
105
  - spec/spec_helper.rb
105
106
  - spec/support/session.rb