bitfields 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ ["2.3", "3.0", "3.1", "3.2"].each do |version|
2
+ appraise "activerecord_#{version}" do
3
+ gem "activerecord", "~> #{version}.0"
4
+ end
5
+ end
data/Gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source :rubygems
2
2
  gemspec
3
3
 
4
- gem 'activerecord', ENV['AR']
4
+ gem 'appraisal'
5
+ gem 'activerecord'
5
6
  gem 'sqlite3'
6
7
  gem 'rake'
7
8
  gem 'rspec', '~>2'
9
+ gem 'bump'
@@ -1,47 +1,51 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitfields (0.4.1)
4
+ bitfields (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- activemodel (3.1.0.rc4)
10
- activesupport (= 3.1.0.rc4)
11
- bcrypt-ruby (~> 2.1.4)
9
+ activemodel (3.2.11)
10
+ activesupport (= 3.2.11)
12
11
  builder (~> 3.0.0)
12
+ activerecord (3.2.11)
13
+ activemodel (= 3.2.11)
14
+ activesupport (= 3.2.11)
15
+ arel (~> 3.0.2)
16
+ tzinfo (~> 0.3.29)
17
+ activesupport (3.2.11)
13
18
  i18n (~> 0.6)
14
- activerecord (3.1.0.rc4)
15
- activemodel (= 3.1.0.rc4)
16
- activesupport (= 3.1.0.rc4)
17
- arel (~> 2.1.1)
18
- tzinfo (~> 0.3.27)
19
- activesupport (3.1.0.rc4)
20
19
  multi_json (~> 1.0)
21
- arel (2.1.1)
22
- bcrypt-ruby (2.1.4)
23
- builder (3.0.0)
24
- diff-lcs (1.1.2)
25
- i18n (0.6.0)
26
- multi_json (1.0.3)
27
- rake (0.9.2)
28
- rspec (2.6.0)
29
- rspec-core (~> 2.6.0)
30
- rspec-expectations (~> 2.6.0)
31
- rspec-mocks (~> 2.6.0)
32
- rspec-core (2.6.4)
33
- rspec-expectations (2.6.0)
34
- diff-lcs (~> 1.1.2)
35
- rspec-mocks (2.6.0)
36
- sqlite3 (1.3.3)
37
- tzinfo (0.3.28)
20
+ appraisal (0.5.1)
21
+ bundler
22
+ rake
23
+ arel (3.0.2)
24
+ builder (3.0.4)
25
+ bump (0.3.9)
26
+ diff-lcs (1.1.3)
27
+ i18n (0.6.1)
28
+ multi_json (1.5.0)
29
+ rake (10.0.3)
30
+ rspec (2.12.0)
31
+ rspec-core (~> 2.12.0)
32
+ rspec-expectations (~> 2.12.0)
33
+ rspec-mocks (~> 2.12.0)
34
+ rspec-core (2.12.2)
35
+ rspec-expectations (2.12.1)
36
+ diff-lcs (~> 1.1.3)
37
+ rspec-mocks (2.12.1)
38
+ sqlite3 (1.3.7)
39
+ tzinfo (0.3.35)
38
40
 
39
41
  PLATFORMS
40
42
  ruby
41
43
 
42
44
  DEPENDENCIES
43
45
  activerecord
46
+ appraisal
44
47
  bitfields!
48
+ bump
45
49
  rake
46
50
  rspec (~> 2)
47
51
  sqlite3
data/Rakefile CHANGED
@@ -1,29 +1,11 @@
1
- require 'bundler/gem_tasks'
1
+ require "bundler/gem_tasks"
2
+ require "bump/tasks"
3
+ require "appraisal"
2
4
 
3
5
  task :spec do
4
- sh "rspec spec"
6
+ sh "rspec spec/"
5
7
  end
6
8
 
7
9
  task :default do
8
- sh "AR=2.3.14 && (bundle check || bundle install) && bundle exec rake spec"
9
- sh "AR=3.0.12 && (bundle check || bundle install) && bundle exec rake spec"
10
- sh "AR=3.1.4 && (bundle check || bundle install) && bundle exec rake spec"
11
- sh "AR=3.2.3 && (bundle check || bundle install) && bundle exec rake spec"
12
- end
13
-
14
- # extracted from https://github.com/grosser/project_template
15
- rule /^version:bump:.*/ do |t|
16
- sh "git status | grep 'nothing to commit'" # ensure we are not dirty
17
- index = ['major', 'minor','patch'].index(t.name.split(':').last)
18
- file = 'lib/bitfields/version.rb'
19
-
20
- version_file = File.read(file)
21
- old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
22
- version_parts[index] = version_parts[index].to_i + 1
23
- version_parts[2] = 0 if index < 2 # remove patch for minor
24
- version_parts[1] = 0 if index < 1 # remove minor for major
25
- new_version = version_parts * '.'
26
- File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
27
-
28
- sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
10
+ sh "bundle exec rake appraisal:install && bundle exec rake appraisal spec"
29
11
  end
data/Readme.md CHANGED
@@ -1,15 +1,17 @@
1
1
  Save migrations and columns by storing multiple booleans in a single integer.<br/>
2
2
  e.g. true-false-false = 1, false-true-false = 2, true-false-true = 5 (1,2,4,8,..)
3
3
 
4
- class User < ActiveRecord::Base
5
- include Bitfields
6
- bitfield :my_bits, 1 => :seller, 2 => :insane, 4 => :stupid
7
- end
8
-
9
- user = User.new(:seller => true, :insane => true)
10
- user.seller == true
11
- user.stupid? == false
12
- user.my_bits == 3
4
+ ```ruby
5
+ class User < ActiveRecord::Base
6
+ include Bitfields
7
+ bitfield :my_bits, 1 => :seller, 2 => :insane, 4 => :stupid
8
+ end
9
+
10
+ user = User.new(:seller => true, :insane => true)
11
+ user.seller == true
12
+ user.stupid? == false
13
+ user.my_bits == 3
14
+ ```
13
15
 
14
16
  - records changes `user.chamges == {:seller => [false, true]}`
15
17
  - adds scopes `User.seller.stupid.first` (deactivate with `bitfield ..., :scopes => false`)
@@ -21,25 +23,33 @@ e.g. true-false-false = 1, false-true-false = 2, true-false-true = 5 (1,2,4,8,.
21
23
 
22
24
  Install
23
25
  =======
24
- As Gem: ` sudo gem install bitfields `<br/>
25
- Or as Rails plugin: ` rails plugin install git://github.com/grosser/bitfields.git `
26
+
27
+ ```
28
+ gem install bitfields
29
+ ```
26
30
 
27
31
  ### Migration
28
32
  ALWAYS set a default, bitfield queries will not work for NULL
29
33
 
30
- t.integer :my_bits, :default => 0, :null => false
31
- OR
32
- add_column :users, :my_bits, :integer, :default => 0, :null => false
34
+ ```ruby
35
+ t.integer :my_bits, :default => 0, :null => false
36
+ # OR
37
+ add_column :users, :my_bits, :integer, :default => 0, :null => false
38
+ ```
33
39
 
34
40
  Examples
35
41
  ========
36
42
  Update all users
37
43
 
38
- User.seller.not_stupid.update_all(User.set_bitfield_sql(:seller => true, :insane => true))
44
+ ```ruby
45
+ User.seller.not_stupid.update_all(User.set_bitfield_sql(:seller => true, :insane => true))
46
+ ```
39
47
 
40
48
  Delete the shop when a user is no longer a seller
41
49
 
42
- before_save :delete_shop, :if => lambda{|u| u.changes['seller'] == [true, false]}
50
+ ```ruby
51
+ before_save :delete_shop, :if => lambda{|u| u.changes['seller'] == [true, false]}
52
+ ```
43
53
 
44
54
  TIPS
45
55
  ====
@@ -57,6 +67,19 @@ The `:query_mode => :in_list` is slower for most queries and scales mierably wit
57
67
 
58
68
  ![performance](http://chart.apis.google.com/chart?chtt=bit-operator+vs+IN+--+with+index&chd=s:CEGIKNPRUW,DEHJLOQSVX,CFHKMPSYXZ,DHJMPSVYbe,DHLPRVZbfi,FKOUZeinsx,FLQWbglqw2,HNTZfkqw19,BDEGHJLMOP,BDEGIKLNOQ,BDFGIKLNPQ,BDFGILMNPR,BDFHJKMOQR,BDFHJLMOQS,BDFHJLNPRT,BDFHJLNPRT&chxt=x,y&chxl=0:|100K|200K|300K|400K|500K|600K|700K|800K|900K|1000K|1:|0|1441.671ms&cht=lc&chs=600x500&chdl=2bits+%28in%29|3bits+%28in%29|4bits+%28in%29|6bits+%28in%29|8bits+%28in%29|10bits+%28in%29|12bits+%28in%29|14bits+%28in%29|2bits+%28bit%29|3bits+%28bit%29|4bits+%28bit%29|6bits+%28bit%29|8bits+%28bit%29|10bits+%28bit%29|12bits+%28bit%29|14bits+%28bit%29&chco=0000ff,0000ee,0000dd,0000cc,0000bb,0000aa,000099,000088,ff0000,ee0000,dd0000,cc0000,bb0000,aa0000,990000,880000)
59
69
 
70
+ Testing With RSpec
71
+ =========
72
+
73
+ To assert that a specific flag is a bitfield flag and has the `active?`, `active`, and `active=` methods and behavior use the following matcher:
74
+
75
+ ````ruby
76
+ require 'bitfields/rspec'
77
+
78
+ describe User do
79
+ it { should have_a_bitfield :active }
80
+ end
81
+ ````
82
+
60
83
  TODO
61
84
  ====
62
85
  - convenient named scope `User.with_bitfields(:xxx=>true, :yy=>false)`
@@ -65,9 +88,11 @@ Authors
65
88
  =======
66
89
  ### [Contributors](http://github.com/grosser/bitfields/contributors)
67
90
  - [Hellekin O. Wolf](https://github.com/hellekin)
91
+ - [John Wilkinson](https://github.com/jcwilk)
92
+ - [PeppyHeppy](https://github.com/peppyheppy)
68
93
 
69
94
  [Michael Grosser](http://grosser.it)<br/>
70
95
  michael@grosser.it<br/>
71
96
  License: MIT<br/>
72
- [![Build Status](https://secure.travis-ci.org/grosser/bitfields.png)](http://travis-ci.org/grosser/bitfields)
97
+ [![Build Status](https://travis-ci.org/grosser/bitfields.png)](https://travis-ci.org/grosser/bitfields)
73
98
 
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source :rubygems
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "rake"
8
+ gem "rspec", "~>2"
9
+ gem "bump"
10
+ gem "activerecord", "~> 2.3.0"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: /Users/mgrosser/code/tools/bitfields
3
+ specs:
4
+ bitfields (0.4.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activerecord (2.3.15)
10
+ activesupport (= 2.3.15)
11
+ activesupport (2.3.15)
12
+ appraisal (0.5.1)
13
+ bundler
14
+ rake
15
+ bump (0.3.9)
16
+ diff-lcs (1.1.3)
17
+ rake (10.0.3)
18
+ rspec (2.12.0)
19
+ rspec-core (~> 2.12.0)
20
+ rspec-expectations (~> 2.12.0)
21
+ rspec-mocks (~> 2.12.0)
22
+ rspec-core (2.12.2)
23
+ rspec-expectations (2.12.1)
24
+ diff-lcs (~> 1.1.3)
25
+ rspec-mocks (2.12.1)
26
+ sqlite3 (1.3.7)
27
+
28
+ PLATFORMS
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ activerecord (~> 2.3.0)
33
+ appraisal
34
+ bitfields!
35
+ bump
36
+ rake
37
+ rspec (~> 2)
38
+ sqlite3
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source :rubygems
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "rake"
8
+ gem "rspec", "~>2"
9
+ gem "bump"
10
+ gem "activerecord", "~> 3.0.0"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: /Users/mgrosser/code/tools/bitfields
3
+ specs:
4
+ bitfields (0.4.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activemodel (3.0.19)
10
+ activesupport (= 3.0.19)
11
+ builder (~> 2.1.2)
12
+ i18n (~> 0.5.0)
13
+ activerecord (3.0.19)
14
+ activemodel (= 3.0.19)
15
+ activesupport (= 3.0.19)
16
+ arel (~> 2.0.10)
17
+ tzinfo (~> 0.3.23)
18
+ activesupport (3.0.19)
19
+ appraisal (0.5.1)
20
+ bundler
21
+ rake
22
+ arel (2.0.10)
23
+ builder (2.1.2)
24
+ bump (0.3.9)
25
+ diff-lcs (1.1.3)
26
+ i18n (0.5.0)
27
+ rake (10.0.3)
28
+ rspec (2.12.0)
29
+ rspec-core (~> 2.12.0)
30
+ rspec-expectations (~> 2.12.0)
31
+ rspec-mocks (~> 2.12.0)
32
+ rspec-core (2.12.2)
33
+ rspec-expectations (2.12.1)
34
+ diff-lcs (~> 1.1.3)
35
+ rspec-mocks (2.12.1)
36
+ sqlite3 (1.3.7)
37
+ tzinfo (0.3.35)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ activerecord (~> 3.0.0)
44
+ appraisal
45
+ bitfields!
46
+ bump
47
+ rake
48
+ rspec (~> 2)
49
+ sqlite3
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source :rubygems
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "rake"
8
+ gem "rspec", "~>2"
9
+ gem "bump"
10
+ gem "activerecord", "~> 3.1.0"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: /Users/mgrosser/code/tools/bitfields
3
+ specs:
4
+ bitfields (0.4.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activemodel (3.1.8)
10
+ activesupport (= 3.1.8)
11
+ builder (~> 3.0.0)
12
+ i18n (~> 0.6)
13
+ activerecord (3.1.8)
14
+ activemodel (= 3.1.8)
15
+ activesupport (= 3.1.8)
16
+ arel (~> 2.2.3)
17
+ tzinfo (~> 0.3.29)
18
+ activesupport (3.1.8)
19
+ multi_json (>= 1.0, < 1.3)
20
+ appraisal (0.5.1)
21
+ bundler
22
+ rake
23
+ arel (2.2.3)
24
+ builder (3.0.4)
25
+ bump (0.3.9)
26
+ diff-lcs (1.1.3)
27
+ i18n (0.6.1)
28
+ multi_json (1.2.0)
29
+ rake (10.0.3)
30
+ rspec (2.12.0)
31
+ rspec-core (~> 2.12.0)
32
+ rspec-expectations (~> 2.12.0)
33
+ rspec-mocks (~> 2.12.0)
34
+ rspec-core (2.12.2)
35
+ rspec-expectations (2.12.1)
36
+ diff-lcs (~> 1.1.3)
37
+ rspec-mocks (2.12.1)
38
+ sqlite3 (1.3.7)
39
+ tzinfo (0.3.35)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ activerecord (~> 3.1.0)
46
+ appraisal
47
+ bitfields!
48
+ bump
49
+ rake
50
+ rspec (~> 2)
51
+ sqlite3
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source :rubygems
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "rake"
8
+ gem "rspec", "~>2"
9
+ gem "bump"
10
+ gem "activerecord", "~> 3.2.0"
11
+
12
+ gemspec :path=>"../"
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: /Users/mgrosser/code/tools/bitfields
3
+ specs:
4
+ bitfields (0.4.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ activemodel (3.2.11)
10
+ activesupport (= 3.2.11)
11
+ builder (~> 3.0.0)
12
+ activerecord (3.2.11)
13
+ activemodel (= 3.2.11)
14
+ activesupport (= 3.2.11)
15
+ arel (~> 3.0.2)
16
+ tzinfo (~> 0.3.29)
17
+ activesupport (3.2.11)
18
+ i18n (~> 0.6)
19
+ multi_json (~> 1.0)
20
+ appraisal (0.5.1)
21
+ bundler
22
+ rake
23
+ arel (3.0.2)
24
+ builder (3.0.4)
25
+ bump (0.3.9)
26
+ diff-lcs (1.1.3)
27
+ i18n (0.6.1)
28
+ multi_json (1.5.0)
29
+ rake (10.0.3)
30
+ rspec (2.12.0)
31
+ rspec-core (~> 2.12.0)
32
+ rspec-expectations (~> 2.12.0)
33
+ rspec-mocks (~> 2.12.0)
34
+ rspec-core (2.12.2)
35
+ rspec-expectations (2.12.1)
36
+ diff-lcs (~> 1.1.3)
37
+ rspec-mocks (2.12.1)
38
+ sqlite3 (1.3.7)
39
+ tzinfo (0.3.35)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ activerecord (~> 3.2.0)
46
+ appraisal
47
+ bitfields!
48
+ bump
49
+ rake
50
+ rspec (~> 2)
51
+ sqlite3
@@ -0,0 +1,21 @@
1
+ RSpec::Matchers.define :have_a_bitfield do |field|
2
+ match do |klass|
3
+ klass.respond_to?(field) &&
4
+ klass.respond_to?(field) &&
5
+ klass.respond_to?("#{field}?") &&
6
+ klass.respond_to?("#{field}=")
7
+ end
8
+
9
+ failure_message_for_should do |klass|
10
+ "expected #{expected.join} to be a bitfield property defined on #{klass}"
11
+ end
12
+
13
+ failure_message_for_should_not do |klass|
14
+ "expected #{expected.join} to NOT be a bitfield property defined on #{klass}"
15
+ end
16
+
17
+ description do
18
+ "be a bitfield on #{expected}"
19
+ end
20
+
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Bitfields
2
- Version = VERSION = "0.4.1"
2
+ Version = VERSION = "0.4.2"
3
3
  end
@@ -11,20 +11,20 @@ class UserWithBitfieldOptions < ActiveRecord::Base
11
11
  end
12
12
 
13
13
  class MultiBitUser < ActiveRecord::Base
14
- set_table_name 'users'
14
+ self.table_name = 'users'
15
15
  include Bitfields
16
16
  bitfield :bits, 1 => :seller, 2 => :insane, 4 => :stupid
17
17
  bitfield :more_bits, 1 => :one, 2 => :two, 4 => :four
18
18
  end
19
19
 
20
20
  class UserWithoutScopes < ActiveRecord::Base
21
- set_table_name 'users'
21
+ self.table_name = 'users'
22
22
  include Bitfields
23
23
  bitfield :bits, 1 => :seller, 2 => :insane, 4 => :stupid, :scopes => false
24
24
  end
25
25
 
26
26
  class UserWithoutSetBitfield < ActiveRecord::Base
27
- set_table_name 'users'
27
+ self.table_name = 'users'
28
28
  include Bitfields
29
29
  end
30
30
 
@@ -36,7 +36,7 @@ end
36
36
 
37
37
  # other children should not disturb the inheritance
38
38
  class OtherInheritedUser < UserWithoutSetBitfield
39
- set_table_name 'users'
39
+ self.table_name = 'users'
40
40
  bitfield :bits, 1 => :seller_inherited
41
41
  end
42
42
 
@@ -48,34 +48,34 @@ class OverwrittenUser < User
48
48
  end
49
49
 
50
50
  class BitOperatorMode < ActiveRecord::Base
51
- set_table_name 'users'
51
+ self.table_name = 'users'
52
52
  include Bitfields
53
53
  bitfield :bits, 1 => :seller, 2 => :insane, :query_mode => :bit_operator
54
54
  end
55
55
 
56
56
  class WithoutThePowerOfTwo < ActiveRecord::Base
57
- set_table_name 'users'
57
+ self.table_name = 'users'
58
58
  include Bitfields
59
59
  bitfield :bits, :seller, :insane, :stupid, :query_mode => :bit_operator
60
60
  end
61
61
 
62
62
  class WithoutThePowerOfTwoWithoutOptions < ActiveRecord::Base
63
- set_table_name 'users'
63
+ self.table_name = 'users'
64
64
  include Bitfields
65
65
  bitfield :bits, :seller, :insane
66
66
  end
67
67
 
68
68
  class CheckRaise < ActiveRecord::Base
69
- set_table_name 'users'
69
+ self.table_name = 'users'
70
70
  include Bitfields
71
71
  end
72
72
 
73
73
  class ManyBitsUser < User
74
- set_table_name 'users'
74
+ self.table_name = 'users'
75
75
  end
76
76
 
77
77
  class InitializedUser < User
78
- set_table_name 'users'
78
+ self.table_name = 'users'
79
79
  bitfield :bits, 1 => :seller, 2 => :insane, 4 => :stupid, :scopes => false
80
80
 
81
81
  after_initialize do
@@ -89,11 +89,19 @@ describe Bitfields do
89
89
  User.delete_all
90
90
  end
91
91
 
92
+ def pending_if(condition, &block)
93
+ if condition
94
+ pending(&block)
95
+ else
96
+ yield
97
+ end
98
+ end
99
+
92
100
  describe :bitfields do
93
101
  it "parses them correctly" do
94
102
  User.bitfields.should == {:bits => {:seller => 1, :insane => 2, :stupid => 4}}
95
103
  end
96
-
104
+
97
105
  it "is fast for huge number of bits" do
98
106
  bits = {}
99
107
  0.upto(20) do |bit|
@@ -406,15 +414,24 @@ describe Bitfields do
406
414
 
407
415
  describe 'initializers' do
408
416
  it "sets defaults" do
409
- InitializedUser.new.seller.should == true
410
- InitializedUser.new.insane.should == false
417
+ pending_if(ActiveRecord::VERSION::MAJOR == 2) do
418
+ InitializedUser.new.seller.should == true
419
+ InitializedUser.new.insane.should == false
420
+ end
411
421
  end
412
422
 
413
423
  it "can overwrite defaults in new" do
414
- pending do
424
+ pending_if(ActiveRecord::VERSION::MAJOR != 2) do
415
425
  InitializedUser.new(:seller => false).seller.should == false
416
426
  InitializedUser.new(:insane => true).insane.should == true
417
427
  end
418
428
  end
419
429
  end
430
+
431
+ describe "rspec matchers" do
432
+ subject { User.new }
433
+
434
+ it { should have_a_bitfield :seller }
435
+ it { should_not have_a_bitfield :pickle_eater }
436
+ end
420
437
  end
@@ -7,6 +7,7 @@ ActiveRecord::Base.establish_connection(
7
7
  )
8
8
 
9
9
  # create tables
10
+ ActiveRecord::Schema.verbose = false
10
11
  ActiveRecord::Schema.define(:version => 1) do
11
12
  create_table :users do |t|
12
13
  t.integer :bits, :default => 0, :null => false
@@ -4,6 +4,7 @@ if ENV['VERSION']
4
4
  gem 'activesupport', ENV['VERSION']
5
5
  end
6
6
  $LOAD_PATH << 'lib'
7
+ require 'bitfields/rspec'
7
8
  require 'bitfields'
8
9
  require 'timeout'
9
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-26 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: michael@grosser.it
@@ -18,13 +18,23 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - .travis.yml
21
+ - Appraisals
21
22
  - Gemfile
22
23
  - Gemfile.lock
23
24
  - Rakefile
24
25
  - Readme.md
25
26
  - benchmark/bit_operator_vs_in.rb
26
27
  - bitfields.gemspec
28
+ - gemfiles/activerecord_2.3.gemfile
29
+ - gemfiles/activerecord_2.3.gemfile.lock
30
+ - gemfiles/activerecord_3.0.gemfile
31
+ - gemfiles/activerecord_3.0.gemfile.lock
32
+ - gemfiles/activerecord_3.1.gemfile
33
+ - gemfiles/activerecord_3.1.gemfile.lock
34
+ - gemfiles/activerecord_3.2.gemfile
35
+ - gemfiles/activerecord_3.2.gemfile.lock
27
36
  - lib/bitfields.rb
37
+ - lib/bitfields/rspec.rb
28
38
  - lib/bitfields/version.rb
29
39
  - spec/bitfields_spec.rb
30
40
  - spec/database.rb
@@ -44,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
44
54
  version: '0'
45
55
  segments:
46
56
  - 0
47
- hash: 4196443429503694670
57
+ hash: 1657995972263548143
48
58
  required_rubygems_version: !ruby/object:Gem::Requirement
49
59
  none: false
50
60
  requirements:
@@ -53,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
63
  version: '0'
54
64
  segments:
55
65
  - 0
56
- hash: 4196443429503694670
66
+ hash: 1657995972263548143
57
67
  requirements: []
58
68
  rubyforge_project:
59
69
  rubygems_version: 1.8.24