From e9b5a36229b6650d289b922984eecd90dda9c5f4 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Mon, 10 Jun 2024 09:38:31 -0400 Subject: [PATCH] =?UTF-8?q?Rename=20`ReplaceAttributesWithMethods=20`=20?= =?UTF-8?q?=E2=86=92=20`AttrToMethods`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rbi.rb | 2 +- ...{replace_attributes_with_methods.rb => attr_to_methods.rb} | 4 ++-- ...ttributes_with_methods_test.rb => attr_to_methods_test.rb} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename lib/rbi/rewriters/{replace_attributes_with_methods.rb => attr_to_methods.rb} (97%) rename test/rbi/rewriters/{replace_attributes_with_methods_test.rb => attr_to_methods_test.rb} (99%) diff --git a/lib/rbi.rb b/lib/rbi.rb index bcf22837..f9881960 100644 --- a/lib/rbi.rb +++ b/lib/rbi.rb @@ -16,7 +16,7 @@ require "rbi/rewriters/nest_non_public_methods" require "rbi/rewriters/group_nodes" require "rbi/rewriters/remove_known_definitions" -require "rbi/rewriters/replace_attributes_with_methods" +require "rbi/rewriters/attr_to_methods" require "rbi/rewriters/sort_nodes" require "rbi/parser" require "rbi/printer" diff --git a/lib/rbi/rewriters/replace_attributes_with_methods.rb b/lib/rbi/rewriters/attr_to_methods.rb similarity index 97% rename from lib/rbi/rewriters/replace_attributes_with_methods.rb rename to lib/rbi/rewriters/attr_to_methods.rb index eff270cb..0ef964c9 100644 --- a/lib/rbi/rewriters/replace_attributes_with_methods.rb +++ b/lib/rbi/rewriters/attr_to_methods.rb @@ -7,7 +7,7 @@ module TempHelpers end module Rewriters - class ReplaceAttributesWithMethods < Visitor + class AttrToMethods < Visitor extend T::Sig include TempHelpers @@ -147,7 +147,7 @@ class Tree sig { void } def replace_attributes_with_methods! - visitor = Rewriters::ReplaceAttributesWithMethods.new + visitor = Rewriters::AttrToMethods.new visitor.visit(self) end end diff --git a/test/rbi/rewriters/replace_attributes_with_methods_test.rb b/test/rbi/rewriters/attr_to_methods_test.rb similarity index 99% rename from test/rbi/rewriters/replace_attributes_with_methods_test.rb rename to test/rbi/rewriters/attr_to_methods_test.rb index 4038c468..228e0e33 100644 --- a/test/rbi/rewriters/replace_attributes_with_methods_test.rb +++ b/test/rbi/rewriters/attr_to_methods_test.rb @@ -4,7 +4,7 @@ require "test_helper" module RBI - class ReplaceAttributesWithMethods < Minitest::Test + class AttrToMethodsTest < Minitest::Test def test_replaces_attr_reader_with_method rbi = Parser.parse_string(<<~RBI) # Lorum ipsum...