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 Taco | |
> def self.delicious? ; true ; end | |
> singleton_class.send :alias_method, :yummy?, :delicious? | |
> end | |
=> #<Class:Taco> | |
> Taco.yummy? | |
=> true |
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
for i in app/models/*.rb ; do sed "s/\s\+def \(self\.\)\?\([^( ]*\).*\|\s\+scope :\([^,]*\).*/\2\3/;tx;d;:x" $i | while read j ; do echo $(grep -R $j app/ lib/ config/ | wc -l) $j ; done ; done | sort -rn |
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
--- rspec-expectations/lib/rspec/expectations/diff_presenter.rb 2014-03-23 23:31:14.214580118 -0700 | |
+++ rspec-support/lib/rspec/support/diff_presenter.rb 2014-03-23 23:27:18.402592651 -0700 | |
@@ -1,14 +1,26 @@ | |
-require 'diff/lcs' | |
-require 'diff/lcs/hunk' | |
+require "rspec/support/encoded_string" | |
+require "rspec/support/differ" | |
require 'pp' | |
-RSpec::Support.require_rspec_expectations "encoded_string" | |
-RSpec::Support.require_rspec_expectations "differ" |
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/rspec-support/spec/rspec/support/differ_spec.rb b/rspec-expectations/spec/rspec/expectations/diff_presenter_spec.rb | |
index 69b1237..0c19de4 100644 | |
--- a/rspec-support/spec/rspec/support/differ_spec.rb | |
+++ b/rspec-expectations/spec/rspec/expectations/diff_presenter_spec.rb | |
@@ -1,18 +1,21 @@ | |
# encoding: utf-8 | |
-require 'spec_helper' | |
require 'ostruct' | |
module RSpec |
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/rspec-support/lib/rspec/support/differ.rb b/rspec-expectations/lib/rspec/expectations/diff_presenter.rb | |
index 26da8d8..dd6e95d 100644 | |
--- a/rspec-support/lib/rspec/support/differ.rb | |
+++ b/rspec-expectations/lib/rspec/expectations/diff_presenter.rb | |
@@ -1,27 +1,14 @@ | |
-RSpec::Support.require_rspec_support 'encoded_string' | |
-RSpec::Support.require_rspec_support 'hunk_generator' | |
- | |
+require 'diff/lcs' | |
+require 'diff/lcs/hunk' |
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/rspec-support/lib/rspec/support/encoded_string.rb b/rspec-expectations/lib/rspec/expectations/encoded_string.rb | |
index 654a208..eeb0b16 100644 | |
--- a/rspec-support/lib/rspec/support/encoded_string.rb | |
+++ b/rspec-expectations/lib/rspec/expectations/encoded_string.rb | |
@@ -1,5 +1,5 @@ | |
module RSpec | |
- module Support | |
+ module Expectations | |
# @private | |
class EncodedString |
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/rspec-support/spec/rspec/support/encoded_string_spec.rb b/rspec-expectations/spec/rspec/expectations/encoded_string_spec.rb | |
index a9d4052..95b2f97 100644 | |
--- a/rspec-support/spec/rspec/support/encoded_string_spec.rb | |
+++ b/rspec-expectations/spec/rspec/expectations/encoded_string_spec.rb | |
@@ -1,6 +1,4 @@ | |
-require 'spec_helper' | |
- | |
-module RSpec::Support | |
+module RSpec::Expectations | |
describe EncodedString do |
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/rspec-support/lib/rspec/support/hunk_generator.rb b/rspec-expectations/lib/rspec/expectations/differ.rb | |
index 5b0d68d..cef9a1f 100644 | |
--- a/rspec-support/lib/rspec/support/hunk_generator.rb | |
+++ b/rspec-expectations/lib/rspec/expectations/differ.rb | |
@@ -1,10 +1,7 @@ | |
-require 'diff/lcs' | |
-require 'diff/lcs/hunk' | |
- | |
module RSpec | |
- module Support |
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
> elements = {a1: 'a', b1: 'b', b2: 'b', b3: 'b', c1: 'c'} | |
=> {:a1=>"a", :b1=>"b", :b2=>"b", :b3=>"b", :c1=>"c"} | |
> elements.group_by {|(_, val)| val }.flat_map {|(_, vals)| vals.shuffle } | |
=> [[:a1, "a"], [:b2, "b"], [:b3, "b"], [:b1, "b"], [:c1, "c"]] | |
> elements.group_by {|(_, val)| val }.flat_map {|(_, vals)| vals.shuffle } | |
=> [[:a1, "a"], [:b1, "b"], [:b3, "b"], [:b2, "b"], [:c1, "c"]] | |
> elements.group_by {|(_, val)| val }.flat_map {|(_, vals)| vals.shuffle } | |
=> [[:a1, "a"], [:b1, "b"], [:b3, "b"], [:b2, "b"], [:c1, "c"]] | |
> elements.group_by {|(_, val)| val }.flat_map {|(_, vals)| vals.shuffle } | |
=> [[:a1, "a"], [:b2, "b"], [:b1, "b"], [:b3, "b"], [:c1, "c"]] |
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
test_error.rb:3: [BUG] Segmentation fault at 0x00000000000000 | |
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux] | |
-- Control frame information ----------------------------------------------- | |
c:0005 p:---- s:0012 e:000011 CFUNC :inspect | |
c:0004 p:---- s:0010 e:000009 CFUNC :inspect | |
c:0003 p:---- s:0008 e:000007 CFUNC :p | |
c:0002 p:0024 s:0004 E:001dc8 EVAL test_error.rb:3 [FINISH] | |
c:0001 p:0000 s:0002 E:001f18 TOP [FINISH] |
OlderNewer