Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b26ed28
Restore lib/pathname.rb from ext/pathname/lib/pathname.rb at ed9270ab…
eregon Jun 18, 2025
f3dcde2
Restore newer changes in lib/pathname.rb
eregon Jun 18, 2025
cd5e492
Fixes to pass the test suite
eregon Jun 18, 2025
db70967
Remove all duplicate definitions in pathname.c except <=>
eregon Jun 18, 2025
75ecae6
Define Pathname#<=> only if the C extension is not loaded
eregon Jun 18, 2025
ef267cf
Add methods from the C extension which did not exist in pathname.rb
eregon Jun 18, 2025
c6abfb7
Use Regexp#match? instead of =~ for better performance
eregon Jun 18, 2025
e7d8145
Update the Pathname class documentation with the one in the C extension
eregon Jun 18, 2025
f8ddafa
Handle Windows NTFS edge case in Pathname#sub_ext
eregon Jun 18, 2025
da3d8f9
Optimize Pathname#initialize to avoid extra __send__
eregon Jun 18, 2025
c5269dc
Optimize Pathname#initialize to avoid extra ivar accesses
eregon Jun 18, 2025
2480502
Avoid ; and multiple statements per line for readability
eregon Jul 16, 2025
28add9b
Define protected #path to avoid extra copies from #to_s
eregon Jul 16, 2025
8cca659
Use (...) for delegating instead of (*args) so kwargs and block are p…
eregon Jul 16, 2025
c58bd4f
Simplify #unlink
eregon Jul 16, 2025
054a43e
Switch to path.include?("\0") as it is faster than /\0/.match?(path)
eregon Jul 16, 2025
20f3653
Define Pathname#sub in C on CRuby for efficiency
eregon Aug 5, 2025
9586da6
Do not use the C extension on non-CRuby
eregon Aug 5, 2025
819607f
Small fixes to make all tests pass on TruffleRuby
eregon Aug 5, 2025
dc34c8c
Small fixes to make all tests pass on JRuby
eregon Aug 5, 2025
b83d344
Add TruffleRuby and JRuby in CI
eregon Aug 5, 2025
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
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby
engine: all

test:
needs: ruby-versions
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os: [ ubuntu-latest, macos-latest, windows-latest ]
exclude:
- { os: windows-latest , ruby: head }
- { os: windows-latest , ruby: truffleruby }
- { os: windows-latest , ruby: truffleruby-head }
# io/console warnings make CI fail
- { os: macos-latest , ruby: jruby }
- { os: macos-latest , ruby: jruby-head }
# Errno::ESRCH: No such process - File.symlink
- { os: windows-latest , ruby: jruby }
- { os: windows-latest , ruby: jruby-head }
include:
- { os: windows-latest , ruby: mingw }
- { os: windows-latest , ruby: mswin }
Expand Down
8 changes: 6 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/**/test_*.rb"]
end

require 'rake/extensiontask'
Rake::ExtensionTask.new("pathname")
if RUBY_ENGINE == 'ruby'
require 'rake/extensiontask'
Rake::ExtensionTask.new("pathname")
else
task :compile
end

task :default => [:compile, :test]
8 changes: 7 additions & 1 deletion ext/pathname/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# frozen_string_literal: false

require 'mkmf'
create_makefile('pathname')

if RUBY_ENGINE == "ruby"
create_makefile('pathname')
else
File.write("Makefile", dummy_makefile($srcdir).join(""))
end
Loading
Loading