Replace and keep the case
Replace all instance of plugin and Plugin to device and Device.
Start file
def plugin @plugin, @plugin_found_by = [Plugin.find_by_uid(@plugin_id), :uid] unless @plugin @plugin, @plugin_found_by = [Plugin.find_by_aid(@plugin_id), :aid] unless @plugin @plugin end
End file
def device @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device @device end
View Diff
1,4c1,4 < def plugin < @plugin, @plugin_found_by = [Plugin.find_by_uid(@plugin_id), :uid] unless @plugin < @plugin, @plugin_found_by = [Plugin.find_by_aid(@plugin_id), :aid] unless @plugin < @plugin --- > def device > @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device > @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device > @device
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 117 remaining solutions by signing in and submitting your own entry
#118 El Achèche ANIS 🇹🇳 / @elacheche - Score: 74 - 12/10/15 @ 20:38
:%s/Plugin/Device/g<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><BS>d<Left><Left><Left><Left><Left><Left><Left><BS>p<End><CR>:<Up><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>ai/<BS>d/uid<End><CR>:wq<CR>
0 comments