activerecord-bit_field 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 415e570a739aa2432d73524aabd9d6832fb98fb3
4
+ data.tar.gz: 6d6eb6d45f0b51044274c7d873db6c17f898bf30
5
+ SHA512:
6
+ metadata.gz: a6dbf33d8feafeb8affe9a8a4681ecf7c333e4cebbf87e31e6bba5c8abbdbb2169b63c84125539704edaa9591320c2297603fd0fdaa7923bb2ef00ca72a83102
7
+ data.tar.gz: a2cd2c5213c5a8cc1c8b2b3c0d2cc4565ad38a491b245068e22f07806c2f08bf1d5a1d7e49e574f6cd68c2ffcef1c154e9750a980389b6327eda7ddb3a40124e
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in activerecord-bit_field.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,108 @@
1
+ # Activerecord::BitField
2
+
3
+ [![Build Status](https://travis-ci.org/ainame/activerecord-bit_field.svg?branch=master)](https://travis-ci.org/ainame/activerecord-bit_field)
4
+
5
+ Activerecord::BitField provide a feature of mapping bit fileds to RDB table in ActiveRecord.
6
+ This is reinventing the wheel; see `See Also` section.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'activerecord-bit_field'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install activerecord-bit_field
23
+
24
+ ## Usage
25
+
26
+ At first, `require 'active_record/bit_field'` when don't using autoload.
27
+ Next, define the integer column to using management of fields.
28
+ Finaly, declare the bit_field in arbitrary models.
29
+
30
+ ```ruby
31
+ class AddFilePermissionsTable < ActiveRecord::Migration
32
+ def change
33
+ create_table(:file_permissions) do |t|
34
+ t.integer :file_id, null: false, default: 0 # you must specify `default: 0`
35
+ t.integer :permission, null: false
36
+ end
37
+ end
38
+ end
39
+
40
+ ...
41
+
42
+ class FilePermission < ActiveRecrod::Base
43
+ include ActiveRecord::BitField
44
+
45
+ # :read map to first bit, :write map to second, ....
46
+ #
47
+ # .. 0 0 0 0 | 0 0 0 0 <- permission column
48
+ # | | |
49
+ # +---+ | `-----+
50
+ # | | |
51
+ # execute write read
52
+ #
53
+ bit_field permission: [:read, :write, :execute]
54
+ end
55
+
56
+ file_permission = FilePermission.new
57
+ file_permission.read? # => false in default
58
+
59
+ file_permission = FilePermission.create(file_id: 1, permission: 1) # `1` is the bit map value
60
+ file_permission.read? # => true
61
+ file_permission.write? # => false
62
+
63
+ file_permission.enable_write
64
+ file_permission.disable_read
65
+ file_permission.enable_execute
66
+ file_permission.save!
67
+
68
+ file_permission.permissin # => { read: false, write: true, execute: true }
69
+ ```
70
+
71
+ ### Options
72
+
73
+ ActiveRecord::BitField can easily realize default-true bit field.
74
+ In normaly, specify `DEFAULT 0` to fields column, then turn bit off(0) represent false
75
+ and turn bit on(1) represent true. If you want to use default-true bit field,
76
+ you maybe specify `DEFAULT 1` in table schema. But, when you want to add other field
77
+ in that column, how do it?
78
+
79
+ ActiveRecord::BitField ready `invert` option. If you provide true value with :invert key,
80
+ ActiveRecord::BitField invert dealing of bit state; turn bit off(0) represent true and turn bit on(1) represent false.
81
+
82
+ ```ruby
83
+ class FilePermission < ActiveRecrod::Base
84
+ include ActiveRecord::BitField
85
+
86
+ bit_field permission: [:read, :write, :execute], invert: true
87
+ end
88
+
89
+ file_permisson = FilePermission.new
90
+ file_permisson.read? #=> true in default
91
+ ```
92
+
93
+ ## See Also
94
+
95
+ You can use other products in same needs.
96
+ This plugin don't have the select query each fields feature.
97
+ But, these have it.
98
+
99
+ * [pboling/flag_shih_tzu](https://github.com/pboling/flag_shih_tzu)
100
+ * [grosser/bitfields](https://github.com/grosser/bitfields)
101
+
102
+ ## Contributing
103
+
104
+ 1. Fork it ( https://github.com/ainame/activerecord-bit_field/fork )
105
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
106
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
107
+ 4. Push to the branch (`git push origin my-new-feature`)
108
+ 5. Create a new Pull Request
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new("spec")
5
+ task default: :spec
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'active_record/bit_field/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "activerecord-bit_field"
8
+ spec.version = ActiveRecord::BitField::VERSION
9
+ spec.authors = ["ainame"]
10
+ spec.email = ["s.namai.09@gmail.com"]
11
+ spec.summary = %q{provide a feature of mapping bit fileds to RDB table in ActiveRecord.}
12
+ spec.description = %q{Activerecord::BitField provide a feature of mapping bit fileds to RDB table in ActiveRecord.}
13
+ spec.homepage = "https://github.com/ainame/activerecord-bit_field"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "activesupport", '>= 3.0.0'
22
+ spec.add_runtime_dependency "activerecord", '>= 3.0.0'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.7"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", ">= 3.0"
27
+ spec.add_development_dependency "sqlite3"
28
+ spec.add_development_dependency "pry"
29
+ end
@@ -0,0 +1,173 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'active_record/bit_field/version'
3
+ require 'active_support/concern'
4
+
5
+ module ActiveRecord
6
+ module BitField
7
+ extend ActiveSupport::Concern
8
+
9
+ def bit_field_turn_bit_on_method(column, field)
10
+ value = read_attribute(column)
11
+ write_attribute(column, value | self.class.bit_field_get_column_mapper(column)[field.to_s])
12
+ nil
13
+ end
14
+
15
+ def bit_field_turn_bit_off_method(column, field)
16
+ value = read_attribute(column)
17
+ if (value & self.class.bit_field_get_column_mapper(column)[field.to_s]) != 0
18
+ write_attribute(column, value ^ self.class.bit_field_get_column_mapper(column)[field.to_s])
19
+ end
20
+ nil
21
+ end
22
+
23
+ def bit_field_inquire_method(column, field)
24
+ (read_attribute(column) & self.class.bit_field_get_column_mapper(column)[field.to_s]) != 0
25
+ end
26
+
27
+ def bit_field_setter_method(column, field, bool)
28
+ if bool
29
+ bit_field_turn_bit_on_method(column, field)
30
+ else
31
+ bit_field_turn_bit_off_method(column, field)
32
+ end
33
+ end
34
+
35
+ module ClassMethods
36
+ # @param [Hash] args オプションを含めた引数のハッシュ、キーがカラム名値の配列がフィールド名になる
37
+ # @option args [Boolean] :invret truthyな値を渡すとビットへのマッピング時にビットが0の状態を有効に1を無効にする
38
+ def bit_field(args = {})
39
+ destructed_args = args.to_a
40
+ argument = destructed_args.shift
41
+ options = destructed_args.to_h
42
+ raise "can't find arguments" unless argument
43
+
44
+ column, fields = argument
45
+ bit_field_set_column_fields(column, fields.dup)
46
+
47
+ mapper = bit_field_create_mapper(fields)
48
+ bit_field_set_column_mapper(column, mapper)
49
+
50
+ bit_field_orverride_getter_method(column, options)
51
+ bit_field_define_setter_method(column, options)
52
+ bit_field_define_fields_method(column, fields, options)
53
+
54
+ fields.each do |field|
55
+ bit_field_define_inquire_method(column, field, options)
56
+ bit_field_define_enable_method(column, field, options)
57
+ bit_field_define_disable_method(column, field, options)
58
+ end
59
+ end
60
+
61
+ def bit_field_create_mapper(fields)
62
+ fields.map.with_index.inject({}) do |map, (field, bit_shift)|
63
+ map[field.to_s] = 1 << bit_shift
64
+ map
65
+ end
66
+ end
67
+
68
+ def bit_field_set_column_fields(column, fields)
69
+ instance_variable_set("@_#{column}_fields", fields)
70
+ end
71
+
72
+ def bit_field_get_column_fields(column)
73
+ instance_variable_get("@_#{column}_fields")
74
+ end
75
+
76
+ def bit_field_set_column_mapper(column, mapper)
77
+ instance_variable_set("@_#{column}_mapper", mapper)
78
+ end
79
+
80
+ def bit_field_get_column_mapper(column)
81
+ instance_variable_get("@_#{column}_mapper")
82
+ end
83
+
84
+ def bit_field_orverride_getter_method(column, options)
85
+ unless options[:invert]
86
+ define_method "#{column}" do
87
+ self.class.bit_field_get_column_fields(column).reduce({}) do |mapping, field|
88
+ mapping[field] = bit_field_inquire_method(column, field)
89
+ mapping
90
+ end
91
+ end
92
+ else
93
+ define_method "#{column}" do
94
+ self.class.bit_field_get_column_fields(column).reduce({}) do |mapping, field|
95
+ mapping[field] = !bit_field_inquire_method(column, field)
96
+ mapping
97
+ end
98
+ end
99
+ end
100
+ end
101
+
102
+ def bit_field_define_setter_method(column, options)
103
+ unless options[:invert]
104
+ define_method "set_#{column}_field" do |field, value|
105
+ bit_field_setter_method(column, field, value)
106
+ end
107
+ else
108
+ define_method "set_#{column}_field" do |field, value|
109
+ bit_field_setter_method(column, field, !value)
110
+ end
111
+ end
112
+ end
113
+
114
+ def bit_field_define_fields_method(column, fields, options)
115
+ define_singleton_method "#{column}_fields" do
116
+ bit_field_get_column_fields(column)
117
+ end
118
+ end
119
+
120
+ def bit_field_define_inquire_method(column, field, options)
121
+ unless options[:invert]
122
+ define_method "#{field}?" do
123
+ bit_field_inquire_method(column, field)
124
+ end
125
+ else
126
+ define_method "#{field}?" do
127
+ !bit_field_inquire_method(column, field)
128
+ end
129
+ end
130
+ end
131
+
132
+ def bit_field_define_enable_method(column, field, options)
133
+ unless options[:invert]
134
+ define_method "enable_#{column}_field" do |_field|
135
+ bit_field_turn_bit_on_method(column, _field)
136
+ end
137
+
138
+ define_method "enable_#{field}" do
139
+ bit_field_turn_bit_on_method(column, field)
140
+ end
141
+ else
142
+ define_method "enable_#{column}_field" do |_field|
143
+ bit_field_turn_bit_off_method(column, _field)
144
+ end
145
+
146
+ define_method "enable_#{field}" do
147
+ bit_field_turn_bit_off_method(column, field)
148
+ end
149
+ end
150
+ end
151
+
152
+ def bit_field_define_disable_method(column, field, options)
153
+ unless options[:invert]
154
+ define_method "disable_#{column}_field" do |_field|
155
+ bit_field_turn_bit_off_method(column, _field)
156
+ end
157
+
158
+ define_method "disable_#{field}" do
159
+ bit_field_turn_bit_off_method(column, field)
160
+ end
161
+ else
162
+ define_method "disable_#{column}_field" do |_field|
163
+ bit_field_turn_bit_on_method(column, _field)
164
+ end
165
+
166
+ define_method "disable_#{field}" do
167
+ bit_field_turn_bit_on_method(column, field)
168
+ end
169
+ end
170
+ end
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,5 @@
1
+ module ActiveRecord
2
+ module BitField
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,86 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActiveRecord::BitField do
4
+
5
+ describe '.<column>_fields' do
6
+ it 'should return field names' do
7
+ expect(Dummy.flags_fields).to eq([:aaa, :bbb, :ccc])
8
+ end
9
+ end
10
+
11
+ context 'using bit_field DSL by flags column' do
12
+ let(:dummy) { Dummy.new }
13
+ let(:dummy_invert) { DummyInvert.new }
14
+
15
+ describe '#flgas' do
16
+ it 'decide default value by cloumn default value' do
17
+ expect(dummy.flags).to eq({ aaa: false, bbb: false, ccc: false})
18
+ expect(dummy_invert.flags).to eq({ aaa: true, bbb: true, ccc: true})
19
+ end
20
+
21
+ context 'enable aaa flag' do
22
+ before do
23
+ dummy.enable_flags_field(:aaa)
24
+ dummy.save!
25
+ dummy_invert.enable_flags_field(:aaa)
26
+ dummy_invert.save!
27
+ end
28
+
29
+ it 'default value is all false' do
30
+ expect(dummy.flags).to eq({ aaa: true, bbb: false, ccc: false})
31
+ expect(dummy_invert.flags).to eq({ aaa: true, bbb: true, ccc: true})
32
+ end
33
+ end
34
+ end
35
+
36
+ describe '#enable_<column>_field' do
37
+ before do
38
+ dummy_invert.send(:write_attribute, :flags, 1)
39
+ dummy_invert.save!
40
+ end
41
+
42
+ it 'should change bit value' do
43
+ expect { dummy.enable_flags_field(:aaa) }.to change {
44
+ dummy.read_attribute(:flags)
45
+ }.from(0).to(1)
46
+
47
+ expect { dummy_invert.enable_flags_field(:aaa) }.to change {
48
+ dummy_invert.read_attribute(:flags)
49
+ }.from(1).to(0)
50
+ end
51
+ end
52
+
53
+ describe '#disable_<column>_field' do
54
+ before do
55
+ dummy.send(:write_attribute, :flags, 1)
56
+ dummy.save!
57
+ end
58
+
59
+ it 'should change bit value' do
60
+ expect { dummy.disable_flags_field(:aaa) }.to change {
61
+ dummy.read_attribute(:flags)
62
+ }.from(1).to(0)
63
+
64
+ expect { dummy_invert.disable_flags_field(:aaa) }.to change {
65
+ dummy_invert.read_attribute(:flags)
66
+ }.from(0).to(1)
67
+ end
68
+ end
69
+
70
+ describe 'shorthand syntax' do
71
+ it 'has each flags inquire methods' do
72
+ expect(dummy.aaa?).to be(false)
73
+ expect(dummy.bbb?).to be(false)
74
+ expect(dummy.ccc?).to be(false)
75
+ expect(dummy_invert.aaa?).to be(true)
76
+ expect(dummy_invert.bbb?).to be(true)
77
+ expect(dummy_invert.ccc?).to be(true)
78
+ end
79
+
80
+ it 'has each flags inquire methods' do
81
+ expect { dummy.enable_aaa }.to change { dummy.aaa? }.from(false).to(true)
82
+ expect { dummy_invert.disable_aaa }.to change { dummy_invert.aaa? }.from(true).to(false)
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../lib')))
2
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__))))
3
+
4
+ require 'active_record'
5
+ require 'active_record/bit_field'
6
+ require 'support/dummy'
7
+
8
+ RSpec.configure do |config|
9
+ config.before(:each) do
10
+ Dummy.delete_all
11
+ DummyInvert.delete_all
12
+ end
13
+ end
@@ -0,0 +1,30 @@
1
+ ActiveRecord::Base.establish_connection(
2
+ adapter: 'sqlite3',
3
+ database: ':memory:'
4
+ )
5
+
6
+ class DummySchema < ActiveRecord::Migration
7
+ def change
8
+ create_table :dummies do |t|
9
+ t.integer :flags, default: 0, null: false
10
+ end
11
+
12
+ create_table :dummy_inverts do |t|
13
+ t.integer :flags, default: 0, null: false
14
+ end
15
+ end
16
+ end
17
+
18
+ ActiveRecord::Migration.suppress_messages do
19
+ DummySchema.migrate(:up)
20
+ end
21
+
22
+ class Dummy < ActiveRecord::Base
23
+ include ActiveRecord::BitField
24
+ bit_field flags: [:aaa, :bbb, :ccc]
25
+ end
26
+
27
+ class DummyInvert < ActiveRecord::Base
28
+ include ActiveRecord::BitField
29
+ bit_field flags: [:aaa, :bbb, :ccc], invert: true
30
+ end
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-bit_field
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - ainame
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Activerecord::BitField provide a feature of mapping bit fileds to RDB
112
+ table in ActiveRecord.
113
+ email:
114
+ - s.namai.09@gmail.com
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".gitignore"
120
+ - ".travis.yml"
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - activerecord-bit_field.gemspec
126
+ - lib/active_record/bit_field.rb
127
+ - lib/active_record/bit_field/version.rb
128
+ - spec/lib/active_record/bit_field_spec.rb
129
+ - spec/spec_helper.rb
130
+ - spec/support/dummy.rb
131
+ homepage: https://github.com/ainame/activerecord-bit_field
132
+ licenses:
133
+ - MIT
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options: []
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ requirements: []
150
+ rubyforge_project:
151
+ rubygems_version: 2.2.2
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: provide a feature of mapping bit fileds to RDB table in ActiveRecord.
155
+ test_files:
156
+ - spec/lib/active_record/bit_field_spec.rb
157
+ - spec/spec_helper.rb
158
+ - spec/support/dummy.rb