Skip to content

Commit 6e6756b

Browse files
committed
Initial version
0 parents  commit 6e6756b

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ruby2_keywords
2+
3+
Provides empty `Module#ruby2_keywords` method, for the forward
4+
source-level compatibility against ruby2.7 and ruby3.
5+
6+
## Installation
7+
8+
Add this line to your application's Gemfile:
9+
10+
```ruby
11+
gem 'ruby2_keywords'
12+
```
13+
14+
And then execute:
15+
16+
$ bundle
17+
18+
Or install it yourself as:
19+
20+
$ gem install ruby2_keywords
21+
22+
## Usage
23+
24+
```ruby
25+
require 'ruby2_keywords'
26+
27+
module YourModule
28+
ruby2_keywords def oldstyle_keywords(options = {})
29+
end
30+
end
31+
```
32+
33+
## Contributing
34+
35+
Bug reports and pull requests are welcome on GitHub at https://bugs.ruby-lang.org.
36+
37+
## License
38+
39+
The gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).

lib/ruby2_keywords.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Module
2+
unless respond_to?(:ruby2_keywords, true)
3+
private
4+
def ruby2_keywords(*)
5+
# nil
6+
end
7+
end
8+
end

ruby2_keywords.gemspec

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version = "0.0.0"
2+
3+
Gem::Specification.new do |s|
4+
s.name = "ruby2_keywords"
5+
s.version = version
6+
s.summary = "Shim library for Module#ruby2_keywords"
7+
s.homepage = "https://www.ruby-rang.org/"
8+
s.licenses = ["Ruby"]
9+
s.require_paths = ["lib"]
10+
s.files = [
11+
"lib/ruby2_keywords.rb",
12+
"ruby2_keywords.gemspec",
13+
]
14+
end

0 commit comments

Comments
 (0)