bitswitch 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/bitswitch.rb +5 -2
- data/lib/bitswitch/version.rb +1 -1
- metadata +7 -10
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c6467bccc4d45d5150cde6c4f21c1519f47e8528
|
4
|
+
data.tar.gz: 164026eaaebe7c2e3dbbde8588bae225f382cc67
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b08b0150c701251800a3067b232491e8b5354a3b63e4d8d562d082bffc0fec67f3be031f4575da99bbfdd281e44fea3cf5a245f497d0da662eb3d9a9177e3893
|
7
|
+
data.tar.gz: e04843b8511bbaa6daccff1c42e51a0d3d3f2364d503837f7fc5a11a4e3c32a68c367e3ab7bcb351124056ac949d47d38742ce5a509598c0fbc713e2525041ca
|
data/lib/bitswitch.rb
CHANGED
@@ -213,8 +213,11 @@ class Hash
|
|
213
213
|
cleaned = self.delete_if{|k,v| ![true, false, 1, 0, '1', '0'].include?(v)}
|
214
214
|
|
215
215
|
# Convert Numerical Booleans
|
216
|
-
cleaned.
|
217
|
-
|
216
|
+
cleaned = cleaned.inject({}) do |o,(k,v)|
|
217
|
+
o[k] = v.is_a?(String) ? v.to_i : v
|
218
|
+
o[k] = v.is_a?(Fixnum) ? !v.zero? : v
|
219
|
+
o
|
220
|
+
end
|
218
221
|
|
219
222
|
# Return new BitSwitch
|
220
223
|
return BitSwitch.new(0, labels) if cleaned.empty?
|
data/lib/bitswitch/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitswitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kelly Becker
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-08-24 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Have you ever wanted to store multiple true/false values in your database,
|
15
14
|
but annoyed with how many fields your tables have, then BitSwitcher is good for
|
@@ -31,28 +30,26 @@ files:
|
|
31
30
|
- lib/bitswitch/version.rb
|
32
31
|
homepage: http://kellybecker.me
|
33
32
|
licenses: []
|
33
|
+
metadata: {}
|
34
34
|
post_install_message:
|
35
35
|
rdoc_options: []
|
36
36
|
require_paths:
|
37
37
|
- lib
|
38
38
|
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
39
|
requirements:
|
41
|
-
- -
|
40
|
+
- - '>='
|
42
41
|
- !ruby/object:Gem::Version
|
43
42
|
version: '0'
|
44
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
44
|
requirements:
|
47
|
-
- -
|
45
|
+
- - '>='
|
48
46
|
- !ruby/object:Gem::Version
|
49
47
|
version: '0'
|
50
48
|
requirements: []
|
51
49
|
rubyforge_project:
|
52
|
-
rubygems_version:
|
50
|
+
rubygems_version: 2.0.3
|
53
51
|
signing_key:
|
54
|
-
specification_version:
|
52
|
+
specification_version: 4
|
55
53
|
summary: Bitswitch lets you store multiple true/false values in an integer using boolean
|
56
54
|
math.
|
57
55
|
test_files: []
|
58
|
-
has_rdoc:
|