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
LoadError in # | |
Showing /home/fabio/dev/site5/helix/app/views/layouts/application.html.erb where line #31 raised: | |
cannot load such file -- ["ok","(function() {\n\n $(document).ready(function() {\n $('form li.error:first input').focus();\n $('table.sortable').each(function(i, t) {\n var config, headers, table;\n table = $(t);\n headers = table.find('thead th');\n config = {\n headers: {}\n };\n headers.each(function(i, h) {\n var header, hide;\n header = $(h);\n hide = header.hasClass('actions' || header.hasClass('no-sort'));\n if (hide) {\n return config.headers[i] = {\n sorter: false\n };\n }\n });\n return table.tablesorter(config);\n });\n return $('[name=\"customer_autocomplete\"]').each(function(i, customer_input) {\n var customer_id_input;\n customer_input = $(customer_input);\n customer_id_input = customer_input.parents('form:first').find('[name*=\"customer_id\"]') |
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
CREATE OR REPLACE VIEW searches AS ((((((((((((((((((((((((( | |
(SELECT brands.name AS term, | |
brands.id AS searchable_id, | |
'Brand'::character varying AS searchable_type | |
FROM brands | |
UNION SELECT staffs.name AS term, | |
staffs.id AS searchable_id, | |
'Staff'::character varying AS searchable_type | |
FROM staffs) | |
UNION |
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
1.9.3p194 :105 > Customer.count | |
(4.5ms) SELECT COUNT(*) FROM "customers" | |
=> 10025 | |
1.9.3p194 :106 > Contact.count | |
(8.2ms) SELECT COUNT(*) FROM "contacts" | |
=> 20050 | |
1.9.3p194 :107 > Address.count | |
(9.3ms) SELECT COUNT(*) FROM "addresses" | |
=> 30125 | |
1.9.3p194 :108 > Hardware.count |
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
# product_type | |
# kindly_driver_name: | |
# configuration_key: | |
# desc: "The configuration description" | |
# unit: "The configuration unit" | |
SharedHosting: | |
hosting/cpanel: | |
bwlimit: | |
desc: "Bandwidth Limit" | |
disk_quota: |
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 Service | |
def handler | |
@handler ||= Kindly.with_service(self) | |
end | |
delegate :provision, :deprovision, to: :handler | |
end | |
class Kindly | |
def self.with_service(service) |
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
module Kindly | |
class << self | |
attr_accessor :logger | |
def for_service(service) | |
service.driver_type.camelize.constantize.new(service) | |
end | |
end | |
end | |
class Kindly::Cpanel |
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 ServiceObserver < ActiveRecord::Observer | |
def before_activate(service, transition) | |
return service.driver.provision(transition.args.extract_options!).success? | |
end | |
def before_terminate(service, transition) | |
service.driver.deprovision(transition.args.extract_options!) | |
end | |
def before_cancel(service, transition) |
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
# Current version | |
# - before block runs before each example | |
# - isolated examples | |
describe "GET show" do | |
before do | |
@customer = create_customer | |
get :show, id: @customer.id | |
end | |
it { should respond_with(:success) } |