rake-osc7501 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 868cd8a5aa617ffa44d3a9da5c6d02ff514d223ff294d3723afa0cc1c139c9f4
4
- data.tar.gz: 8bc395f13a34ad648a31a3c364c172242a5624f01880cfd417b4efa82babc800
3
+ metadata.gz: 9ec4d24e91dfcf5e1fc81da1a23945ea6782ad3ea8de3f042e7e7ba0db5ae61e
4
+ data.tar.gz: 611c5cd0014c4c19b20b6dea23ece1be35826438ec8846fed4a070341541d801
5
5
  SHA512:
6
- metadata.gz: 98b140b5886a2a428394477cdd9bb0f2f20ab4d2a7bd5af1bca441ec95ec4234e5f501fd6f7ff8d10abbd3bc7e8e08cd8c8d24ef0257f764e613d4bf5b5d0634
7
- data.tar.gz: 796a7c336a8e980cdac4c0b315e6d2fc5d184591162ec8cf97ceda6a839ca1a1b9e9e5644a94e9f83d9104037893f43370b7aa24519bb1a4bf5372e7ff202ae9
6
+ metadata.gz: 2edae9f21fac815f594a72940145e420a466c691c1a37a8abeeb882c62bcbc6eb83ef439138da26105a05760ea53efe4ac0882d14fcf3ebcb209adc5cf894165
7
+ data.tar.gz: a3c2a55f578791cbb038d1f6cedf0b57c304cfc363de2a0b2bb0161158318745158a1e0cdc6708eef2b0b2d60d40d4e326f6d16bd17d5ed0a0d0ce7b671fa953
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
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
+
5
15
  ## 0.1.1 - 2026-11-12
6
16
 
7
17
  - Preserve release failure diagnostics on retries ([5e89c7b](https://github.com/cosgroveb/rake-osc7501/commit/5e89c7b0f84a9ed45342b4f5e5d8154f309f6b67))
data/CONTRIBUTING.md CHANGED
@@ -17,12 +17,18 @@ 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
@@ -42,7 +48,9 @@ bundle exec rake rdoc
42
48
  ```
43
49
 
44
50
  The package is `pkg/rake-osc7501-<version>.gem`. Open `tmp/rdoc/index.html` to check
45
- rendered documentation. Keep generated files out of commits.
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.
46
54
  The smoke task builds and installs the gem in a temporary directory, then checks
47
55
  passing and failing tasks without loading the checkout's library.
48
56
  The `pure-rake` CI job runs this check with only Rake and the built gem installed
@@ -60,13 +68,15 @@ export BUNDLE_GEMFILE=Gemfile.compat
60
68
  export RSPEC_MINOR=3.6
61
69
  export RSPEC_CORE_VERSION=3.6.0
62
70
  bundle install
63
- bundle exec rspec spec/rake
71
+ bundle exec rspec --options '' spec/rake
64
72
  bundle exec gem build rake-osc7501.gemspec
65
73
  bundle exec ruby script/smoke.rb rake-osc7501-*.gem
66
74
  ```
67
75
 
68
76
  Remove `Gemfile.compat.lock` before changing RSpec versions. Keep it out of commits.
69
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.
70
80
  CI checks the oldest Ruby against both RSpec endpoints, the oldest RSpec on modern
71
81
  Ruby, and the Debian Bullseye and Bookworm version families. These jobs run the
72
82
  runtime suite and installed-gem smoke checks. Modern jobs also test release
data/README.md CHANGED
@@ -48,8 +48,9 @@ configured formatters, including their output files. An explicit OSC formatter
48
48
  keeps its destination and receives no duplicate.
49
49
 
50
50
  Missing or older `rspec-osc7501` installations without `rspec/osc7501/managed.rb`
51
- leave the original RSpec command intact. Custom runners and reverse require order
52
- receive generic Rake reporting. Direct `rspec` commands still need explicit OSC
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
53
54
  formatter selection.
54
55
 
55
56
  The adapter passes child context through the spawn environment. It preserves
@@ -118,9 +119,11 @@ Rake and the built gem installed in an isolated gem directory.
118
119
  Set `RSPEC_OSC7501_PATH` to test a local companion checkout instead of the released gem.
119
120
 
120
121
  `rake types` checks method annotation coverage across authored Ruby files,
121
- generates inline RBS with pinned development tools, and validates signatures.
122
- Generated signatures stay in ignored `tmp/`. See [CONTRIBUTING.md](CONTRIBUTING.md)
123
- for lint, dependency audit, workflow checks and release setup. This check validates declarations,
124
- not implementation type consistency. Compatibility checks use `Gemfile.compat`
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`
125
128
  without type tooling. Pass an RSpec gem package as the smoke script's second
126
129
  argument to check installed parent/child reporting.
@@ -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
- @osc7501_run = Run.new($stdout, mode: ENV.fetch('RAKE_OSC7501', 'auto'))
16
- @osc7501_run.during_run { super }
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
- return options unless @osc7501_context
37
+ context = @osc7501_context
38
+ return options unless context
29
39
 
30
- [*options, "-r#{Shellwords.escape(@osc7501_context.last)}"]
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
- #: (*Object) -> bool?
57
+ #: (*String | Hash[String, String?] | Hash[Symbol, bool]) -> bool?
47
58
  def system(*arguments)
48
- return super unless @osc7501_context
59
+ context = @osc7501_context
60
+ return super unless context
49
61
 
50
- environment = arguments.first.is_a?(Hash) ? arguments.shift.dup : {}
51
- environment['RSPEC_OSC7501_ID'] = @osc7501_context.first
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
@@ -53,7 +53,8 @@ module Rake
53
53
  yield
54
54
  ensure
55
55
  @mutex.synchronize do
56
- @active.delete_at(@active.rindex(task))
56
+ index = @active.rindex(task) #: Integer
57
+ @active.delete_at(index)
57
58
  report_active
58
59
  end
59
60
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rake
5
5
  module OSC7501
6
- VERSION = '0.1.1' #: String
6
+ VERSION = '0.1.2' #: String
7
7
  end
8
8
  end
@@ -37,7 +37,7 @@ module Rake
37
37
 
38
38
  #: (String, Integer) -> String
39
39
  def encode(text, byte_limit)
40
- input = text.to_s.byteslice(0, sanitization_byte_limit(byte_limit))
40
+ input = text.to_s.byteslice(0, sanitization_byte_limit(byte_limit)) #: String
41
41
  clean = input.encode('UTF-8', invalid: :replace, undef: :replace).gsub(/[\u0000-\u001F\u007F-\u009F]/, '')
42
42
  bytes = 0
43
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,7 @@
1
+ # Generated from lib/rake/osc7501/version.rb with RBS::Inline
2
+
3
+ module Rake
4
+ module OSC7501
5
+ VERSION: String
6
+ end
7
+ 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
@@ -0,0 +1,11 @@
1
+ # Generated from lib/rake/osc7501.rb with RBS::Inline
2
+
3
+ module Rake
4
+ module OSC7501
5
+ # : (?Object application) -> void
6
+ def self.install!: (?Object application) -> void
7
+
8
+ # : () -> void
9
+ def self.install_rspec!: () -> void
10
+ end
11
+ 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.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