Yusuke ENDOH writes:
Periodically when fetching web pages using open-uri, he notices that many different kinds of exceptions can be raised.
So far, he’s experienced these below:
-
Errno::ETIMEDOUT
def transfere(to, valor) | |
to.link("transfer").post(:valor => valor) | |
end | |
def processa_pagamento(pessoa, aulas, consultorias, opensource, bank) | |
parcelas = [] | |
total = 0 | |
aulas.each do |a| | |
aula.verify do |v| |
#!/usr/bin/env ruby | |
# | |
###################################################################################################################################### | |
# Taken here http://fulloo.info/Examples/RubyExamples/Dijkstra/DijkstraListing.html and carefully corrected to be more ruby idiomatic. | |
###################################################################################################################################### | |
# | |
# Example in Ruby -- Dijkstra's algorithm in DCI | |
# Modified and simplified for a Manhattan geometry with 8 roles | |
# | |
# |
require 'benchmark/ips' | |
h = { foo: :bar } | |
Benchmark.ips do |r| | |
r.report('#[]') { h[:foo] } | |
r.report('#fetch') { h.fetch(:foo) } | |
end |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
after_filter :set_access_control_headers | |
def set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Request-Method'] = '*' | |
end | |
end |
[cmilfont@milfont:/Users/cmilfont/projetos/forteschat3/oraculo:homologacao:a1a293f:+M] | |
$ rspec spec/integration/chamado_spec.rb -e "Deveria submeter a dúvida para a tela de Faqs" | |
Run filtered including {:full_description=>/(?-mix:Deveria\ submeter\ a\ dúvida\ para\ a\ tela\ de\ Faqs)/} | |
Chamado | |
Como cliente | |
Pagina inicial | |
DEPRECATION WARNING: <% %> style block helpers are deprecated. Please use <%= %>. (called from _app_views_chamados_index_html_erb__1905729048714370975_2183758900_2238918427965469768 at /Users/cmilfont/projetos/forteschat3/oraculo/app/views/chamados/index.html.erb:40) | |
http://127.0.0.1:51920/javascripts/vendor/jquery-1.7.1.min.js:4 TypeError: Result of expression 'o' [null] is not an object. | |
Deveria submeter a dúvida para a tela de Faqs (FAILED - 1) |
gem 'mongo' | |
gem 'em-mongo' | |
gem 'bson_ext' | |
gem 'goliath' | |
gem 'grape' |
Home Page | |
Failure/Error: visit product_path product | |
Capybara::Poltergeist::JavascriptError: | |
One or more errors were raised in the Javascript code on the page: | |
SyntaxError: Parse error | |
TypeError: 'null' is not an object (evaluating 'images[$($("#product-variants input[type=radio]")[0]).val()]') | |
gem 'mongo' | |
gem 'em-mongo' | |
gem 'bson_ext' | |
gem 'goliath' | |
gem 'grape' |
class CardCreator < Struct.new(:listener) | |
def create(iteration, attributes) | |
card = iteration.cards.build(attributes) | |
if card.save | |
listener.created(card) | |
else | |
listener.create_failed(card) | |
end | |
end | |
end |