Permalink
Browse files

Switched get_indexed_slices to return an Ordered Hash

Fixes #110.  All tests now pass on 1.8.
  • Loading branch information...
1 parent 9ec88af commit c5f9abce159097821c0e3a5589834514efd70bac @natemueller natemueller committed Aug 12, 2012
Showing with 10 additions and 4 deletions.
  1. +4 −0 CHANGELOG
  2. +2 −2 cassandra.gemspec
  3. +2 −0 lib/.gitignore
  4. +1 −1 lib/cassandra/cassandra.rb
  5. +1 −1 lib/cassandra/mock.rb
  6. BIN lib/cassandra_native.bundle
View
@@ -1,3 +1,7 @@
+v0.15.0
+- Fixes for ruby 1.8 (issue #158, courtesy @jarib)
+- get_indexed_slices returns an OrderedHash (issue #110)
+
v0.14.0
- Numerous performance improvements (courtesy @nearbuy)
- Fixed many 0.6 bugs
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = "cassandra"
- s.version = "0.14.0"
+ s.version = "0.15.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
s.authors = ["Evan Weaver, Ryan King"]
- s.date = "2012-08-05"
+ s.date = "2012-09-12"
s.description = "A Ruby client for the Cassandra distributed database."
s.email = ""
s.executables = ["cassandra_helper"]
View
@@ -0,0 +1,2 @@
+*.bundle
+*.so
@@ -991,7 +991,7 @@ def get_indexed_slices(column_family, index_clause, *columns_and_options)
key_slices = _get_indexed_slices(column_family, index_clause, columns, options[:count], options[:start],
options[:finish], options[:reversed], options[:consistency])
- key_slices.inject({}){|h, key_slice| h[key_slice.key] = key_slice.columns; h}
+ key_slices.inject(OrderedHash.new) {|h, key_slice| h[key_slice.key] = key_slice.columns; h }
end
protected
@@ -304,7 +304,7 @@ def get_indexed_slices(column_family, idx_clause, *columns_and_options)
idx_clause = create_index_clause(idx_clause, start_key, options[:key_count])
end
- ret = {}
+ ret = OrderedHash.new
cf(column_family).each do |key, row|
next if idx_clause[:start] != '' && key < idx_clause[:start]
next if ret.length == idx_clause[:count]
Binary file not shown.

0 comments on commit c5f9abc

Please sign in to comment.