Skip to content

Instantly share code, notes, and snippets.

@banister
Created September 6, 2011 02:43
Show Gist options
  • Save banister/1196442 to your computer and use it in GitHub Desktop.
Save banister/1196442 to your computer and use it in GitHub Desktop.
pry(main)> def hello(friends)
pry(main)* puts "my friends i have come here to say hello"
pry(main)* puts "hello is an unusual word, but is appropriate at a time like this"
pry(main)* puts "when it has been so long since we last met"
pry(main)* puts "before the dogs were put to sleep"
pry(main)* s/hello/goodbye
1: def goodbye(friends)
2: puts "my friends i have come here to say goodbye"
3: puts "goodbye is an unusual word, but is appropriate at a time like this"
4: puts "when it has been so long since we last met"
5: puts "before the dogs were put to sleep"
pry(main)* s/dogs/cats
1: def goodbye(friends)
2: puts "my friends i have come here to say goodbye"
3: puts "goodbye is an unusual word, but is appropriate at a time like this"
4: puts "when it has been so long since we last met"
5: puts "before the cats were put to sleep"
pry(main)* end
=> nil
@banister
Copy link
Author

banister commented Sep 6, 2011

command /s\/(.*?)\/(.*?)/ do |source, dest|
  eval_string.gsub!(/#{source}/) { dest }
  run "show-input"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment