rake-osc7501 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +19 -0
- data/CONTRIBUTING.md +19 -6
- data/README.md +26 -17
- data/lib/rake/osc7501/hooks.rb +27 -2
- data/lib/rake/osc7501/rspec_task.rb +26 -7
- data/lib/rake/osc7501/run.rb +3 -2
- data/lib/rake/osc7501/version.rb +1 -1
- data/lib/rake/osc7501/writer.rb +4 -13
- data/lib/rake/osc7501.rb +5 -0
- data/sig/rake/osc7501/hooks.rbs +45 -0
- data/sig/rake/osc7501/rspec_task.rbs +35 -0
- data/sig/rake/osc7501/run.rbs +48 -0
- data/sig/rake/osc7501/version.rbs +7 -0
- data/sig/rake/osc7501/writer.rbs +29 -0
- data/sig/rake/osc7501.rbs +11 -0
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ec4d24e91dfcf5e1fc81da1a23945ea6782ad3ea8de3f042e7e7ba0db5ae61e
|
|
4
|
+
data.tar.gz: 611c5cd0014c4c19b20b6dea23ece1be35826438ec8846fed4a070341541d801
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2edae9f21fac815f594a72940145e420a466c691c1a37a8abeeb882c62bcbc6eb83ef439138da26105a05760ea53efe4ac0882d14fcf3ebcb209adc5cf894165
|
|
7
|
+
data.tar.gz: a3c2a55f578791cbb038d1f6cedf0b57c304cfc363de2a0b2bb0161158318745158a1e0cdc6708eef2b0b2d60d40d4e326f6d16bd17d5ed0a0d0ce7b671fa953
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.2 - 2026-11-13
|
|
6
|
+
|
|
7
|
+
- Enable OSC reporting for direct RSpec runs ([ac72e7d](https://github.com/cosgroveb/rake-osc7501/commit/ac72e7db42be722561b4673f3de3ecb1ef2f9422))
|
|
8
|
+
- Check Ruby implementations against inline RBS ([4ec47b3](https://github.com/cosgroveb/rake-osc7501/commit/4ec47b379bc1396efaec97a5b824d9b4abb80277))
|
|
9
|
+
- Package generated runtime RBS signatures ([ecfcad0](https://github.com/cosgroveb/rake-osc7501/commit/ecfcad06a510bde0d6fab00580a92f0a6f845701))
|
|
10
|
+
- Build compatibility gems without type tooling ([784efd3](https://github.com/cosgroveb/rake-osc7501/commit/784efd35d2ba7e49bd3f12600196512f95fa0086))
|
|
11
|
+
- Bump actions/download-artifact from 4.3.0 to 8.0.2 ([5b2445b](https://github.com/cosgroveb/rake-osc7501/commit/5b2445be7bcfa8d563efbd42b91e759d3e9eaf8c))
|
|
12
|
+
- Bump actions/upload-artifact from 4.6.2 to 7.0.2 ([f4c30a5](https://github.com/cosgroveb/rake-osc7501/commit/f4c30a59b917398fe54e0d7a251d16081a8365bc))
|
|
13
|
+
- Install RSpec reporting after loading the Rakefile ([c35a24a](https://github.com/cosgroveb/rake-osc7501/commit/c35a24a330fa0ef62d2d1224ca6be9dff6da4c27))
|
|
14
|
+
|
|
15
|
+
## 0.1.1 - 2026-11-12
|
|
16
|
+
|
|
17
|
+
- Preserve release failure diagnostics on retries ([5e89c7b](https://github.com/cosgroveb/rake-osc7501/commit/5e89c7b0f84a9ed45342b4f5e5d8154f309f6b67))
|
|
18
|
+
- Declare the RubyGems owner during OIDC exchange ([841eb7e](https://github.com/cosgroveb/rake-osc7501/commit/841eb7e606759b81bdd61241aec11da221ae41c4))
|
|
19
|
+
- Verify existing release tags directly ([6635c10](https://github.com/cosgroveb/rake-osc7501/commit/6635c10844d95bf77f4fa60fa9b0a3e9a6869d62))
|
|
20
|
+
- Use the released RSpec companion ([907ec9e](https://github.com/cosgroveb/rake-osc7501/commit/907ec9eddbe66b438e5ecb465ffaa7141696df91))
|
|
21
|
+
- Simplify development setup and test pure Rake ([68bee02](https://github.com/cosgroveb/rake-osc7501/commit/68bee02f0871332ae2a0dc198c96ede852061b8d))
|
|
22
|
+
- Report Rake runs through the root record ([d1dcd42](https://github.com/cosgroveb/rake-osc7501/commit/d1dcd42bce0cd87100b6733742a77e52d1be3c7e))
|
|
23
|
+
|
|
5
24
|
## 0.1.0 - 2026-11-11
|
|
6
25
|
|
|
7
26
|
- Report Rake tasks and managed RSpec progress ([0245b76](https://github.com/cosgroveb/rake-osc7501/commit/0245b76c4f88f18b416e20fccc62f84cfa8b3239))
|
data/CONTRIBUTING.md
CHANGED
|
@@ -17,20 +17,27 @@ bundle exec rake
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
The default task runs RuboCop with rubocop-rspec, bundler-audit, actionlint,
|
|
20
|
-
inline RBS checks, specs, installed-gem smoke tests and RDoc. Run `bundle exec rake lint`, `audit`, `workflows`,
|
|
20
|
+
inline RBS checks, specs, installed-gem smoke tests and RDoc. Run `bundle exec rake lint`, `audit`, `workflows`, `types`,
|
|
21
21
|
or `spec` for individual checks. RuboCop applies default style rules to release tooling and build configuration,
|
|
22
22
|
and correctness cops to existing runtime code, fixtures and smoke tests.
|
|
23
23
|
Scoped exclusions preserve Ruby 2.1 support and exception propagation. Do not add a TODO baseline. Dependency auditing checks the
|
|
24
24
|
lockfile generated by `bundle install`. Keep that lockfile out of commits.
|
|
25
25
|
|
|
26
|
+
`rake types` uses Steep to check runtime and tooling implementations in `lib/`
|
|
27
|
+
and `script/` against generated inline signatures. Specs and build configuration
|
|
28
|
+
receive annotation and signature validation only. Keep project types inline.
|
|
29
|
+
`sig/dependencies.rbs` fills gaps in dependency signatures, and generated files
|
|
30
|
+
stay in ignored `tmp/`.
|
|
31
|
+
|
|
26
32
|
Specs run in random order and report their seed. Reproduce an ordering failure
|
|
27
33
|
with `bundle exec rspec --seed <seed>` and narrow it with
|
|
28
34
|
`bundle exec rspec --seed <seed> --bisect`. Generated subprocess fixtures keep a
|
|
29
35
|
defined order because their interrupt and fail-fast cases depend on sequence.
|
|
30
36
|
|
|
31
|
-
Keep runtime dependencies limited to `rake`. Cover task lifecycle behavior with real Rake subprocesses.
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
Keep runtime dependencies limited to `rake`. Cover task lifecycle behavior with real Rake subprocesses.
|
|
38
|
+
The normal development bundle includes `rspec-osc7501`, so `bundle exec rake spec`
|
|
39
|
+
also checks paired reporting. Set `RSPEC_OSC7501_PATH` before `bundle install` to
|
|
40
|
+
use a local companion checkout.
|
|
34
41
|
|
|
35
42
|
Build the gem and documentation:
|
|
36
43
|
|
|
@@ -41,9 +48,13 @@ bundle exec rake rdoc
|
|
|
41
48
|
```
|
|
42
49
|
|
|
43
50
|
The package is `pkg/rake-osc7501-<version>.gem`. Open `tmp/rdoc/index.html` to check
|
|
44
|
-
rendered documentation.
|
|
51
|
+
rendered documentation. `rake package` generates runtime RBS from `lib/` into
|
|
52
|
+
`pkg/rake-osc7501-<version>/sig/` and includes it in the gem for type tools to
|
|
53
|
+
discover by gem name. Keep generated files out of commits.
|
|
45
54
|
The smoke task builds and installs the gem in a temporary directory, then checks
|
|
46
55
|
passing and failing tasks without loading the checkout's library.
|
|
56
|
+
The `pure-rake` CI job runs this check with only Rake and the built gem installed
|
|
57
|
+
in the isolated directory, and rejects any installed RSpec gems.
|
|
47
58
|
|
|
48
59
|
## Runtime compatibility
|
|
49
60
|
|
|
@@ -57,13 +68,15 @@ export BUNDLE_GEMFILE=Gemfile.compat
|
|
|
57
68
|
export RSPEC_MINOR=3.6
|
|
58
69
|
export RSPEC_CORE_VERSION=3.6.0
|
|
59
70
|
bundle install
|
|
60
|
-
bundle exec rspec spec/rake
|
|
71
|
+
bundle exec rspec --options '' spec/rake
|
|
61
72
|
bundle exec gem build rake-osc7501.gemspec
|
|
62
73
|
bundle exec ruby script/smoke.rb rake-osc7501-*.gem
|
|
63
74
|
```
|
|
64
75
|
|
|
65
76
|
Remove `Gemfile.compat.lock` before changing RSpec versions. Keep it out of commits.
|
|
66
77
|
The compatibility bundle pins diff-lcs 1.3 so test dependencies install on Ruby 2.1.
|
|
78
|
+
These bare `gem build` checks omit generated signatures and need no type tooling.
|
|
79
|
+
Use the modern development bundle and `rake package` for distribution builds.
|
|
67
80
|
CI checks the oldest Ruby against both RSpec endpoints, the oldest RSpec on modern
|
|
68
81
|
Ruby, and the Debian Bullseye and Bookworm version families. These jobs run the
|
|
69
82
|
runtime suite and installed-gem smoke checks. Modern jobs also test release
|
data/README.md
CHANGED
|
@@ -15,18 +15,17 @@ task(:example) { sleep 5 }
|
|
|
15
15
|
task default: :example
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Run `bundle exec rake`. A supporting terminal receives
|
|
19
|
-
with task activity and the command's outcome.
|
|
18
|
+
Run `bundle exec rake`. A supporting terminal receives the overall Rake run as
|
|
19
|
+
its root record, with task activity and the command's outcome. Each new Rake
|
|
20
|
+
run replaces that root record. Ordinary command output continues.
|
|
20
21
|
Rake-only projects need no RSpec dependencies.
|
|
21
22
|
|
|
22
23
|
## RSpec tasks
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
Until a gem release includes it, pin the reviewed companion commit in your Gemfile:
|
|
25
|
+
Add `rspec-osc7501` 0.1.4 or newer for managed child reporting:
|
|
26
26
|
|
|
27
27
|
```ruby
|
|
28
|
-
gem 'rspec-osc7501',
|
|
29
|
-
ref: '098bb55433dd05265910995b2c349e4db99869bb'
|
|
28
|
+
gem 'rspec-osc7501', '>= 0.1.4'
|
|
30
29
|
```
|
|
31
30
|
|
|
32
31
|
Run `bundle install`, then load the standard RSpec task class before this integration:
|
|
@@ -41,13 +40,17 @@ task default: [:example, :spec]
|
|
|
41
40
|
```
|
|
42
41
|
|
|
43
42
|
Existing and later-created standard tasks receive a unique child record for each
|
|
44
|
-
invocation.
|
|
43
|
+
invocation. Child records keep their own identities, so each new Rake run
|
|
44
|
+
replaces only the root record and previously finished children may remain until
|
|
45
|
+
the terminal retires them.
|
|
46
|
+
Automatic selection preserves RSpec's default progress formatter and
|
|
45
47
|
configured formatters, including their output files. An explicit OSC formatter
|
|
46
48
|
keeps its destination and receives no duplicate.
|
|
47
49
|
|
|
48
50
|
Missing or older `rspec-osc7501` installations without `rspec/osc7501/managed.rb`
|
|
49
|
-
leave the original RSpec command intact.
|
|
50
|
-
|
|
51
|
+
leave the original RSpec command intact. Either require order works when RSpec's
|
|
52
|
+
Rake tasks are loaded before top-level execution. Custom runners receive generic
|
|
53
|
+
Rake reporting. Direct `rspec` commands still need explicit OSC
|
|
51
54
|
formatter selection.
|
|
52
55
|
|
|
53
56
|
The adapter passes child context through the spawn environment. It preserves
|
|
@@ -99,22 +102,28 @@ Runtime targets MRI Ruby >= 2.1 and Rake >= 12.3.3. The optional adapter targets
|
|
|
99
102
|
RSpec >= 3.6. The oldest paired check uses Ruby 2.1.10, Rake 12.3.3 and RSpec 3.6.0.
|
|
100
103
|
Linux checks also cover Ruby 2.7, 3.1, 3.3, 3.4 and 4.0 with compatible RSpec
|
|
101
104
|
versions, including RSpec 4.0.0.beta1 on Ruby 4.0. RSpec 3.6 has no
|
|
102
|
-
clean-environment option.
|
|
105
|
+
clean-environment option. CI also checks macOS with Ruby 3.4.
|
|
106
|
+
Other Ruby engines are unverified.
|
|
103
107
|
|
|
104
108
|
On modern Ruby:
|
|
105
109
|
|
|
106
110
|
```sh
|
|
107
111
|
bundle install
|
|
108
112
|
bundle exec rake
|
|
109
|
-
|
|
110
|
-
BUNDLE_GEMFILE=Gemfile.integration bundle exec rake spec
|
|
111
|
-
bundle exec ruby script/smoke.rb pkg/rake-osc7501-*.gem
|
|
113
|
+
bundle exec rake spec
|
|
112
114
|
```
|
|
113
115
|
|
|
116
|
+
The development bundle includes the RSpec companion, so the normal suite exercises
|
|
117
|
+
both reporters. The `pure-rake` CI job checks passing and failing tasks with only
|
|
118
|
+
Rake and the built gem installed in an isolated gem directory.
|
|
119
|
+
Set `RSPEC_OSC7501_PATH` to test a local companion checkout instead of the released gem.
|
|
120
|
+
|
|
114
121
|
`rake types` checks method annotation coverage across authored Ruby files,
|
|
115
|
-
generates inline RBS
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
generates inline RBS, and uses Steep to check implementations in `lib/` and
|
|
123
|
+
`script/` against their signatures. Specs and build configuration receive
|
|
124
|
+
annotation and signature validation, not implementation checking.
|
|
125
|
+
Generated project signatures stay in ignored `tmp/`. `sig/dependencies.rbs`
|
|
126
|
+
supplies missing dependency declarations. See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
127
|
+
for lint, dependency audit, workflow checks and release setup. Compatibility checks use `Gemfile.compat`
|
|
119
128
|
without type tooling. Pass an RSpec gem package as the smoke script's second
|
|
120
129
|
argument to check installed parent/child reporting.
|
data/lib/rake/osc7501/hooks.rb
CHANGED
|
@@ -2,7 +2,29 @@
|
|
|
2
2
|
# rbs_inline: enabled
|
|
3
3
|
|
|
4
4
|
module Rake
|
|
5
|
+
# @rbs!
|
|
6
|
+
# class Application
|
|
7
|
+
# include OSC7501::ApplicationHook
|
|
8
|
+
# end
|
|
9
|
+
|
|
5
10
|
module OSC7501
|
|
11
|
+
# @rbs!
|
|
12
|
+
# interface _Application
|
|
13
|
+
# def options: () -> _Options
|
|
14
|
+
# def top_level: () -> Object
|
|
15
|
+
# end
|
|
16
|
+
# interface _Options
|
|
17
|
+
# def show_tasks: () -> (:tasks | :describe | :lines)?
|
|
18
|
+
# def show_prereqs: () -> bool
|
|
19
|
+
# def dryrun: () -> bool
|
|
20
|
+
# end
|
|
21
|
+
# interface _Task
|
|
22
|
+
# def name: () -> String
|
|
23
|
+
# def application: () -> ::Rake::Application
|
|
24
|
+
# def execute: (?Object) ?{ (*Object) -> Object } -> Object
|
|
25
|
+
# end
|
|
26
|
+
|
|
27
|
+
# @rbs module-self _Application
|
|
6
28
|
module ApplicationHook
|
|
7
29
|
attr_reader :osc7501_run #: Run?
|
|
8
30
|
|
|
@@ -10,16 +32,19 @@ module Rake
|
|
|
10
32
|
def top_level
|
|
11
33
|
return super if options.show_tasks || options.show_prereqs || options.dryrun
|
|
12
34
|
|
|
35
|
+
OSC7501.install_rspec!
|
|
13
36
|
previous = @osc7501_run
|
|
14
37
|
begin
|
|
15
|
-
|
|
16
|
-
@osc7501_run
|
|
38
|
+
run = Run.new($stdout, mode: ENV.fetch('RAKE_OSC7501', 'auto'))
|
|
39
|
+
@osc7501_run = run
|
|
40
|
+
run.during_run { super }
|
|
17
41
|
ensure
|
|
18
42
|
@osc7501_run = previous
|
|
19
43
|
end
|
|
20
44
|
end
|
|
21
45
|
end
|
|
22
46
|
|
|
47
|
+
# @rbs module-self _Task
|
|
23
48
|
module TaskHook
|
|
24
49
|
#: (?Object args) ?{ (*Object) -> Object } -> Object
|
|
25
50
|
def execute(args = nil, &block)
|
|
@@ -5,7 +5,16 @@ require 'shellwords'
|
|
|
5
5
|
|
|
6
6
|
module Rake
|
|
7
7
|
module OSC7501
|
|
8
|
+
# @rbs!
|
|
9
|
+
# interface _RSpecRakeTask
|
|
10
|
+
# def run_task: (bool) -> Object
|
|
11
|
+
# def ruby_opts: () -> (String | Array[String] | nil)
|
|
12
|
+
# def rspec_path: () -> String
|
|
13
|
+
# def system: (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
|
|
14
|
+
# end
|
|
15
|
+
|
|
8
16
|
# Wrap only the standard RSpec task's launch; keep its status handling intact.
|
|
17
|
+
# @rbs module-self _RSpecRakeTask
|
|
9
18
|
module RSpecTask
|
|
10
19
|
# @rbs @osc7501_context: [String, String]?
|
|
11
20
|
|
|
@@ -15,7 +24,7 @@ module Rake
|
|
|
15
24
|
begin
|
|
16
25
|
run = Rake.application.osc7501_run if Rake.application.respond_to?(:osc7501_run)
|
|
17
26
|
path = managed_path if run && run.managed_children?
|
|
18
|
-
@osc7501_context = path ? [run.next_child_id, path] : nil
|
|
27
|
+
@osc7501_context = path && run ? [run.next_child_id, path] : nil
|
|
19
28
|
super
|
|
20
29
|
ensure
|
|
21
30
|
@osc7501_context = previous
|
|
@@ -25,9 +34,11 @@ module Rake
|
|
|
25
34
|
#: () -> (String | Array[String] | nil)
|
|
26
35
|
def ruby_opts
|
|
27
36
|
options = super
|
|
28
|
-
|
|
37
|
+
context = @osc7501_context
|
|
38
|
+
return options unless context
|
|
29
39
|
|
|
30
|
-
[
|
|
40
|
+
options = [options] if options.is_a?(String)
|
|
41
|
+
(options || []) + ["-r#{Shellwords.escape(context.last)}"]
|
|
31
42
|
end
|
|
32
43
|
|
|
33
44
|
private
|
|
@@ -43,12 +54,20 @@ module Rake
|
|
|
43
54
|
path if File.file?(path)
|
|
44
55
|
end
|
|
45
56
|
|
|
46
|
-
#: (*
|
|
57
|
+
#: (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
|
|
47
58
|
def system(*arguments)
|
|
48
|
-
|
|
59
|
+
context = @osc7501_context
|
|
60
|
+
return super unless context
|
|
49
61
|
|
|
50
|
-
environment
|
|
51
|
-
|
|
62
|
+
# @type var environment: Hash[String, String?]
|
|
63
|
+
first = arguments.first
|
|
64
|
+
if first.is_a?(Hash)
|
|
65
|
+
arguments.shift
|
|
66
|
+
environment = first.dup
|
|
67
|
+
else
|
|
68
|
+
environment = {}
|
|
69
|
+
end
|
|
70
|
+
environment['RSPEC_OSC7501_ID'] = context.first
|
|
52
71
|
%w[RSPEC_OSC7501 RSPEC_OSC7501_TITLE TERM].each do |key|
|
|
53
72
|
environment[key] = ENV[key] if ENV.key?(key) && !environment.key?(key)
|
|
54
73
|
end
|
data/lib/rake/osc7501/run.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Rake
|
|
|
24
24
|
def initialize(output, mode:)
|
|
25
25
|
@mode = mode
|
|
26
26
|
@id = "rake-#{Process.pid}-#{SecureRandom.hex(6)}"
|
|
27
|
-
@writer = Writer.new(output, mode: mode
|
|
27
|
+
@writer = Writer.new(output, mode: mode)
|
|
28
28
|
@finished = false
|
|
29
29
|
@active = []
|
|
30
30
|
@counter = 0
|
|
@@ -53,7 +53,8 @@ module Rake
|
|
|
53
53
|
yield
|
|
54
54
|
ensure
|
|
55
55
|
@mutex.synchronize do
|
|
56
|
-
@active.
|
|
56
|
+
index = @active.rindex(task) #: Integer
|
|
57
|
+
@active.delete_at(index)
|
|
57
58
|
report_active
|
|
58
59
|
end
|
|
59
60
|
end
|
data/lib/rake/osc7501/version.rb
CHANGED
data/lib/rake/osc7501/writer.rb
CHANGED
|
@@ -5,22 +5,14 @@ module Rake
|
|
|
5
5
|
module OSC7501
|
|
6
6
|
class Writer # :nodoc: all
|
|
7
7
|
# @rbs @output: IO | StringIO
|
|
8
|
-
# @rbs @id: String
|
|
9
8
|
# @rbs @enabled: bool
|
|
10
|
-
#: (String?) -> bool
|
|
11
|
-
def self.valid_id?(id)
|
|
12
|
-
id.is_a?(String) && id.ascii_only? && id.bytesize <= 128 &&
|
|
13
|
-
!!(id =~ %r{\A[A-Za-z0-9_.+-]{1,32}(?:/[A-Za-z0-9_.+-]{1,32}){0,7}\z})
|
|
14
|
-
end
|
|
15
9
|
|
|
16
|
-
#: (IO | StringIO output, mode: String
|
|
17
|
-
def initialize(output, mode
|
|
10
|
+
#: (IO | StringIO output, mode: String) -> void
|
|
11
|
+
def initialize(output, mode:)
|
|
18
12
|
raise ArgumentError, 'RAKE_OSC7501 must be auto, off, or force' unless %w[auto off force].include?(mode)
|
|
19
13
|
|
|
20
14
|
@output = output
|
|
21
|
-
@
|
|
22
|
-
@enabled = self.class.valid_id?(id) &&
|
|
23
|
-
(mode == 'force' || (mode == 'auto' && automatic_output?))
|
|
15
|
+
@enabled = mode == 'force' || (mode == 'auto' && automatic_output?)
|
|
24
16
|
rescue IOError, SystemCallError
|
|
25
17
|
@enabled = false
|
|
26
18
|
end
|
|
@@ -30,7 +22,6 @@ module Rake
|
|
|
30
22
|
return unless @enabled
|
|
31
23
|
|
|
32
24
|
fields = ['app=rake', 'title=UmFrZQ==', "state=#{state}", "msg=#{encode(msg, 2048)}"]
|
|
33
|
-
fields << "id=#{@id}" if @id
|
|
34
25
|
@output.write("\e]7501;#{fields.join(':')}\e\\")
|
|
35
26
|
@output.flush if @output.respond_to?(:flush)
|
|
36
27
|
rescue IOError, SystemCallError
|
|
@@ -46,7 +37,7 @@ module Rake
|
|
|
46
37
|
|
|
47
38
|
#: (String, Integer) -> String
|
|
48
39
|
def encode(text, byte_limit)
|
|
49
|
-
input = text.to_s.byteslice(0, sanitization_byte_limit(byte_limit))
|
|
40
|
+
input = text.to_s.byteslice(0, sanitization_byte_limit(byte_limit)) #: String
|
|
50
41
|
clean = input.encode('UTF-8', invalid: :replace, undef: :replace).gsub(/[\u0000-\u001F\u007F-\u009F]/, '')
|
|
51
42
|
bytes = 0
|
|
52
43
|
bounded = clean.each_char.take_while do |char|
|
data/lib/rake/osc7501.rb
CHANGED
|
@@ -13,6 +13,11 @@ module Rake
|
|
|
13
13
|
def self.install!(application = Rake.application)
|
|
14
14
|
application.extend(ApplicationHook) unless application.is_a?(ApplicationHook)
|
|
15
15
|
Rake::Task.prepend(TaskHook) unless Rake::Task.ancestors.include?(TaskHook)
|
|
16
|
+
install_rspec!
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
#: () -> void
|
|
20
|
+
def self.install_rspec!
|
|
16
21
|
return unless defined?(RSpec::Core::RakeTask)
|
|
17
22
|
|
|
18
23
|
require_relative 'osc7501/rspec_task'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Generated from lib/rake/osc7501/hooks.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Rake
|
|
4
|
+
class Application
|
|
5
|
+
include OSC7501::ApplicationHook
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
module OSC7501
|
|
9
|
+
interface _Application
|
|
10
|
+
def options: () -> _Options
|
|
11
|
+
|
|
12
|
+
def top_level: () -> Object
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
interface _Options
|
|
16
|
+
def show_tasks: () -> (:tasks | :describe | :lines)?
|
|
17
|
+
|
|
18
|
+
def show_prereqs: () -> bool
|
|
19
|
+
|
|
20
|
+
def dryrun: () -> bool
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
interface _Task
|
|
24
|
+
def name: () -> String
|
|
25
|
+
|
|
26
|
+
def application: () -> ::Rake::Application
|
|
27
|
+
|
|
28
|
+
def execute: (?Object) ?{ (*Object) -> Object } -> Object
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# @rbs module-self _Application
|
|
32
|
+
module ApplicationHook : _Application
|
|
33
|
+
attr_reader osc7501_run: Run?
|
|
34
|
+
|
|
35
|
+
# : () -> Object
|
|
36
|
+
def top_level: () -> Object
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# @rbs module-self _Task
|
|
40
|
+
module TaskHook : _Task
|
|
41
|
+
# : (?Object args) ?{ (*Object) -> Object } -> Object
|
|
42
|
+
def execute: (?Object args) ?{ (*Object) -> Object } -> Object
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Generated from lib/rake/osc7501/rspec_task.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Rake
|
|
4
|
+
module OSC7501
|
|
5
|
+
interface _RSpecRakeTask
|
|
6
|
+
def run_task: (bool) -> Object
|
|
7
|
+
|
|
8
|
+
def ruby_opts: () -> (String | Array[String] | nil)
|
|
9
|
+
|
|
10
|
+
def rspec_path: () -> String
|
|
11
|
+
|
|
12
|
+
def system: (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Wrap only the standard RSpec task's launch; keep its status handling intact.
|
|
16
|
+
# @rbs module-self _RSpecRakeTask
|
|
17
|
+
module RSpecTask : _RSpecRakeTask
|
|
18
|
+
@osc7501_context: [ String, String ]?
|
|
19
|
+
|
|
20
|
+
# : (bool) -> Object
|
|
21
|
+
def run_task: (bool) -> Object
|
|
22
|
+
|
|
23
|
+
# : () -> (String | Array[String] | nil)
|
|
24
|
+
def ruby_opts: () -> (String | Array[String] | nil)
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
# : () -> String?
|
|
29
|
+
def managed_path: () -> String?
|
|
30
|
+
|
|
31
|
+
# : (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
|
|
32
|
+
def system: (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Generated from lib/rake/osc7501/run.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Rake
|
|
4
|
+
module OSC7501
|
|
5
|
+
interface _TaskName
|
|
6
|
+
def name: () -> String
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class Run
|
|
10
|
+
@active: Array[_TaskName]
|
|
11
|
+
|
|
12
|
+
@counter: Integer
|
|
13
|
+
|
|
14
|
+
@mutex: Mutex
|
|
15
|
+
|
|
16
|
+
@id: String
|
|
17
|
+
|
|
18
|
+
@writer: Writer
|
|
19
|
+
|
|
20
|
+
@mode: String
|
|
21
|
+
|
|
22
|
+
@finished: bool
|
|
23
|
+
|
|
24
|
+
# : (IO | StringIO output, mode: String) -> void
|
|
25
|
+
def initialize: (IO | StringIO output, mode: String) -> void
|
|
26
|
+
|
|
27
|
+
# : [T] () { () -> T } -> T
|
|
28
|
+
def during_run: [T] () { () -> T } -> T
|
|
29
|
+
|
|
30
|
+
# : [T] (_TaskName) { () -> T } -> T
|
|
31
|
+
def during_task: [T] (_TaskName) { () -> T } -> T
|
|
32
|
+
|
|
33
|
+
# : () -> String
|
|
34
|
+
def next_child_id: () -> String
|
|
35
|
+
|
|
36
|
+
# : () -> bool
|
|
37
|
+
def managed_children?: () -> bool
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# : (String, String) -> void
|
|
42
|
+
def finish: (String, String) -> void
|
|
43
|
+
|
|
44
|
+
# : () -> void
|
|
45
|
+
def report_active: () -> void
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated from lib/rake/osc7501/writer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Rake
|
|
4
|
+
module OSC7501
|
|
5
|
+
class Writer
|
|
6
|
+
@output: IO | StringIO
|
|
7
|
+
|
|
8
|
+
@enabled: bool
|
|
9
|
+
|
|
10
|
+
# : (IO | StringIO output, mode: String) -> void
|
|
11
|
+
def initialize: (IO | StringIO output, mode: String) -> void
|
|
12
|
+
|
|
13
|
+
# : (state: String, msg: String) -> void
|
|
14
|
+
def emit: (state: String, msg: String) -> void
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
# : () -> bool
|
|
19
|
+
def automatic_output?: () -> bool
|
|
20
|
+
|
|
21
|
+
# : (String, Integer) -> String
|
|
22
|
+
def encode: (String, Integer) -> String
|
|
23
|
+
|
|
24
|
+
# Bound sanitization work with 50% headroom for stripped controls.
|
|
25
|
+
# : (Integer) -> Integer
|
|
26
|
+
def sanitization_byte_limit: (Integer) -> Integer
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake-osc7501
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Cosgrove
|
|
@@ -43,6 +43,12 @@ files:
|
|
|
43
43
|
- lib/rake/osc7501/run.rb
|
|
44
44
|
- lib/rake/osc7501/version.rb
|
|
45
45
|
- lib/rake/osc7501/writer.rb
|
|
46
|
+
- sig/rake/osc7501.rbs
|
|
47
|
+
- sig/rake/osc7501/hooks.rbs
|
|
48
|
+
- sig/rake/osc7501/rspec_task.rbs
|
|
49
|
+
- sig/rake/osc7501/run.rbs
|
|
50
|
+
- sig/rake/osc7501/version.rbs
|
|
51
|
+
- sig/rake/osc7501/writer.rbs
|
|
46
52
|
homepage: https://github.com/cosgroveb/rake-osc7501
|
|
47
53
|
licenses:
|
|
48
54
|
- Apache-2.0
|