forked from cassandra-rb/cassandra
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into thrift_di
- Loading branch information
Showing
5 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{cassandra} | ||
s.version = "0.8.0" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Evan Weaver, Ryan King"] | ||
s.cert_chain = ["/Users/ryan/.gemkeys/gem-public_cert.pem"] | ||
s.date = %q{2010-03-23} | ||
s.default_executable = %q{cassandra_helper} | ||
s.description = %q{A Ruby client for the Cassandra distributed database.} | ||
s.email = %q{} | ||
s.executables = ["cassandra_helper"] | ||
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "bin/cassandra_helper", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb"] | ||
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "bin/cassandra_helper", "conf/cassandra.in.sh", "conf/log4j.properties", "conf/storage-conf.xml", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb", "test/cassandra_client_test.rb", "test/cassandra_mock_test.rb", "test/cassandra_test.rb", "test/comparable_types_test.rb", "test/ordered_hash_test.rb", "test/test_helper.rb", "vendor/gen-rb/cassandra.rb", "vendor/gen-rb/cassandra_constants.rb", "vendor/gen-rb/cassandra_types.rb", "cassandra.gemspec"] | ||
s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/cassandra/} | ||
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cassandra", "--main", "README.rdoc"] | ||
s.require_paths = ["lib"] | ||
s.rubyforge_project = %q{fauna} | ||
s.rubygems_version = %q{1.3.5} | ||
s.signing_key = %q{/Users/ryan/.gemkeys/gem-private_key.pem} | ||
s.summary = %q{A Ruby client for the Cassandra distributed database.} | ||
s.test_files = ["test/cassandra_client_test.rb", "test/cassandra_mock_test.rb", "test/cassandra_test.rb", "test/comparable_types_test.rb", "test/ordered_hash_test.rb", "test/test_helper.rb"] | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<thrift_client>, [">= 0.4.0"]) | ||
s.add_runtime_dependency(%q<json>, [">= 0"]) | ||
s.add_runtime_dependency(%q<rake>, [">= 0"]) | ||
s.add_runtime_dependency(%q<simple_uuid>, [">= 0.1.0"]) | ||
else | ||
s.add_dependency(%q<thrift_client>, [">= 0.4.0"]) | ||
s.add_dependency(%q<json>, [">= 0"]) | ||
s.add_dependency(%q<rake>, [">= 0"]) | ||
s.add_dependency(%q<simple_uuid>, [">= 0.1.0"]) | ||
end | ||
else | ||
s.add_dependency(%q<thrift_client>, [">= 0.4.0"]) | ||
s.add_dependency(%q<json>, [">= 0"]) | ||
s.add_dependency(%q<rake>, [">= 0"]) | ||
s.add_dependency(%q<simple_uuid>, [">= 0.1.0"]) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/test_helper') | ||
|
||
if RUBY_VERSION < '1.9' | ||
puts "Skipping EventMachine test" | ||
else | ||
|
||
require 'thrift_client/event_machine' | ||
|
||
class EventmachineTest < Test::Unit::TestCase | ||
|
||
def test_twitter | ||
@twitter = Cassandra.new('Twitter', "127.0.0.1:9160", :retries => 2, :exception_classes => [], :transport => Thrift::EventMachineTransport, :transport_wrapper => nil) | ||
@twitter.clear_keyspace! | ||
end | ||
|
||
private | ||
|
||
def em_test(name) | ||
EM.run do | ||
Fiber.new do | ||
begin | ||
send("raw_#{name}".to_sym) | ||
ensure | ||
EM.stop | ||
end | ||
end.resume | ||
end | ||
end | ||
|
||
def self.wrap_tests | ||
self.public_instance_methods.select { |m| m =~ /^test_/ }.each do |meth| | ||
alias_method :"raw_#{meth}", meth | ||
define_method(meth) do | ||
em_test(meth) | ||
end | ||
end | ||
end | ||
|
||
wrap_tests | ||
|
||
end | ||
end |