Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Hlavats andrewhl

View GitHub Profile
View about_dice_project.rb
# Will that satisfy the following test cases?
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
# Implement a DiceSet Class here:
#
# class DiceSet
# code ...
# end
View diceroll.rb
module DiceSet
def self.roll(num)
Array.new(num) { 1 + rand(6) }
end
end
DiceSet.roll(20)
View gist:1291850
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
View gist:1291967
Started GET "/pages/contact" for 127.0.0.1 at 2011-10-17 00:59:25 -0400
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
Rendered /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.9ms)
Rendered /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.7ms)
Rendered /Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (14.1ms)
View gist:1291976
ActiveRecord::ConnectionNotEstablished
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
activerecord (3.1.1) lib/active_record/query_cache.rb:65:in `rescue in call'
activerecord (3.1.1) lib/active_record/query_cache.rb:59:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
View RSpec stack trace
Failures:
1) PagesController GET 'home' should have the right title
Failure/Error: response.should have_selector("title",
expected css "title" to return something
# ./spec/controllers/pages_controller_spec.rb:13:in `block (3 levels) in <top (required)>'
Finished in 4.7 seconds
4 examples, 1 failure
View RSpec failures log
Running: spec/models/user_spec.rb
FFFFFFFFFFFFFF
Failures:
1) User should create a new instance given valid attributes
Failure/Error: User.create!(@attr)
ActiveRecord::UnknownAttributeError:
unknown attribute: password
# ./spec/models/user_spec.rb:14:in `block (2 levels) in <top (required)>'
View _user.html.erb
<li>
<%= gravatar_for user, :size => 30 %>
<%= link_to user.name, user %>
<% if current_user.admin? %>
| <%= link_to "delete", user, :method => :delete, :confirm => "You sure?",
:title => "Delete #{user.name}" %>
<% end %>
</li>
View _user.html.erb
<li>
<%= gravatar_for user, :size => 30 %>
<%= link_to user.name, user %>
<% if current_user.admin? %>
|
<%= button_to "delete", { :action => "destroy", :id => user.id },
:confirm => "Are you sure?", :method => :delete %>
<% end %>
</li>
View Heroku logs
2011-11-06T19:47:17+00:00 app[web.1]: Processing by PagesController#home as HTML
2011-11-06T19:47:18+00:00 app[web.1]: Rendered shared/_not_signed_in_home.html.erb (1.9ms)
2011-11-06T19:47:18+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (55.6ms)
2011-11-06T19:47:18+00:00 app[web.1]: Rendered layouts/_stylesheets.html.erb (34.8ms)
2011-11-06T19:47:18+00:00 app[web.1]: Completed 500 Internal Server Error in 189ms
2011-11-06T19:47:18+00:00 heroku[router]: GET fierce-leaf-9771.heroku.com/ dyno=web.1 queue=0 wait=0ms service=302ms status=500 bytes=728
2011-11-06T19:47:18+00:00 app[web.1]: 7: <%= stylesheet_link_tag 'custom', :media => 'screen' %>
2011-11-06T19:47:18+00:00 app[web.1]: app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb__3437005457504265319_29340920'
2011-11-06T19:47:18+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__424160792689602891_30840440'