Skip to content

Commit

Permalink
Upgrade supported Ruby version to 3.1 (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: david942j <david942j@gmail.com>
  • Loading branch information
david942j authored Feb 17, 2024
1 parent 415e50f commit 4333b10
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu, macos, windows]
ruby-version: ['2.6', '2.7', head]
ruby-version: ['3.1', '3.2', '3.3', head]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.1
DisplayCopNames: true
DisplayStyleGuide: true

Expand Down
2 changes: 1 addition & 1 deletion elftools.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.files = Dir['lib/**/*.rb'] + %w[README.md]
s.homepage = 'https://github.com/david942j/rbelftools'
s.license = 'MIT'
s.required_ruby_version = '>= 2.6'
s.required_ruby_version = '>= 3.1'

s.add_runtime_dependency 'bindata', '~> 2'

Expand Down
2 changes: 1 addition & 1 deletion lib/elftools/dynamic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def tag_at(n)
@tag_at_map ||= {}
return @tag_at_map[n] if @tag_at_map[n]

dyn = Structs::ELF_Dyn.new(endian: endian)
dyn = Structs::ELF_Dyn.new(endian:)
dyn.elf_class = header.elf_class
stream.pos = tag_start + n * dyn.num_bytes
dyn.offset = stream.pos
Expand Down
6 changes: 3 additions & 3 deletions lib/elftools/elf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def header
return @header if defined?(@header)

stream.pos = 0
@header = Structs::ELF_Ehdr.new(endian: endian, offset: stream.pos)
@header = Structs::ELF_Ehdr.new(endian:, offset: stream.pos)
@header.elf_class = elf_class
@header.read(stream)
end
Expand Down Expand Up @@ -358,7 +358,7 @@ def identify

def create_section(n)
stream.pos = header.e_shoff + n * header.e_shentsize
shdr = Structs::ELF_Shdr.new(endian: endian, offset: stream.pos)
shdr = Structs::ELF_Shdr.new(endian:, offset: stream.pos)
shdr.elf_class = elf_class
shdr.read(stream)
Sections::Section.create(shdr, stream,
Expand All @@ -369,7 +369,7 @@ def create_section(n)

def create_segment(n)
stream.pos = header.e_phoff + n * header.e_phentsize
phdr = Structs::ELF_Phdr[elf_class].new(endian: endian, offset: stream.pos)
phdr = Structs::ELF_Phdr[elf_class].new(endian:, offset: stream.pos)
phdr.elf_class = elf_class
Segments::Segment.create(phdr.read(stream), stream, offset_from_vma: method(:offset_from_vma))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/elftools/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def endian
end

def create_note(cur)
nhdr = Structs::ELF_Nhdr.new(endian: endian, offset: stream.pos).read(stream)
nhdr = Structs::ELF_Nhdr.new(endian:, offset: stream.pos).read(stream)
ELFTools::Note::Note.new(nhdr, stream, cur)
end

Expand Down

0 comments on commit 4333b10

Please sign in to comment.