bloomer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ script: bundle exec rake
3
+ rvm:
4
+ - 1.8.7
5
+ - 1.9.3
6
+ - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Bloomer: Bloom filters with elastic
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/mceachen/bloomer.png)](http://travis-ci.org/mceachen/bloomer)
4
+
3
5
  [Bloom filters](http://en.wikipedia.org/wiki/Bloom_filter) are great for quickly checking to see if
4
6
  a given string has been seen before--in constant time, and using a fixed amount of RAM, as long
5
7
  as you know the expected number of elements up front. If you add more than ```capacity``` elements to the filter,
@@ -61,10 +63,19 @@ new_b.include? "a"
61
63
  #=> true
62
64
  ```
63
65
 
64
- ## History
66
+ ## Changelog
67
+
68
+ ### 0.0.5
69
+ * Switched from rspec to minitest
70
+
71
+ ### 0.0.4
72
+ * Fixed gem packaging
73
+
74
+ ### 0.0.3
75
+ * Added support for scalable bloom filters (SBF)
65
76
 
66
- * 0.0.1 Bloom, there it is.
67
- * 0.0.2 Switch to triple-hash chaining (simpler, faster, and better false-positive rate)
68
- * 0.0.3 Added support for scalable bloom filters (SBF)
69
- * 0.0.4 Fixed gem packaging
77
+ ### 0.0.2
78
+ * Switch to triple-hash chaining (simpler, faster, and better false-positive rate)
70
79
 
80
+ ### 0.0.1
81
+ * Bloom, there it is.
data/Rakefile CHANGED
@@ -4,7 +4,13 @@ YARD::Rake::YardocTask.new do |t|
4
4
  t.files = ['lib/**/*.rb', 'README.md']
5
5
  end
6
6
 
7
- require "rspec/core/rake_task"
8
- RSpec::Core::RakeTask.new(:spec)
7
+ require 'rake/testtask'
9
8
 
10
- task :default => :spec
9
+ Rake::TestTask.new do |t|
10
+ t.libs.push "lib"
11
+ t.libs.push "test"
12
+ t.pattern = 'test/**/*_test.rb'
13
+ t.verbose = true
14
+ end
15
+
16
+ task :default => :test
@@ -22,5 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency "bitarray"
23
23
  s.add_development_dependency "rake"
24
24
  s.add_development_dependency "yard"
25
- s.add_development_dependency "rspec", "~> 2.7.0"
25
+ s.add_development_dependency "minitest"
26
+ s.add_development_dependency "minitest-reporters"
26
27
  end
@@ -1,3 +1,3 @@
1
1
  class Bloomer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,4 +1,4 @@
1
- require "spec_helper"
1
+ require "test_helper"
2
2
 
3
3
  C = ('a'..'z').to_a
4
4
  def rand_word(length = 8)
@@ -12,7 +12,7 @@ def test_bloom(size, max_false_prob, bloom)
12
12
  bloom.add(w)
13
13
  set.add(w)
14
14
  end
15
- set.each { |ea| bloom.include?(ea).should be_true }
15
+ set.each { |ea| bloom.must_include(ea) }
16
16
  tries = size * 3
17
17
  false_hits = 0
18
18
  hits = 0
@@ -38,37 +38,37 @@ def test_marshal_state(b)
38
38
  inputs = b.capacity.times.collect { rand_word }
39
39
  inputs.each { |ea| b.add(ea) }
40
40
  new_b = Marshal.load(Marshal.dump(b))
41
- new_b.count.should == b.count
42
- new_b.capacity.should == b.capacity
43
- inputs.each { |ea| new_b.should include(ea) }
41
+ new_b.count.must_equal b.count
42
+ new_b.capacity.must_equal b.capacity
43
+ inputs.each { |ea| new_b.must_include(ea) }
44
44
  end
45
45
 
46
46
  def test_simple(b)
47
- b.add("a").should be_true
48
- b.add("a").should be_false
49
- b.should include("a")
50
- b.should_not include("")
51
- b.should_not include("b")
52
- b.add("b").should be_true
53
- b.add("b").should be_false
54
- b.should include("b")
55
- b.should_not include("")
47
+ b.add("a").must_equal true
48
+ b.add("a").must_equal false
49
+ b.must_include("a")
50
+ b.wont_include("")
51
+ b.wont_include("b")
52
+ b.add("b").must_equal true
53
+ b.add("b").must_equal false
54
+ b.must_include("b")
55
+ b.wont_include("")
56
56
  b.add("")
57
- b.should include("")
57
+ b.must_include("")
58
58
  end
59
59
 
60
60
  describe Bloomer do
61
- it "should work trivially" do
61
+ it "works trivially" do
62
62
  b = Bloomer.new(10, 0.001)
63
63
  test_simple(b)
64
64
  end
65
65
 
66
- it "should marshal state correctly" do
66
+ it "marshals state correctly" do
67
67
  b = Bloomer.new(10, 0.001)
68
68
  test_marshal_state(b)
69
69
  end
70
70
 
71
- it "should result in similar-to-expected false positives" do
71
+ it "results in similar-to-expected false positives" do
72
72
  max_false_prob = 0.001
73
73
  size = 50_000
74
74
  b = Bloomer.new(size, max_false_prob)
@@ -77,25 +77,25 @@ describe Bloomer do
77
77
  end
78
78
 
79
79
  describe Bloomer::Scalable do
80
- it "should work trivially" do
80
+ it "works trivially" do
81
81
  b = Bloomer::Scalable.new
82
82
  test_simple(b)
83
83
  end
84
84
 
85
- it "should marshal state correctly" do
85
+ it "marshals state correctly" do
86
86
  b = Bloomer::Scalable.new(10, 0.001)
87
87
  100.times.each { b.add(rand_word) }
88
88
  test_marshal_state(b)
89
89
  end
90
90
 
91
- it "should result in similar-to-expected false positives" do
91
+ it "results in similar-to-expected false positives" do
92
92
  max_false_prob = 0.001
93
93
  size = 10_000
94
94
  b = Bloomer::Scalable.new(1024, max_false_prob)
95
95
  test_bloom(size, max_false_prob, b)
96
96
  end
97
97
 
98
- it "should result in similar-to-expected false positives" do
98
+ it "results in similar-to-expected false positives" do
99
99
  max_false_prob = 0.01
100
100
  size = 50_000
101
101
  b = Bloomer::Scalable.new(1024, max_false_prob)
@@ -0,0 +1,2 @@
1
+ require 'minitest/autorun'
2
+ require 'bloomer'
metadata CHANGED
@@ -1,91 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bloomer
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 4
10
- version: 0.0.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Matthew McEachen
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-22 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
12
+ date: 2012-04-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
32
15
  name: bitarray
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
35
23
  prerelease: false
36
- type: :development
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
38
25
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
46
31
  name: rake
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- prerelease: false
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
50
38
  type: :development
51
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
52
41
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
60
47
  name: yard
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
63
55
  prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: minitest
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
64
70
  type: :development
65
- requirement: &id004 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: minitest-reporters
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
66
89
  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
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
78
94
  description: Bloom filters and Scalable Bloom filters (SBF) in pure ruby
79
- email:
95
+ email:
80
96
  - matthew+github@mceachen.org
81
97
  executables: []
82
-
83
98
  extensions: []
84
-
85
99
  extra_rdoc_files: []
86
-
87
- files:
100
+ files:
88
101
  - .gitignore
102
+ - .travis.yml
89
103
  - Gemfile
90
104
  - MIT-LICENSE
91
105
  - README.md
@@ -93,42 +107,39 @@ files:
93
107
  - bloomer.gemspec
94
108
  - lib/bloomer.rb
95
109
  - lib/bloomer/version.rb
96
- - spec/bloomer_spec.rb
97
- - spec/spec_helper.rb
110
+ - test/bloomer_test.rb
111
+ - test/test_helper.rb
98
112
  homepage: https://github.com/mceachen/bloomer
99
113
  licenses: []
100
-
101
114
  post_install_message:
102
115
  rdoc_options: []
103
-
104
- require_paths:
116
+ require_paths:
105
117
  - lib
106
- required_ruby_version: !ruby/object:Gem::Requirement
118
+ required_ruby_version: !ruby/object:Gem::Requirement
107
119
  none: false
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- hash: 3
112
- segments:
120
+ requirements:
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ segments:
113
125
  - 0
114
- version: "0"
115
- required_rubygems_version: !ruby/object:Gem::Requirement
126
+ hash: 2624379326334183946
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
128
  none: false
117
- requirements:
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- hash: 3
121
- segments:
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ segments:
122
134
  - 0
123
- version: "0"
135
+ hash: 2624379326334183946
124
136
  requirements: []
125
-
126
137
  rubyforge_project: bloomer
127
- rubygems_version: 1.8.15
138
+ rubygems_version: 1.8.21
128
139
  signing_key:
129
140
  specification_version: 3
130
141
  summary: Bloom filters and Scalable Bloom filters (SBF) in pure ruby
131
- test_files:
132
- - spec/bloomer_spec.rb
133
- - spec/spec_helper.rb
142
+ test_files:
143
+ - test/bloomer_test.rb
144
+ - test/test_helper.rb
134
145
  has_rdoc:
@@ -1,7 +0,0 @@
1
- require 'rspec'
2
- require 'bloomer'
3
-
4
- RSpec.configure do |config|
5
- config.color_enabled = true
6
- config.formatter = 'documentation'
7
- end