Skip to content

Commit

Permalink
Prepare for 3.2 backports
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Mar 7, 2023
1 parent a16e848 commit d40cc24
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, "3.0", "3.1", head]
ruby: [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, "3.0", 3.1, 3.2, head]
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Backports Library [<img src="https://travis-ci.org/marcandre/backports.svg?branch=master">](https://travis-ci.org/marcandre/backports) [<img src="https://badge.fury.io/rb/backports.svg" alt="Gem Version" />](http://badge.fury.io/rb/backports) [![Tidelift](https://tidelift.com/badges/package/rubygems/backports)](https://tidelift.com/subscription/pkg/rubygems-backports?utm_source=rubygems-backports&utm_medium=referral&utm_campaign=readme)

Yearning to write a gem using some new cool features in Ruby 3.1 while
Yearning to write a gem using some new cool features in Ruby 3.2 while
still supporting Ruby 2.5.x?
Have some legacy code in Ruby 1.8 but can't live without `flat_map`?

Expand Down Expand Up @@ -38,12 +38,12 @@ This will make sure that Hash responds to `dig`, `fetch_values`, `to_proc` and c
### Up to a specific Ruby version (for quick coding)

You can load all backports up to a specific version.
For example, to bring any version of Ruby mostly up to Ruby 3.1.0's standards:
For example, to bring any version of Ruby mostly up to Ruby 3.2.0's standards:

require 'backports/3.1.0'
require 'backports/3.2.0'

This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x
all the way up to Ruby 3.1.0 (for all versions of Ruby)!
all the way up to Ruby 3.2.0 (for all versions of Ruby)!

You may `require 'backports/latest'` as a
shortcut to the latest Ruby version supported.
Expand Down Expand Up @@ -109,6 +109,8 @@ itself, JRuby and Rubinius.

# Complete List of backports

## Ruby 3.2 backports

## Ruby 3.1 backports

#### Array
Expand Down Expand Up @@ -187,7 +189,8 @@ itself, JRuby and Rubinius.
- `produce` (class method)

#### Symbol
- `end_with?`

- `end_with?`

#### Time

Expand Down
3 changes: 3 additions & 0 deletions lib/backports/3.2.0.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# require this file to load all the backports up to Ruby 3.0
require 'backports/3.1.0'
Backports.require_relative_dir if RUBY_VERSION < '3.2'
1 change: 1 addition & 0 deletions lib/backports/3.2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'backports/3.2.0'
1 change: 1 addition & 0 deletions set_version/3.2.0.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require File.expand_path("#{File.dirname(__FILE__)}/setter")

0 comments on commit d40cc24

Please sign in to comment.