bloomer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,2 @@
1
1
  source "http://rubygems.org"
2
2
  gemspec
3
-
4
- gem "rake"
5
- gem "yard"
6
- gem "rspec", '~> 2.7.0'
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
- # Bloomer: A Scalable pure-ruby Bloom filter
1
+ # Bloomer: Bloom filters with elastic
2
2
 
3
3
  [Bloom filters](http://en.wikipedia.org/wiki/Bloom_filter) are great for quickly checking to see if
4
4
  a given string has been seen before--in constant time, and using a fixed amount of RAM, as long
5
- as you know the expected number of elements up front.
5
+ as you know the expected number of elements up front. If you add more than ```capacity``` elements to the filter,
6
+ accuracy for ```include?``` will drop below ```false_positive_probability```.
6
7
 
7
- [Scalable Bloom Filters](http://gsd.di.uminho.pt/members/cbm/ps/dbloom.pdf) allow you to establish an
8
- initial capacity, but dynamically scale past that and maintain a false_positive_probability at the expense of
9
- growing the RAM requirements.
8
+ [Scalable Bloom Filters](http://gsd.di.uminho.pt/members/cbm/ps/dbloom.pdf) maintain a maximal ```false_positive_probability```
9
+ by using additional RAM as needed.
10
10
 
11
11
  ```Bloomer``` is a Bloom Filter. ```Bloomer::Scalable``` is a Scalable Bloom Filter.
12
12
 
13
- Keep in mind that false positives with Bloom Filters *are expected* with a specified probability rate.
13
+ Keep in mind that **false positives with Bloom filters are expected**, with a specified probability rate.
14
14
  False negatives, however, are not. In other words,
15
15
 
16
16
  * if ```include?``` returns *false*, that string has *certainly not* been ```add```ed
@@ -39,7 +39,7 @@ bf.include? "dog"
39
39
  #=> false
40
40
  ```
41
41
 
42
- Scalable Bloom filters use the same API:
42
+ Scalable Bloom filters uses the same API:
43
43
 
44
44
  ```ruby
45
45
  b = Bloomer::Scalable.new
@@ -48,6 +48,7 @@ b.include? "boom"
48
48
  #=> true
49
49
  bf.include? "badda"
50
50
  #=> false
51
+ ```
51
52
 
52
53
  Serialization is through [Marshal](http://ruby-doc.org/core-1.8.7/Marshal.html):
53
54
 
@@ -65,5 +66,5 @@ new_b.include? "a"
65
66
  * 0.0.1 Bloom, there it is.
66
67
  * 0.0.2 Switch to triple-hash chaining (simpler, faster, and better false-positive rate)
67
68
  * 0.0.3 Added support for scalable bloom filters (SBF)
68
-
69
+ * 0.0.4 Fixed gem packaging
69
70
 
data/bloomer.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
- require "bloomer"
4
+ require "bloomer/version"
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bloomer"
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Matthew McEachen"]
10
10
  s.email = ["matthew+github@mceachen.org"]
11
11
  s.homepage = "https://github.com/mceachen/bloomer"
12
- s.summary = %q{Pure-ruby scalable bloom filter}
13
- s.description = %q{Bloomer implements both simple Bloom filters as well as Scalable Bloom Filters (SBF), in pure ruby and with minimal external dependencies}
12
+ s.summary = %q{Bloom filters and Scalable Bloom filters (SBF) in pure ruby}
13
+ s.description = %q{Bloom filters and Scalable Bloom filters (SBF) in pure ruby}
14
14
 
15
15
  s.rubyforge_project = "bloomer"
16
16
 
@@ -20,4 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_dependency "bitarray"
23
+ s.add_development_dependency "rake"
24
+ s.add_development_dependency "yard"
25
+ s.add_development_dependency "rspec", "~> 2.7.0"
23
26
  end
data/lib/bloomer.rb CHANGED
@@ -2,8 +2,6 @@ require 'bitarray'
2
2
  require 'digest/md5'
3
3
 
4
4
  class Bloomer
5
- VERSION = "0.0.3"
6
-
7
5
  def initialize(capacity, false_positive_probability = 0.001)
8
6
  @capacity = capacity.round
9
7
  # m is the required number of bits in the array
@@ -0,0 +1,3 @@
1
+ class Bloomer
2
+ VERSION = "0.0.4"
3
+ end
data/spec/bloomer_spec.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "spec_helper"
2
- require "benchmark"
3
2
 
4
3
  C = ('a'..'z').to_a
5
4
  def rand_word(length = 8)
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rspec'
2
+ require 'bloomer'
2
3
 
3
4
  RSpec.configure do |config|
4
5
  config.color_enabled = true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloomer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew McEachen
@@ -15,11 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-21 00:00:00 -08:00
19
- default_executable:
18
+ date: 2012-01-22 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  prerelease: false
22
+ type: :runtime
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
@@ -29,10 +29,53 @@ dependencies:
29
29
  segments:
30
30
  - 0
31
31
  version: "0"
32
- type: :runtime
33
32
  name: bitarray
34
33
  version_requirements: *id001
35
- description: Bloomer implements both simple Bloom filters as well as Scalable Bloom Filters (SBF), in pure ruby and with minimal external dependencies
34
+ - !ruby/object:Gem::Dependency
35
+ prerelease: false
36
+ type: :development
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ name: rake
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ prerelease: false
50
+ type: :development
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ name: yard
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ prerelease: false
64
+ type: :development
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ hash: 19
71
+ segments:
72
+ - 2
73
+ - 7
74
+ - 0
75
+ version: 2.7.0
76
+ name: rspec
77
+ version_requirements: *id004
78
+ description: Bloom filters and Scalable Bloom filters (SBF) in pure ruby
36
79
  email:
37
80
  - matthew+github@mceachen.org
38
81
  executables: []
@@ -49,9 +92,9 @@ files:
49
92
  - Rakefile
50
93
  - bloomer.gemspec
51
94
  - lib/bloomer.rb
95
+ - lib/bloomer/version.rb
52
96
  - spec/bloomer_spec.rb
53
97
  - spec/spec_helper.rb
54
- has_rdoc: true
55
98
  homepage: https://github.com/mceachen/bloomer
56
99
  licenses: []
57
100
 
@@ -81,10 +124,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
124
  requirements: []
82
125
 
83
126
  rubyforge_project: bloomer
84
- rubygems_version: 1.6.2
127
+ rubygems_version: 1.8.15
85
128
  signing_key:
86
129
  specification_version: 3
87
- summary: Pure-ruby scalable bloom filter
130
+ summary: Bloom filters and Scalable Bloom filters (SBF) in pure ruby
88
131
  test_files:
89
132
  - spec/bloomer_spec.rb
90
133
  - spec/spec_helper.rb
134
+ has_rdoc: