Skip to content

Instantly share code, notes, and snippets.

View rymai's full-sized avatar
🙌
Working from home

Rémy Coutable rymai

🙌
Working from home
View GitHub Profile
@rymai
rymai / gist:6620991
Last active December 23, 2015 10:19 — forked from lucascaton/gist:3605012
RSpec's New Expectation Syntax - migration script
# Include this in your spec_helper.rb:
config.expect_with :rspec do |c|
c.syntax = :expect
end
# Then, run:
find spec -name "*.rb" -exec gsed -i -e "s/\(\s\+\)\(.*\)\.should_not /\1expect(\2).not_to /g" -e "s/\(\s\+\)\(.*\)\.should /\1expect(\2).to /g" -e "s/\(\s\+\)\(.*\)\.should_receive/\1expect(\2).to receive/g" -e "s/\(\s\+\)\(.*\)\.should_not_receive/\1expect(\2).to_not receive/g" "{}" \;
# About RSpec's New Expectation Syntax
@rymai
rymai / awesomer.rb
Created June 2, 2011 00:29 — forked from pcreux/awesomer.rb
Convert markdown inline links to link definitions
# For https://github.com/guard/guard/blob/master/CHANGELOG.md
input, output, people = File.read('CHANGELOG.md'), "", {}
input.each_line do |line|
if found = line.match(/\[@(\w+)\]\(([\w:\/.]+)\)/)
user, url = found[1], found[2]
people[user] = url unless people.include?(user)
end
end