Skip to content

Instantly share code, notes, and snippets.

View svenfuchs's full-sized avatar

Sven Fuchs svenfuchs

View GitHub Profile
{
"email" : "svenfuchs@artweb-design.de",
"irc" : "svenfuchs",
"jabber" : "svenfuchs@jabber.org",
"twitter" : "svenfuchs",
"github" : "svenfuchs",
"blog" : "http://artweb-design.de",
"location" : "Germany/Berlin"
}
{ "blog" : "http://johndoesblog.com" }
CouchPotato::View::BaseViewSpec.class_eval do
def design_document
@design_document.gsub('/', '::') # TODO ask alex
end
end
# locate with umlauts
test "locates an element by encoded selector from html containing an encoded umlaut" do
html = '<span>Berlin</span><span>M&uuml;nchen</span>'
assert_equal 'München', locate(html, 'M&uuml;nchen').content
end
test "locates an element by encoded selector from html containing an non-encoded umlaut" do
html = '<span>Berlin</span><span>München</span>'
assert_equal 'München', locate(html, 'M&uuml;nchen').content
class I18n::Railtie
# ...
config.i18n.fallbacks = ActiveSupport::OrderedOptions.new
# ...
config.after_initialize do |app|
app.config.i18n.each do |setting, value|
case setting
# ...
when :fallbacks
init_fallbacks(setting)
source 'http://gemcutter.org'
group :ar2 do
gem "activerecord", '~> 2.3'
end
group :ar3 do
gem "activerecord", '~> 3'
end
Allows to configure locale fallbacks through config.i18n.fallbacks. The default setting config.i18n.fallbacks = true in production.rb will make I18n.t lookup fall back to the I18n.default_locale if a translation could not be found for the current or given locale.
# USAGE
# do nothing in config (i.e. remove the line in environment/production.rb)
# => local fallbacks won't be used
# set to true
config.fallbacks = true
# => uses I18n::Fallbacks.new
I would like to be able to have multiple bundles (or Gemfiles) per project.
I'd imagine things to work like this:
Gemfile.a1
gem 'a', '~> 1' # depends on gem b (1.0.0)
Gemfile.a2
gem 'a', '~> 2' # depends on gem b (2.0.0)
Now `bundle install` would install all the relevant versions:
test "ruby: innerHTML=" do
div = document.getElementsByTagName('//div').first
div.inner_html = '<div><span>hi</span> there</div>'
assert_equal "<div><span>hi</span> there</div>", div.innerHTML
end
# =>
# 1) Failure:
# test_ruby:_innerHTML=(ElementTest) [test/rdom/element_test.rb:35]:
# <"<div><span>hi</span> there</div>"> expected but was
$ gem install therubyracer
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Volumes/Users/sven/.rvm/rubies/ruby-1.8.7-p174/bin/ruby extconf.rb
Compiling V8
mkdir -p build
cp -r scons build
mkdir -p build/scons/install