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

Fix issues with debug gem #125

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ruby: ['3.1', '3.2', 'head']
ruby: ['3.1', '3.2', '3.3', 'head']

name: >-
${{matrix.os}}, ${{matrix.ruby}}
Expand All @@ -20,7 +20,7 @@ jobs:

steps:
- name: Setup machine
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_io_uring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby: ['3.1', '3.2', 'head']
ruby: ['3.1', '3.2', '3.3', 'head']

name: >-
${{matrix.os}}, ${{matrix.ruby}}

runs-on: ${{matrix.os}}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Ruby
Expand Down
5 changes: 3 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
RubyInterpreters:
- ruby
Exclude:
Expand All @@ -9,6 +9,7 @@ AllCops:
- 'Gemfile*'
- 'ext/**/*.rb'
- lib/polyphony/adapters/irb.rb
NewCops: enable

Style/LambdaCall:
Enabled: false
Expand Down Expand Up @@ -202,4 +203,4 @@ Style/SlicingWithRange:

Style/RaiseArgs:
Exclude:
- lib/polyphony/extensions/fiber.rb
- lib/polyphony/extensions/fiber.rb
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## What is Polyphony?

Polyphony is a library for building concurrent applications in Ruby. Polyphony
harnesses the power of [Ruby fibers](https://rubyapi.org/3.2/o/fiber) to provide
harnesses the power of [Ruby fibers](https://rubyapi.org/3.3/o/fiber) to provide
a cooperative, sequential coroutine-based concurrency model. Under the hood,
Polyphony uses [io_uring](https://unixism.net/loti/what_is_io_uring.html) or
[libev](https://github.com/enki/libev) to maximize I/O performance.
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ minimizing memory use and GC pressure.
## Compressing and decompressing in-flight data

You might be familiar with Ruby's [zlib](https://github.com/ruby/zlib) gem (docs
[here](https://rubyapi.org/3.2/o/zlib)), which can be used to compress and
[here](https://rubyapi.org/3.3/o/zlib)), which can be used to compress and
uncompress data using the popular gzip format. Imagine we want to implement an
HTTP server that can serve files compressed using gzip:

Expand Down Expand Up @@ -318,4 +318,4 @@ provided by Polyphony, which lets us write less code, have it run faster, have
it run concurrently, and minimize memory allocations and pressure on the Ruby
GC. Feel free to browse the [IO
examples](https://github.com/digital-fabric/polyphony/tree/master/examples/io)
included in Polyphony.
included in Polyphony.
2 changes: 1 addition & 1 deletion docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
## What is Polyphony?

Polyphony is a library for building concurrent applications in Ruby. Polyphony
harnesses the power of [Ruby fibers](https://rubyapi.org/3.2/o/fiber) to provide
harnesses the power of [Ruby fibers](https://rubyapi.org/3.3/o/fiber) to provide
a cooperative, sequential coroutine-based concurrency model. Under the hood,
Polyphony uses [io_uring](https://unixism.net/loti/what_is_io_uring.html) or
[libev](https://github.com/enki/libev) to maximize I/O performance.
Expand Down
4 changes: 2 additions & 2 deletions lib/polyphony/extensions/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def read(name, length = nil, offset = nil, opt = EMPTY_HASH)
end

alias_method :orig_readlines, :readlines
def readlines(name, sep = $/, limit = nil, getline_args = EMPTY_HASH)
def readlines(name, sep = $/, limit = nil, getline_args = EMPTY_HASH, chomp: false)
File.open(name, 'r') do |f|
f.readlines(sep, **getline_args)
f.readlines(sep, chomp: chomp, **getline_args)
end
end

Expand Down
20 changes: 13 additions & 7 deletions polyphony.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.required_ruby_version = '>= 3.1'

s.add_development_dependency 'rake-compiler', '1.2.1'
s.add_development_dependency 'minitest', '5.17.0'
s.add_development_dependency 'rake-compiler', '1.2.7'
s.add_development_dependency 'minitest', '5.22.3'
s.add_development_dependency 'simplecov', '0.22.0'
s.add_development_dependency 'rubocop', '1.45.1'
s.add_development_dependency 'rubocop', '1.62.1'
s.add_development_dependency 'pry', '0.14.2'

s.add_development_dependency 'msgpack', '1.6.0'
s.add_development_dependency 'msgpack', '1.7.2'
s.add_development_dependency 'httparty', '0.21.0'
s.add_development_dependency 'localhost', '1.1.10'
s.add_development_dependency 'debug', '1.8.0'
s.add_development_dependency 'benchmark-ips', '2.10.0'
s.add_development_dependency 'localhost', '1.2.0'
s.add_development_dependency 'debug', '1.9.1'
s.add_development_dependency 'benchmark-ips', '2.13.0'

# FIXME: remove gems when all other dependencies have bundled them (not part of stdlib since Ruby 3.4)
s.add_development_dependency 'base64', '0.2.0'
s.add_development_dependency 'bigdecimal', '3.1.7'
s.add_development_dependency 'csv', '3.3.0'
s.add_development_dependency 'mutex_m', '0.2.0'
end
2 changes: 2 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def monotonic_clock
end
end

module MiniTest; end

class MiniTest::Test
def setup
# trace "* setup #{self.name}"
Expand Down
6 changes: 6 additions & 0 deletions test/test_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ def test_readlines
assert_equal "end\n", lines[-1]
end

def test_readlines_with_chomp
lines = IO.readlines(__FILE__, chomp: true)
assert_equal "# frozen_string_literal: true", lines[0]
assert_equal "end", lines[-1]
end

WRITE_DATA = "foo\nbar קוקו"

def test_write_class_method
Expand Down
Loading