This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
GitHubOwner: | |
Type: String | |
Description: GitHub repo owner | |
MinLength: 1 | |
GitHubRepo: | |
Type: String | |
Description: GitHub repo name | |
MinLength: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find spec -name '*_spec.rb' | xargs -tn 5 bundle exec ruby -I.:spec -r 'rspec/autorun' -e 'ARGV.each{|f| require f}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Takes an array (enumerable?) as input | |
# Return an array containing elements occurring multiple times in input | |
def report_duplicate_elements(list) | |
occurs_multiple_times = [] | |
already_seen = [] | |
list.each do |element| | |
if already_seen.include?(element) | |
occurs_multiple_times << element | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveSupport::TestCase | |
def attr_tree(obj) | |
tree = obj.attributes.except("id") | |
obj.class.reflections.each do |refl_name,refl| | |
refl_key = refl_name.to_s | |
case refl.macro | |
when :belongs_to, :has_one | |
tree[refl_key] = (o = obj.send(refl_name)) && o.attributes | |
when :has_many, :has_and_belongs_to_many |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in "$@" | |
do | |
git mv vendor/plugins/$i/lib lib/$i | |
git mv vendor/plugins/$i/init.rb config/initializers/$i.rb | |
git rm -r vendor/plugins/$i || rmdir vendor/plugins/$i | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find test/* -type d -maxdepth 2 | xargs -J {} find {} -name '*_test.rb' | xargs -tn 5 bundle exec ruby -I.:test -e "ARGV.each{|f| require f}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionView | |
class Template | |
def render_with_warn_on_escaped_html(*args,&block) | |
output = render_without_warn_on_escaped_html(*args,&block) | |
unless Rails.env.production? || args[0].request.instance_variables.include?(:@skip_escaped_html_check) | |
if output =~ /^.*<.*$/ | |
warn "WARNING: Escaped HTML in #{ Rails.backtrace_cleaner.clean(caller).first }: #{Regexp.last_match}" | |
args[0].request.instance_variable_set(:@skip_escaped_html_check,true) | |
end | |
end |