0
0

More than 1 year has passed since last update.

#VsCode の正規表現置換で rspec の let 記法を #Ruby の変数代入に置換する例

Last updated at Posted at 2019-11-19

Find

 *let\(:(\w+)\) *\{ *(.+?) *\}

Replace

$1 = $2

Before

  let(:user) { create(:user, :man) }
  let(:book) { user.book }

After

user = create(:user, :man)
book = user.book

操作の例

コマンドパレットで Replace を選んで、C+Enter で全て置換。

image
image
image

未来の自分

見てますかー?ブラジルのあなたー?

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0