Skip to content

Commit

Permalink
Merge pull request #490 from Little-Rubyist/feature/add_rbs_inline_an…
Browse files Browse the repository at this point in the history
…d_refactor_bitmap

Use rbs-inline and rewrite bitmap.rb
  • Loading branch information
yui-knk authored Dec 27, 2024
2 parents a1963d8 + cc78673 commit ecd4f0c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ gem "memory_profiler"
# Then skip install on some CI jobs.
if !ENV['GITHUB_ACTION'] || ENV['INSTALL_STEEP'] == 'true'
gem "rbs", "3.7.0", require: false
gem "rbs-inline", require: false
gem "steep", "1.9.2", require: false
end
3 changes: 3 additions & 0 deletions lib/lrama/bitmap.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# rbs_inline: enabled
# frozen_string_literal: true

module Lrama
module Bitmap
# @rbs (Array[Integer] ary) -> Integer
def self.from_array(ary)
bit = 0

Expand All @@ -12,6 +14,7 @@ def self.from_array(ary)
bit
end

# @rbs (Integer int) -> Array[Integer]
def self.to_array(int)
a = [] #: Array[Integer]
i = 0
Expand Down
11 changes: 11 additions & 0 deletions sig/generated/lrama/bitmap.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generated from lib/lrama/bitmap.rb with RBS::Inline

module Lrama
module Bitmap
# @rbs (Array[Integer] ary) -> Integer
def self.from_array: (Array[Integer] ary) -> Integer

# @rbs (Integer int) -> Array[Integer]
def self.to_array: (Integer int) -> Array[Integer]
end
end
7 changes: 0 additions & 7 deletions sig/lrama/bitmap.rbs

This file was deleted.

0 comments on commit ecd4f0c

Please sign in to comment.