Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View stephancom's full-sized avatar

stephan.com stephancom

View GitHub Profile
@stephancom
stephancom / Gemfile
Created April 6, 2013 06:51 — forked from niels/Gemfile
source "https://rubygems.org"
gem "devise", git: "git://github.com/plataformatec/devise.git", branch: "rails4"
gem "devise-i18n", "~> 0.6.5"
gem "jbuilder", "~> 1.0.1"
gem "jquery-rails"
gem "haml", "~> 4.0.1"
gem "mongoid", git: "git://github.com/mongoid/mongoid.git", branch: "master"
gem "simple_form", "~> 3.0.0.beta1"
gem "rails", "4.0.0.beta1"
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
module TableHelpers
module ArrayMethods
def find_row(expected_row)
find_index do |row|
expected_row.all? do |expected_column|
first_column = row.find_index { |column|
content = normalize_content(column.content)
expected_content = normalize_content(expected_column)
matching_parts = expected_content.split(/\s*\*\s*/, -1).collect { |part| Regexp.escape(part) }
matching_expression = /\A#{matching_parts.join(".*")}\z/