Skip to content

Instantly share code, notes, and snippets.

@jazzytomato
Created November 14, 2016 13:33
Show Gist options
  • Save jazzytomato/f44d985cdcd27179d7203e82f640b95c to your computer and use it in GitHub Desktop.
Save jazzytomato/f44d985cdcd27179d7203e82f640b95c to your computer and use it in GitHub Desktop.
# Example for replace spec files modules:
module MyFirstModule
module MySecondModule
describe Something do
# code
end
end
end
# will be replaced by
describe MyFirstModule::MySecondModule::Something do
# code
end
# search:
# (?s)module MyFirstModule\s*module MySecondModule\s*describe\s([a-zA-Z]*)\sdo(.*)(end\send\s*\Z)
# replace:
# describe MyFirstModule::MySecondModule::\1 do\2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment