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/debride.rb b/lib/debride.rb | |
index 54e2f4f..7730457 100755 | |
--- a/lib/debride.rb | |
+++ b/lib/debride.rb | |
@@ -35,31 +35,36 @@ class Debride < MethodBasedSexpProcessor | |
end | |
def self.load_plugins proj = PROJECT | |
- unless defined? @@plugins then | |
- @@plugins = [] |
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 'spec_helper' | |
describe User do | |
it "should blow up" do | |
expect(User).to receive(:create!).and_raise(ActiveRecord::RecordNotUnique) | |
end | |
end | |
=begin | |
Fails with: |
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
Failure/Error: expect(View).to receive(:create!).and_raise(ActiveRecord::RecordNotUnique) | |
ArgumentError: | |
wrong number of arguments (0 for 2) |
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 Kernel | |
def method_a | |
:foo | |
end | |
end | |
def method_b | |
:bar | |
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
module Kernel | |
def required(arg=nil) | |
method = caller_locations(1,1)[0].label | |
raise ArgumentError.new("required parameter #{arg.to_sym.inspect + ' ' if arg}not passed to method #{method}") | |
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
require 'net/http' | |
require 'json' | |
require 'uri' | |
require 'pp' | |
uri = URI(ARGV[0]) | |
pp JSON.parse(Net::HTTP.get_response(uri).body) |
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_record' | |
require 'sqlite3' | |
require 'minitest/autorun' | |
puts "ActiveRecord: #{ActiveRecord::VERSION::STRING}" | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" | |
) |
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
[11:30:26 rdoc (master u=)]$ gem list | |
*** LOCAL GEMS *** | |
bundler (1.3.5, 1.1.5, 1.1.3) | |
hoe (3.5.3) | |
rake (10.0.4, 0.9.2.2) | |
rubygems-bundler (1.1.1, 1.0.7, 1.0.1, 1.0.0) | |
rvm (1.11.3.5) | |
[11:30:29 rdoc (master u=)]$ rake newb |
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 -I. -Ilib/ -w map_symbol_bench.rb | |
Rehearsal -------------------------------------------- | |
nil 0.050000 0.000000 0.050000 ( 0.046891) | |
identity 0.880000 0.000000 0.880000 ( 0.887874) | |
block 1.080000 0.000000 1.080000 ( 1.078556) | |
to_proc 0.990000 0.000000 0.990000 ( 0.996956) | |
----------------------------------- total: 3.000000sec | |
user system total real | |
nil 0.040000 0.000000 0.040000 ( 0.045237) |
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
Hello ruby friends, | |
Next Tuesday night is Seattle.rb's monthly talkie meetup! Things will be going as planned with one big exception: | |
Ryan, Aja and I will all be travelling to Mountain West Ruby Conf that night. Don't worry though, two of my Substantial | |
coworkers have offered to host in my stead. Cassie Schmitz and Shawn Dempsey will be the ones who will let you in the door, | |
tell you the wifi password, direct you towards the restrooms and urge you to leave at the end. Everything else will be the | |
same, although I cannot promise you'll hear another of Aaron's thrilling tales of candy purchasing. | |
Let me know if you have questions or concerns! |