agentilda 2.0.0 → 2.0.1
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 +4 -4
- data/agentilda.gemspec +3 -1
- data/lib/agentilda/child.rb +16 -2
- data/lib/agentilda/cli/base.rb +24 -0
- data/lib/agentilda/version.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b707f3c9d7c48b2983152af1c7561480f1191a38b9d4998c28e8756dbf08c149
|
|
4
|
+
data.tar.gz: 40f6f8f9764077d3f0120a76e9d6963465f763d6c8092a178d49973e6597198b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 866812a595b01d7e57303414a8b91dc330498b87d117218119561d29420401ea252d6734e56dc34b0cdf07e85c9f81ea95e1ff2b295e0e332defc091f0a05ddc
|
|
7
|
+
data.tar.gz: c716f989842f5400829f9ab1be7dba8817cd09c2b07b27eb2cacb7680c8c366bfef7d20e7c9053dd69909181ac5ba730fd916a82f96e13ae90ac828b7fcb42c3
|
data/agentilda.gemspec
CHANGED
|
@@ -42,7 +42,9 @@ Gem::Specification.new do |spec|
|
|
|
42
42
|
spec.add_dependency "concurrent-ruby"
|
|
43
43
|
spec.add_dependency "dry-cli"
|
|
44
44
|
spec.add_dependency "dry-cli-autocomplete", "~> 0.5"
|
|
45
|
-
|
|
45
|
+
# 0.5.1 is the first release whose help screen survives `example [""]`,
|
|
46
|
+
# which four commands here declare.
|
|
47
|
+
spec.add_dependency "dry-cli-help", ">= 0.5.1", "< 0.6"
|
|
46
48
|
spec.add_dependency "dry-cli-ui", "~> 0.5"
|
|
47
49
|
spec.add_dependency "dry-inflector"
|
|
48
50
|
spec.add_dependency "dry-monads"
|
data/lib/agentilda/child.rb
CHANGED
|
@@ -18,13 +18,27 @@ module Agentilda
|
|
|
18
18
|
# @return [Agentilda::Child]
|
|
19
19
|
def self.spawn(argv, chdir: nil)
|
|
20
20
|
reader, writer = IO.pipe
|
|
21
|
-
options = { out: writer, err: writer, in: File::NULL }
|
|
21
|
+
options = { out: writer, err: writer, in: File::NULL, unsetenv_others: true }
|
|
22
22
|
options[:chdir] = chdir if chdir
|
|
23
|
-
pid = Process.spawn(*argv, **options)
|
|
23
|
+
pid = Process.spawn(environment, *argv, **options)
|
|
24
24
|
writer.close
|
|
25
25
|
new(pid:, reader:)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# The environment the child starts in: the one Bundler was loaded under,
|
|
29
|
+
# less what Bundler itself put there. `exe/agentilda` pins `BUNDLE_GEMFILE`
|
|
30
|
+
# to its own Gemfile and `bundler/setup` adds `-rbundler/setup` to
|
|
31
|
+
# `RUBYOPT`; a child that inherited them would run every `bundle exec`,
|
|
32
|
+
# `standardrb` and `alock` against the harness's checkout instead of the
|
|
33
|
+
# worktree it was handed, and be told the gems that worktree's Gemfile adds
|
|
34
|
+
# are "not currently included in the bundle". Bundler knows exactly what it
|
|
35
|
+
# changed, so it is asked; without Bundler there is nothing to strip.
|
|
36
|
+
#
|
|
37
|
+
# @return [Hash{String => String}]
|
|
38
|
+
def self.environment
|
|
39
|
+
defined?(::Bundler) ? ::Bundler.unbundled_env : ENV.to_h
|
|
40
|
+
end
|
|
41
|
+
|
|
28
42
|
# @param pid [Integer]
|
|
29
43
|
# @param reader [IO]
|
|
30
44
|
def initialize(pid:, reader:)
|
data/lib/agentilda/cli/base.rb
CHANGED
|
@@ -11,8 +11,32 @@ module Agentilda
|
|
|
11
11
|
# Values of AGENTILDA_AUTOCOMMIT that turn it on.
|
|
12
12
|
AUTOCOMMIT = %w[true yes 1].freeze
|
|
13
13
|
|
|
14
|
+
# dry-cli gathers every token a command did not declare an argument for
|
|
15
|
+
# into :args, and hands it over without a word. `tilda docs
|
|
16
|
+
# .plans/README.md` — the `-o` forgotten — therefore ran with every
|
|
17
|
+
# default, wrote the conventions to the default path, and printed
|
|
18
|
+
# success for a file the caller never named.
|
|
19
|
+
#
|
|
20
|
+
# Prepended rather than called from each `call`, because the command
|
|
21
|
+
# that forgets this check is the one that needed it.
|
|
22
|
+
module RefuseStrayArguments
|
|
23
|
+
# @param options [Hash]
|
|
24
|
+
# @return [void]
|
|
25
|
+
def call(**options)
|
|
26
|
+
stray = Array(options[:args]) - self.class.arguments.flat_map { Array(options[it.name.to_sym]) }
|
|
27
|
+
unless stray.empty?
|
|
28
|
+
refuse("This command takes no argument like #{stray.join(" ")}.\n" \
|
|
29
|
+
"An option it does take may be the one you meant: run it with -h.",
|
|
30
|
+
64)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
super
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
14
37
|
def self.inherited(klass)
|
|
15
38
|
super
|
|
39
|
+
klass.prepend(RefuseStrayArguments)
|
|
16
40
|
klass.option :dir,
|
|
17
41
|
default: Agentilda::PLANS_DIR,
|
|
18
42
|
aliases: ["-D"],
|
data/lib/agentilda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: agentilda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Gredeskoul
|
|
@@ -69,16 +69,22 @@ dependencies:
|
|
|
69
69
|
name: dry-cli-help
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
|
-
- - "
|
|
72
|
+
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version:
|
|
74
|
+
version: 0.5.1
|
|
75
|
+
- - "<"
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0.6'
|
|
75
78
|
type: :runtime
|
|
76
79
|
prerelease: false
|
|
77
80
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
81
|
requirements:
|
|
79
|
-
- - "
|
|
82
|
+
- - ">="
|
|
80
83
|
- !ruby/object:Gem::Version
|
|
81
|
-
version:
|
|
84
|
+
version: 0.5.1
|
|
85
|
+
- - "<"
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '0.6'
|
|
82
88
|
- !ruby/object:Gem::Dependency
|
|
83
89
|
name: dry-cli-ui
|
|
84
90
|
requirement: !ruby/object:Gem::Requirement
|