This file contains hidden or 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
require 'rubygems' | |
require 'benchmark' | |
include Benchmark | |
class Array | |
def to_hash_using_inject_push( use_array ) | |
Hash[*(0 .. self.size).inject( [] ) { |r,i| r.push( self[i], use_array[i] ) }] | |
end |
This file contains hidden or 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
ca: | |
errors: | |
messages: | |
expired: "ha caducat, demanen un de nou" | |
not_found: "no s'ha trobat" | |
already_confirmed: "ja està confirmat" | |
not_locked: "no està bloquejat" | |
not_saved: | |
one: "1 error ha evitat que %{resource} es pugui desar:" | |
other: "%{count} errors han evitat que %{resource} es pugui desar:" |
This file contains hidden or 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
require "xpath" # XPath is a separate gem now | |
module Cucumber | |
module Rails | |
module CapybaraSelectDatesAndTimes | |
def select_date(field, options = {}) | |
date = Date.parse(options[:with]) | |
find(:xpath, %Q{//select[contains(@id, "#{field}_1i")]}).find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option | |
find(:xpath, %Q{//select[contains(@id, "#{field}_2i")]}).find(:xpath, %Q{option[@value='#{date.month.to_s}']}).select_option | |
find(:xpath, %Q{//select[contains(@id, "#{field}_3i")]}).find(:xpath, ::XPath::HTML.option(date.day.to_s)).select_option |