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
context "benchmark" do | |
setup do | |
@versions = create_list :version, Dependency::LIMIT | |
@versions.each { |version| create(:dependency, :version => version) } | |
@names = @versions.map(&:rubygem).map(&:name) | |
@gems = @names.join(',') | |
@cache = V1MarshaledDepedencies::CACHE | |
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
diff --git a/Rakefile b/Rakefile | |
index 2f8080a..5b78578 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -21,6 +21,7 @@ end | |
if defined?(JRUBY_VERSION) | |
require 'ant' | |
+ require 'rbconfig' | |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'rack' | |
gem 'sass' | |
gem 'sinatra', require: 'sinatra/base' | |
gem 'thin' |
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
source 'https://rubygems.org' | |
gem 'rails', '~> 4.2.0' | |
gem 'pry-byebug' |
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 'pathname' | |
require 'fileutils' | |
noop = true | |
gemsets = File.expand_path '~/.rbenv/versions/2.0.0-p247/gemsets' | |
gem_paths = {} | |
(Dir.entries(gemsets) - %w[. .. common] + [File.expand_path('~/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0')]).each do |entry| | |
path = gemsets + '/' + entry + '/gems' | |
next unless Pathname(path).directory? |
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
begin | |
class Capybara::Poltergeist::NetworkTraffic::Response | |
def stage | |
@data['stage'] | |
end | |
end | |
poltergeist_drivers = Capybara | |
.send(:session_pool) | |
.each_value.map(&:driver) |
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 'benchmark' | |
module Enumerable | |
def measure(*arg) | |
raise ArgumentError if block_given? | |
Enumerator.new self, :__measure__, *arg | |
end | |
private |
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 Proc | |
def measure | |
class << self | |
alias_method :call_without_measure, :call | |
alias_method :call, :call_with_measure | |
public :call | |
end | |
self | |
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 ProcessMan | |
def initialize | |
@watches = {} | |
@blocks = [] | |
@break = false | |
@master = true | |
end | |
def register(&block) | |
@blocks << block |
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 Capybara | |
module Anigif | |
HOOK_METHODS = [ | |
:attach_file, | |
:check, | |
:choose, | |
:click_link_or_button, | |
:click_button, | |
:click_link, | |
:fill_in, |