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
web: bundle exec puma -e $RAILS_ENV -p 1234 -S ~/puma -C config/puma.rb |
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
#export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt # this was the old one... | |
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem # this is OS X I think? |
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
p ['foo', 'foo', 'foo'].map(&:object_id) | |
p [:foo, :foo, :foo].map(&:object_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
require 'minitest/autorun' | |
class ArrayTest < MiniTest::Test | |
def test_new_array_has_zero_size | |
assert(Array.new.size == 0) | |
end | |
def test_new_array_is_empty | |
assert(Array.new.empty?) | |
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 Foo | |
def foo | |
puts "I am foo!" | |
end | |
def do_foo | |
# all five are equivalent | |
foo | |
self.foo | |
foo() |
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
require "rubygems" | |
require "spec" | |
class AccountService | |
def withdraw(account, amount) | |
account.debit(amount) | |
end | |
def deposit(account, amount) | |
account.credit(amount) |
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
When player wins he should be paid 1-1 | |
When player loses, he is not paid | |
When player has blackjack, he is paid 1.5-1 | |
Scenario: <Scenario title> | |
Given <some known state> | |
And <some more known state> | |
When <I do something> | |
Then <some desired outcome> |
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
# When I run the specs above, the following error occurs: | |
$ script/spec -c spec/controllers/strange_name_error.rb | |
./spec/controllers/strange_name_error.rb:15: undefined local variable or method `properties_url' for #<Class:0x22b918c> (NameError) | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `module_eval' | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `create_nested_example_group' | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `instance_eval' | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `subclass' | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:66:in `create_nested_example_group' | |
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:53:in `describe' |
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
This is just a test thing, to see how gist.el works |
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 Twinkies | |
class Item | |
include DataMapper::Resource | |
property :id, Integer, :serial => true | |
property :twitter_id, Integer | |
property :link, String | |
property :user, String | |
property :created_at, DateTime | |
property :text, Text, :lazy => false | |
property :guid, String, :default => Proc.new { Guid.new.to_s } |