This file contains hidden or 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 Barator | |
def foo(*args) | |
"#{super(*args)}bar" | |
end | |
end | |
class Foo | |
prepend Barator | |
def foo |
This file contains hidden or 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
Order rejecting an order sends reject email when status is updated | |
Failure/Error: Order.new.stub(:send_reject_email) | |
NoMethodError: | |
undefined method `method_defined?' for #<Order not initialized> | |
# /Users/matt/.rvm/gems/ruby-2.0.0-p247@uncommon-flow/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:436:in `method_missing' | |
# /Users/matt/.rvm/gems/ruby-2.0.0-p247@uncommon-flow/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:128:in `method_missing' | |
# /Users/matt/.rvm/gems/ruby-2.0.0-p247@uncommon-flow/gems/rspec-mocks-2.14.1/lib/rspec/mocks/instance_method_stasher.rb:34:in `method_defined_on_klass?' | |
# /Users/matt/.rvm/gems/ruby-2.0.0-p247@uncommon-flow/gems/rspec-mocks-2.14.1/lib/rspec/mocks/instance_method_stasher.rb:55:in `method_owned_by_klass?' | |
# /Users/matt/.rvm/gems/ruby-2.0.0-p247@uncommon-flow/gems/rspec-mocks-2.14.1/lib/rspec/mocks/instance_method_stasher.rb:29:in `method_defined_directly_on_klass?' | |
# /Users/matt/.rvm/gems/ruby-2.0 |
This file contains hidden or 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 'active_support' | |
module TestConcern | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def test_class_method | |
puts "I gots class!" | |
end | |
end |
This file contains hidden or 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
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ] ; then | |
source "$rvm_path/scripts/rvm" | |
rvm use `cat .ruby-version`@`cat .ruby-gemset` | |
fi | |
if [ -f "~/.oh-my-zsh/custom/openssl.zsh" ] ; then | |
source "~/.oh-my-zsh/custom/openssl.zsh" | |
fi |
This file contains hidden or 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 Obj | |
def self.new_method(name, options = {}) | |
define_method(name) { options } | |
end | |
end | |
o = Obj.new | |
options = { one: :two } | |
Obj.new_method('baz', options) |
This file contains hidden or 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
//// | |
// Makes a div appear to be a stacked like 3 sheets of paper with each | |
// sheet offset by a given amount. | |
// | |
// Example: @include stacked(5px); | |
@mixin stacked($offset) { | |
border: 1px solid #494949; | |
&:after, &:before { | |
background: inherit; |
This file contains hidden or 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_relative './upload_store' | |
class PhotoClaimer | |
attr_writer :photo_source | |
attr_writer :upload_storage_source | |
class FileNotFound < RuntimeError; end | |
def initialize(user_id, file_name) | |
@user_id = user_id |
This file contains hidden or 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 Categories | |
ALL = [ | |
:BUSINESS, | |
:CALL, | |
:CONTACT, | |
:KNOWLEDGE, | |
:ENTERTAINMENT, | |
:EMAIL, | |
:HELP, | |
:TRAVEL, |
This file contains hidden or 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 Price | |
include Comparable | |
attr_reader :amount | |
def initialize(amount) | |
@amount = amount | |
end | |
def <=>(obj) |
This file contains hidden or 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
➜ ~ rvm install jruby-1.6.3 | |
jruby-1.6.3 - #downloading jruby-bin-1.6.3, this may take a while depending on your connection... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 14.7M 100 14.7M 0 0 459k 0 0:00:32 0:00:32 --:--:-- 410k | |
jruby-1.6.3 - #extracting jruby-bin-1.6.3 to /Users/brschaefer/.rvm/src/jruby-1.6.3 | |
jruby-1.6.3 - #extracted to /Users/brschaefer/.rvm/src/jruby-1.6.3 | |
Building Nailgun | |
jruby-1.6.3 - #installing to /Users/brschaefer/.rvm/rubies/jruby-1.6.3 | |
jruby-1.6.3 - adjusting #shebangs for (jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb). |