bitfields 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 106a09ba14ca7da95a4fa0c8b2da45a0a4de5624
4
- data.tar.gz: 2ed11e3e4ef88782ace1559d73ead45c8c34b59c
3
+ metadata.gz: 6d3c3c80e7c7bc57c3bf5b5d823ed303f2eb9334
4
+ data.tar.gz: 9d6b4bba6c3d6d32da0c4d973ad73e46895628ba
5
5
  SHA512:
6
- metadata.gz: ed6b161c7dc68ac136a09fb03491c3bdde83c74f99798457c7aac1f4404dbb5fb4ff42f61ba3e584e6f99bcdfec39df95175ddb6efb8e098bb3b3ce0993621a6
7
- data.tar.gz: c1564e6c0144701399a9f288d26993daa31ff60fdd3a46b37b9babe19eb00cd2449b607ec7e4987e57532d369e7668fdfbbef4574bb4ef76d314dd9e406d7ce8
6
+ metadata.gz: 08c481512fb7e297ccf9d9847fa9e2973af42ec178d0209d50a4d826a28921d56b85cd8ea761b3d75726c759057c17c960be852d129cae05c8c7e7f375735c28
7
+ data.tar.gz: 200eae5fcfb735aa8bc99e45310a0a565a4ed89f35b0de03b78e4eed62f841c571a37fc918c950279bf08ebe1ec2c878264638ab481de8b20b80fc216ec0f0fc
data/Readme.md CHANGED
@@ -63,7 +63,7 @@ TIPS
63
63
 
64
64
  Query-mode Benchmark
65
65
  =========
66
- The `query_mode: :in_list` is slower for most queries and scales mierably with the number of bits.<br/>
66
+ The `query_mode: :in_list` is slower for most queries and scales miserably with the number of bits.<br/>
67
67
  *Stay with the default query-mode*. Only use :in_list if your edge-case shows better performance.
68
68
 
69
69
  ![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)
@@ -30,7 +30,7 @@ module Bitfields
30
30
  def self.extract_bits(options)
31
31
  bitfields = {}
32
32
  options.keys.select{|key| key.is_a?(Numeric) }.each do |bit|
33
- raise "#{bit} is not a power of 2 !!" unless bit.to_s(2).scan('1').size == 1
33
+ raise "#{bit} is not a power of 2 !!" unless bit & (bit - 1) == 0
34
34
  bit_name = options.delete(bit).to_sym
35
35
  raise DuplicateBitNameError if bitfields.include?(bit_name)
36
36
  bitfields[bit_name] = bit
@@ -1,3 +1,3 @@
1
1
  module Bitfields
2
- Version = VERSION = "0.5.2"
2
+ Version = VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-11 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wwtd
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.2.2
127
+ rubygems_version: 2.4.5.1
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Save migrations and columns by storing multiple booleans in a single integer