Here's the cool shit from railsconf. An overview of all talks is here, https://github.com/newhavenrb/railsconf2012
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
ruby-1.9.3-p0 ~/dev/site5/helix [feature/cas-server *$%] $ foreman start | |
10:47:41 guard.1 | started with pid 10419 | |
10:47:41 web.1 | started with pid 10423 | |
10:47:41 cas.1 | started with pid 10427 | |
10:47:41 cas.1 | Starting the authentication server on port 10433 | |
10:47:45 cas.1 | /home/fabio/dev/site5/sneakers/config.ru:7:in `require': cannot load such file -- casserver (LoadError) | |
10:47:45 cas.1 | from /home/fabio/dev/site5/sneakers/config.ru:7:in `block in <main>' | |
10:47:45 cas.1 | from /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' | |
10:47:45 cas.1 | from /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' | |
10:47:45 cas.1 | from /home/fabio/dev/site5/sneakers/config.ru:1:in `new' |
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
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-webkit-0.10.0/lib/capybara/driver/webkit/node.rb:127:in `check_visibility' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-webkit-0.10.0/lib/capybara/driver/webkit/node.rb:36:in `select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/element.rb:83:in `block in select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/base.rb:46:in `wait_until' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/capybara-1.1.2/lib/capybara/node/element.rb:83:in `select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/actions.rb:109:in `find_and_select_option' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/actions.rb:48:in `block in complete_form' | |
/home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/bundler/gems/splinter-81bbe9fa8ac9/lib/splinter/capybara/form_completer.rb:41:in `each' | |
/home/fabio/.rvm/ge |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
Country;ISO;International Phone | |
Afghanistan;AF;93 | |
Aland Islands;AX;358 | |
Albania;AL;355 | |
Algeria;DZ;231 | |
American Samoa;AS;684 | |
Andorra;AD;376 | |
Angola;AO;244 | |
Anguilla;AI;1 | |
Antarctica;AQ; |
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
irb | |
require 'uri' | |
require 'faraday' | |
uri = URI.parse("http://www.google.com.br") | |
response = Faraday.new(:url => uri) do |c| | |
c.params = {:a => "b"} | |
end.get.body |
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 Model | |
# model has a country_code column which stores in ISO format | |
def country | |
I18n.t(country_code) | |
end | |
end |
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 PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
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
<% semantic_navigation :main do |n| %> | |
<%= n.group 'Media' do %> | |
<%= n.item 'Image Gallery', :link => '/media/images', :highlights_on => '/media/videos' %> | |
<%= n.item 'Videos', :link => '/media/videos', :disabled_if => proc { true } %> | |
<%= n.item 'Contact Us' # auto links to the contact_us_path if it exists %> | |
<% end %> | |
<% end %> |
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
E, [2012-02-21T20:30:12.434214 #4624] ERROR -- : app error: Net::HTTPOK#read_body called twice (IOError) | |
E, [2012-02-21T20:30:12.434323 #4624] ERROR -- : /home/fabio/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/net/http.rb:2704:in `read_body' | |
E, [2012-02-21T20:30:12.434383 #4624] ERROR -- : /home/fabio/dev/----/---/lib/---/net_http_client.rb:45:in `each' | |
E, [2012-02-21T20:30:12.434442 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/activerecord-3.2.1/lib/active_record/query_cache.rb:46:in `each' | |
E, [2012-02-21T20:30:12.434501 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:424:in `each' | |
E, [2012-02-21T20:30:12.434557 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/actionpack-3.2.1/lib/action_dispatch/middleware/body_proxy.rb:27:in `method_missing' | |
E, [2012-02-21T20:30:12.434613 #4624] ERROR -- : /home/fabio/.rvm/gems/ruby-1.9.3-p0-perf/gems/rack-1.4.1/lib/rack/body_proxy.rb:26: |
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
diff --git a/lib/moo_moo/base.rb b/lib/moo_moo/base.rb | |
index 43ed22a..f20a36e 100644 | |
--- a/lib/moo_moo/base.rb | |
+++ b/lib/moo_moo/base.rb | |
@@ -2,6 +2,29 @@ module MooMoo | |
class Base | |
attr_reader :host, :key, :user, :pass, :port | |
+ # Register an api service for the current class. | |
+ # |