This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Given multiple regular expressions and a string to match them | |
# against, call a method on a receiver that corresponds to the matched | |
# expression. | |
# | |
# see example.rb | |
class BigPatternMatcher |
This file contains hidden or 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
Note: This is the output of "bundle env" _after_ the test script has run. The Gemfile and Gemfile.lock therefore show the modified state of those two file, not their original state. | |
Bundler 1.3.5 | |
Ruby 1.9.3 (2013-06-27 patchlevel 448) [i686-linux] | |
Rubygems 2.0.7 | |
rvm 1.22.9 (stable) | |
GEM_HOME /home/wayne/.rvm/gems/ruby-1.9.3-p448 | |
GEM_PATH /home/wayne/.rvm/gems/ruby-1.9.3-p448:/home/wayne/.rvm/gems/ruby-1.9.3-p448@global | |
Bundler settings |
This file contains hidden or 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
describe "#remove_some_colons" do | |
it "should preserve an empty string" do | |
expect(remove_some_colons("")).to eq "" | |
end | |
it "should remove a lone colon" do | |
expect(remove_some_colons(":")).to eq "" | |
end |
This file contains hidden or 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
TEXT = <<EOF | |
See, the interesting thing about this text | |
is that while it seems like the first line defines an indent | |
it's actually the last line which has the smallest indent | |
there are also some blank lines | |
both with and without extra spaces in them | |
and it just goes on and on |
This file contains hidden or 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
gem "composite_primary_keys", "7.0.13" | |
gem 'activerecord', '4.1.9' | |
gem 'sqlite3' | |
require "composite_primary_keys" | |
require 'active_record' | |
require 'logger' | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains hidden or 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 "activerecord", "4.1.9" | |
gem "activerecord-oracle_enhanced-adapter", "1.5.5" | |
gem "ruby-oci8" | |
gem "arel", "5.0.1.20140414130214" |
This file contains hidden or 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 "activerecord", "~> 4.2.0" | |
gem "activerecord-oracle_enhanced-adapter", | |
git: '[email protected]:rsim/oracle-enhanced.git', | |
branch: 'rails42', | |
ref: '518dc3cf6a1f6e3593751d30d392518dc69d1a3a' | |
gem "ruby-oci8" | |
gem "arel", "~> 6.0.0" |
This file contains hidden or 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
# expr ::= factor ( addop factor ) * | |
# addop ::= '+' | '-' | |
# factor ::= signed_term ( mulop signed_term ) * | |
# mulop ::= '*' | '/' | |
# signed_term = '-' ? term | |
# term ::= number | '(' expr ')' | |
# number ::= /[+-]\d+(\.\d*)?/ | |
require "strscan" |
This file contains hidden or 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
wayne@treebeard:~/work1$ time gitalytics | |
Carl McNealy has made 1690 commits between 286 days. He/she did something useful on 221 of those days. | |
Production has made 2461 commits between 2274 days. He/she did something useful on 107 of those days. | |
Wayne Conrad has made 8505 commits between 2265 days. He/she did something useful on 1153 of those days. | |
Brian Stemshorn has made 358 commits between 361 days. He/she did something useful on 132 of those days. | |
Julie Peters has made 17 commits between 274 days. He/she did something useful on 7 of those days. | |
Sam Kellogg has made 33 commits between 238 days. He/she did something useful on 23 of those days. | |
Production User has made 1 commits between 1 days. He/she did something useful on 1 of those days. | |
brians has made 4 commits between 2 days. He/she did something useful on 2 of those days. | |
devel has made 17 commits between 391 days. He/she did something useful on 5 of those days. |
This file contains hidden or 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
it "does only one query" do | |
connection = Dest::Base.connection | |
def connection.query_count | |
@query_count || 0 | |
end | |
def connection.exec_query(*args) | |
@query_count ||= 0 | |
@query_count += 1 | |
super | |
end |
OlderNewer