Installation with RVM:
$ rvm install 2.2.3 --patch https://gist.githubusercontent.com/tdg5/0fba32242ccc39e71577/raw/b0d869e006761c74dac4ed9dbb779a56b424b63c/ruby_tco.patch
require "tco_method" | |
# Wrap method definitons in a lambda to facilitate recompiling with tail call | |
# optimization enabled. | |
tail_calls = lambda do |this| | |
def start_tail_call_chain | |
implicit_tail_call | |
end | |
def implicit_tail_call |
/* | |
https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L523 | |
*/ | |
private void doCleanupCompaction(final ColumnFamilyStore cfs, Collection<SSTableReader> sstables, CounterId.OneShotRenewer renewer) throws IOException | |
{ | |
assert !cfs.isIndex(); | |
Keyspace keyspace = cfs.keyspace; | |
Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(keyspace.getName()); | |
if (ranges.isEmpty()) | |
{ |
Installation with RVM:
$ rvm install 2.2.3 --patch https://gist.githubusercontent.com/tdg5/0fba32242ccc39e71577/raw/b0d869e006761c74dac4ed9dbb779a56b424b63c/ruby_tco.patch
diff --git a/dat.h b/dat.h | |
index 2570e76..ac6f6e7 100644 | |
--- a/dat.h | |
+++ b/dat.h | |
@@ -204,6 +204,9 @@ void job_free(job j); | |
/* Lookup a job by job ID */ | |
job job_find(uint64 job_id); | |
+/* Lookup oldest job */ | |
+job job_oldest(); |
<% | |
# Generate lookup Hash of fingerprinted filenames for html templates | |
# Leave regexp open ended to include preprocessed templates (.erb, etc.) | |
template_regexp = /(?:\/assets\/templates\/)(.*\.html)/ | |
template_files = Rails.application.assets.each_file.to_a.join("\n").scan(template_regexp).flatten | |
templates = Hash[template_files.map {|file| [file, asset_url(file)] }] | |
%> | |
var fingerprintedTemplates = angular.module('services.fingerprintedTemplates', []); | |
fingerprintedTemplates.factory('fingerprintedTemplates', [ |
module Concerns | |
module Mocha | |
module CallsThrough | |
def calls_through | |
method_name = @method_matcher.expected_method_name | |
@mock.instance_variable_get(:@receiver) | |
@original_method = @mock.instance_variable_get(:@mockery).stubba.stubba_methods.find do |mockery| | |
mockery.method == method_name | |
end.instance_variable_get(:@original_method) | |
self |