bloom_filter 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
data/bloom_filter.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bloom_filter}
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Arya Asemanfar"]
@@ -1,6 +1,7 @@
1
1
  class BloomFilter
2
2
  class BitVector
3
3
  attr_reader :size
4
+ IS_RUBY_19 = RUBY_VERSION >= '1.9'
4
5
 
5
6
  def initialize(bits, from_str = nil)
6
7
  @bytes = Array.new((bits.to_f / 8).ceil, 0)
@@ -8,7 +9,7 @@ class BloomFilter
8
9
 
9
10
  if from_str
10
11
  from_str.size.times do |i|
11
- @bytes[i] = from_str[i].ord
12
+ @bytes[i] = IS_RUBY_19 ? from_str[i].ord : from_str[i]
12
13
  end
13
14
  end
14
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloom_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arya Asemanfar