Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type of monitor library #485

Merged
merged 4 commits into from
Dec 1, 2020
Merged

Add type of monitor library #485

merged 4 commits into from
Dec 1, 2020

Conversation

pocke
Copy link
Member

@pocke pocke commented Nov 23, 2020

This pull request adds RBS files for monitor library.

Note:

  • bin/annotate-with-rdoc stdlib/monitor/0/monitor.rbs does nothing.
    • I'm not sure why it doesn't work, but I don't apply RDoc comment to monitor.rbs.
  • I wrote test cases only for public APIs.
  • Since Ruby 2.7, Monitor doesn't include MonitorMixin, but it includes MonitorMixin until 2.6.
    • $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-1.8.0 ./all-ruby -rmonitor -e 'p Monitor.ancestors'
      ruby-1.8.0            [Monitor, MonitorMixin, MonitorMixin::Initializable, MonitorMixin::Accessible, Object, Kernel]
      ruby-1.8.1            [Monitor, MonitorMixin, Object, Kernel]
      ...
      ruby-1.8.7-p374       [Monitor, MonitorMixin, Object, Kernel]
      ruby-1.9.0-0          [Monitor, MonitorMixin, Object, Kernel, BasicObject]
      ...
      ruby-2.7.0-preview1   [Monitor, MonitorMixin, Object, Kernel, BasicObject]
      ruby-2.7.0-preview2   [Monitor, Object, Kernel, BasicObject]
      ...
      ruby-2.7.1            [Monitor, Object, Kernel, BasicObject]
      
    • The RBS file follows Ruby 2.7, so it doesn't include MonitorMixin.

@pocke
Copy link
Member Author

pocke commented Dec 1, 2020

  • bin/annotate-with-rdoc stdlib/monitor/0/monitor.rbs does nothing.
    • I'm not sure why it doesn't work, but I don't apply RDoc comment to monitor.rbs.

I re-executed bin/annotate-with-rdoc with ruby/ruby@1ca9fac.

0c3bc94

So now we can see the annotated RBS with RDoc.

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 💮

@soutaro soutaro merged commit bd2929e into ruby:master Dec 1, 2020
@pocke pocke deleted the monitor branch December 2, 2020 01:53
pocke added a commit to pocke/rbs that referenced this pull request Dec 15, 2020
Logger type has been added in ruby#316, but MonitorMixin type didn't exist at that time.
Recently I added MonitorMixin type by ruby#485, so we can add the `include`
clause to Logger::LogDevice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants