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
require 'spec_helper' | |
describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
describe "#annonymous user" do | |
context "when facebook email doesn't exist in the system" do | |
before(:each) do | |
stub_env_for_omniauth | |
get :facebook |
# Create a file `spec/acceptance/support/warden.rb' with the following | |
# contents: | |
Spec::Runner.configure do |config| | |
config.include Warden::Test::Helpers, :type => :acceptance | |
config.after(:each, :type => :acceptance) { Warden.test_reset! } | |
end | |
# Or, if you're using RSpec 2 / Rails 3, the contents should be the following | |
# instead: |
The new rake task assets:clean removes precompiled assets. [fxn]
Application and plugin generation run bundle install unless --skip-gemfile
or --skip-bundle
. [fxn]
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
# https://www.varnish-cache.org/trac/wiki/VCLExamples | |
# Summary | |
# 1. Varnish will poll the backend at /health_check to make sure it is | |
# healthy. If the backend goes down, varnish will server stale content | |
# from the cache for up to 1 hour. | |
# 2. Varnish will pass X-Forwarded-For headers through to the backend | |
# 3. Varnish will remove cookies from urls that match static content file | |
# extensions (jpg, gif, ...) |
first: brew install highlight | |
second: add to your .zshrc (or .bashrc) | |
function hlr { | |
filename=`echo $1 | cut -d . -f 1` | |
highlight --syntax ruby -k Menlo -K 20 -O rtf -s edit-xcode $1 > $filename.rtf | |
} | |
third: it will generate a .rtf file. just open and copy the highlighted code and add to your Keynote talk. |
Dear Rubyists,
I just lost a contract because of my code in a Rails project.
The specific code in question is related to a "posting a comment" feature. Here are the details:
In this project, "posting a comment" does not simply entail inserting a row into the database. It involves a procedure to yes, insert a row, but also detect its language, check for spam, send emails, and "share" it to Twitter and Facebook. I believe this algorithm should be encapsulated. I do not believe it belongs in a controller or a model. I do not believe Active Record callbacks should be used.
The "senior developer", whom is the stake holder's right hand man, said this: