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
From 184e3de1046884dcf6467d19cf73a7eb65f811f5 Mon Sep 17 00:00:00 2001 | |
From: Robert Jackson <[email protected]> | |
Date: Thu, 19 May 2011 18:02:00 -0400 | |
Subject: [PATCH 1/2] Add RubySpec for Time#strptime. | |
--- | |
spec/ruby/library/time/strptime_spec.rb | 12 ++++++++++++ | |
1 files changed, 12 insertions(+), 0 deletions(-) | |
create mode 100644 spec/ruby/library/time/strptime_spec.rb |
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
➜ cassandra git:(master) ✗ ruby test/cassandra_test.rb -n test_remove_super_sub_key | |
Loaded suite test/cassandra_test | |
Started | |
. | |
Finished in 0.212645 seconds. | |
1 tests, 1 assertions, 0 failures, 0 errors | |
➜ cassandra git:(master) ✗ ruby test/cassandra_test.rb -n test_remove_super_sub_key | |
Loaded suite test/cassandra_test | |
Started |
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
DEBUG 21:01:27,166 computing ranges for 118913266174357844299523244095729587344 | |
DEBUG 21:01:27,168 logged out: #<User allow_all groups=[]> | |
DEBUG 21:01:27,226 truncating Users in Twitter | |
DEBUG 21:01:27,227 Starting a blocking truncate operation on keyspace Twitter, CF | |
DEBUG 21:01:27,227 Starting to send truncate messages to hosts [localhost/127.0.0.1] | |
DEBUG 21:01:27,227 Sent all truncate messages, now waiting for 1 responses | |
DEBUG 21:01:27,227 Applying Truncation(keyspace='Twitter', cf='Users') | |
DEBUG 21:01:27,227 Truncating... | |
DEBUG 21:01:27,227 forceFlush requested but everything is clean | |
DEBUG 21:01:27,228 forceFlush requested but everything is clean |
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 :rubygems | |
gem 'rake' | |
gem 'forgery' | |
gem 'cassandra-cql', :path => '../cassandra-cql' | |
gem 'cassandra', :path => '../cassandra' | |
gem 'perftools.rb' | |
gem 'rbtrace' |
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 MethodMissingTest | |
def method_missing(method_name, *args, &block) | |
puts 'Method Called: ' + method_name.to_s | |
puts 'Arguments: ' + args.to_s | |
puts 'Block Given: ' + block_given?.to_s | |
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
begin | |
require 'oily_png' | |
rescue LoadError | |
require 'chunky_png' | |
end | |
require 'bigdecimal' | |
class ChunkyPNG::Image | |
def neighbors(x,y) | |
[[x, y-1], [x+1, y], [x, y+1], [x-1, y]].select do |xy| |
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 'java' | |
require 'jt400' | |
require 'date' | |
require 'bigdecimal' | |
java_import 'com.ibm.as400.access.AS400JDBCDriver' | |
def get_records | |
@connection ||= java.sql.DriverManager.get_connection("jdbc:as400://127.0.0.1/",'username','password') | |
rs = @connection.createStatement.executeQuery("SELECT * FROM RANDOM_TABLE") |
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 'pp' | |
require 'pry' | |
require 'hippo' | |
def wrap_text(text, max_width, wrap_string = "\n") | |
if text.length <= max_width | |
text | |
else | |
text.scan(/.{1,#{max_width}}/).join(wrap_string) | |
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
Pry.config.commands.command "reload", "Reload all ruby files in the given directory (defaults to Dir.pwd) that have been loaded." do |*args| | |
args = [Dir.pwd] if args.empty? | |
$LOADED_FEATURES.each do |feature| | |
if args.any?{|dir| feature =~ /#{dir}/} && feature.end_with?('.rb') | |
load feature | |
output.puts "Reloaded: #{feature}." | |
end | |
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
pconsole () { | |
if [[ -e ./config/environment.rb ]]; | |
then | |
rails_env="development" | |
if [[ "$1z" != "z" ]]; then rails_env=$1; fi; | |
RAILS_ENV=$rails_env pry -r ./config/environment.rb -r rails/console/app -r rails/console/helpers; | |
else pry; | |
fi | |
} |
OlderNewer