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
def root_binding | |
binding | |
end | |
module Blah | |
def self.root_binding | |
@root_binding | |
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
require 'bigdecimal' | |
class Payment | |
FEE_PERCENTAGE = BigDecimal.new('2.9') | |
FEE_SET_AMOUNT = BigDecimal.new('0.15') | |
attr_reader :amount | |
def initialize(amount) | |
@amount = BigDecimal.new(amount.to_s) |
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/list.ex b/lib/list.ex | |
index 75778f7..10d6cf7 100644 | |
--- a/lib/list.ex | |
+++ b/lib/list.ex | |
@@ -1,5 +1,13 @@ | |
object List | |
- def +(another) | |
+ % Returns a new list with the contents of the | |
+ % current list and the other list. | |
+ % |
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
# Dev with custom destroy taking extra params | |
class DeveloperWithCustomDestroyMethod < ActiveRecord::Base | |
self.table_name = 'developers' | |
has_and_belongs_to_many :projects, :join_table => 'developers_projects', :foreign_key => 'developer_id' | |
def destroy(options ={}) | |
super | |
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
render: function(username) { | |
var self = this; | |
this.repositories.fetch({ success: function() { | |
var content = this.templates.list({ | |
builds_list_title: "Recent Builds", | |
repositories: Travis.Collections.Repositories.toJSON() | |
}); | |
self.el.fadeOut('fast', function() { |
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 Faraday | |
class Adapter | |
class EMHttpRequest < Faraday::Adapter | |
self.supports_parallel_requests = true | |
def self.setup_parallel_manager(options = {}) | |
EMParallelManager.new | |
end | |
class EMParallelManager |
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
MacRubyHTTP.post("https://our.application.url.com", { | |
:payload => some_json_payload, | |
:headers => { 'Content-Type' => 'application/json' }) do |lh| | |
NSLog(lh.inspect) | |
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
require 'active_support/core_ext/array/wrap' | |
require 'active_support/core_ext/object/blank' | |
module ActionView | |
# = Action View Lookup Context | |
# | |
# LookupContext is the object responsible to hold all information required to lookup | |
# templates, i.e. view paths and details. The LookupContext is also responsible to | |
# generate a key, given to view paths, used in the resolver cache lookup. Since | |
# this key is generated just once during the request, it speeds up all cache accesses. |
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 UnicornPowers | |
def fire_super_ray_beam | |
ray_beam_power | |
end | |
def ray_beam_power | |
"pow" | |
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
vagrant@vserver16:/tmp/travis/builds/travis_ci/travis-ci$ bundle exec rake db:drop db:create db:migrate test --trace | |
rake aborted! | |
wrong argument type NilClass (expected Module) | |
kernel/common/native_method.rb:43:in `load_extension' | |
kernel/delta/codeloader.rb:180:in `load_library' | |
kernel/common/codeloader.rb:46:in `require' | |
kernel/common/codeloader.rb:145:in `require' | |
kernel/common/kernel.rb:781:in `require' | |
/home/vagrant/.rvm/gems/rbx-2.0.0pre/gems/json-1.4.6/lib/json/ext.rb:7:in `__module_init__ (Ext)' | |
/home/vagrant/.rvm/gems/rbx-2.0.0pre/gems/json-1.4.6/lib/json/ext.rb:6:in `__module_init__ (JSON)' |