Skip to content

Commit

Permalink
Drop support for ruby < 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusRich committed Sep 2, 2023
1 parent 4644fe5 commit ab69a90
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-and-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.5, 2.6, 2.7, '3.0']
ruby: [3.0, 3.1, 3.2]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.8
3.0.6
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.0.6
137 changes: 82 additions & 55 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,78 +7,105 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
backport (1.1.2)
benchmark (0.1.0)
diff-lcs (1.4.4)
docile (1.3.2)
backport (1.2.0)
base64 (0.1.1)
benchmark (0.2.1)
diff-lcs (1.5.0)
docile (1.4.0)
e2mmap (0.1.0)
jaro_winkler (1.5.4)
maruku (0.7.3)
mini_portile2 (2.4.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
parallel (1.21.0)
parser (2.7.2.0)
jaro_winkler (1.5.6)
json (2.6.3)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
mini_portile2 (2.8.4)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
rainbow (3.0.0)
rake (13.0.1)
regexp_parser (2.1.1)
reverse_markdown (2.0.0)
racc
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
rbs (2.8.4)
regexp_parser (2.8.1)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.0)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.0)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubocop (0.92.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.56.2)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.5.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-performance (1.8.1)
rubocop (>= 0.87.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
simplecov (0.19.1)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
solargraph (0.39.17)
backport (~> 1.1)
simplecov_json_formatter (0.1.4)
solargraph (0.49.0)
backport (~> 1.2)
benchmark
bundler (>= 1.17.2)
bundler (~> 2.0)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
maruku (~> 0.7, >= 0.7.3)
nokogiri (~> 1.9, >= 1.9.1)
parser (~> 2.3)
reverse_markdown (>= 1.0.5, < 3)
rubocop (~> 0.52)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
rbs (~> 2.0)
reverse_markdown (~> 2.0)
rubocop (~> 1.38)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
standard (0.7)
rubocop (= 0.92)
rubocop-performance (= 1.8.1)
thor (1.0.1)
tilt (2.0.10)
unicode-display_width (1.8.0)
yard (0.9.25)
standard (1.31.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.56.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.2)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.2.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.19.0)
thor (1.2.2)
tilt (2.2.0)
unicode-display_width (2.4.2)
yard (0.9.34)

PLATFORMS
ruby
Expand All @@ -93,4 +120,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.2.29
2.3.9
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Then, add the required and optional fields
class User
extend EzAttributes

# Here name and age are required, and email has a default value, so it is optional.
# Here, `name` and `age` are required, and `email` has a default value, so it is optional.
attributes :name, :age, email: 'guest@user.com'
end

Expand Down Expand Up @@ -74,7 +74,6 @@ u = User.new(name: 'Matz', age: 22)

u.name
# NoMethodError (undefined method `name' for #<User:0x000055bac152f130>)

```

## Development
Expand Down
2 changes: 1 addition & 1 deletion ez_attributes.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = "Easily define initializers with keyword args. It supports required and optional args."
spec.homepage = "https://github.com/MatheusRich/ez_attributes.git"
spec.license = "MIT"
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
Expand Down
2 changes: 1 addition & 1 deletion lib/ez_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.configure(getters: true)
optional_args = args_with_default.map { |name, _| "#{name}: __args_with_default[:#{name}]" }
init_args = (required_args + optional_args).join(", ")

define_method("__args_with_default", -> { Marshal.load(Marshal.dump(args_with_default)) })