From c79151abfab47e67f92332ff6753bf29ad8af756 Mon Sep 17 00:00:00 2001 From: Little_Rubyist Date: Mon, 23 Dec 2024 18:42:55 +0900 Subject: [PATCH 1/2] add rbs-inline --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 870fde0e..674f5dda 100644 --- a/Gemfile +++ b/Gemfile @@ -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.1", require: false end From f12953d9492550ec8504301cb799855472c557b8 Mon Sep 17 00:00:00 2001 From: Little_Rubyist Date: Mon, 23 Dec 2024 19:11:58 +0900 Subject: [PATCH 2/2] Rewrite bitmap.rb with rbs-inline --- lib/lrama/bitmap.rb | 3 +++ sig/generated/lrama/bitmap.rbs | 11 +++++++++++ sig/lrama/bitmap.rbs | 7 ------- 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 sig/generated/lrama/bitmap.rbs delete mode 100644 sig/lrama/bitmap.rbs diff --git a/lib/lrama/bitmap.rb b/lib/lrama/bitmap.rb index b2de0248..098c6e0b 100644 --- a/lib/lrama/bitmap.rb +++ b/lib/lrama/bitmap.rb @@ -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 @@ -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 diff --git a/sig/generated/lrama/bitmap.rbs b/sig/generated/lrama/bitmap.rbs new file mode 100644 index 00000000..5405548a --- /dev/null +++ b/sig/generated/lrama/bitmap.rbs @@ -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 diff --git a/sig/lrama/bitmap.rbs b/sig/lrama/bitmap.rbs deleted file mode 100644 index b572344f..00000000 --- a/sig/lrama/bitmap.rbs +++ /dev/null @@ -1,7 +0,0 @@ -module Lrama - module Bitmap - def self.from_array: (Array[int] ary) -> Integer - - def self.to_array: (Integer int) -> Array[Integer] - end -end