bools 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bools.gemspec +1 -1
  3. data/lib/bools.rb +7 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21404a36bf997a6e2d4beb40097d9524437144002ddeb48518ce6ae3a19ab24b
4
- data.tar.gz: 5e1a3a51309ced9c2409756cc1431eb47f7070feada570cb7c7664a4f33a21b3
3
+ metadata.gz: b91898adbcedddadfdd84f19791371b5ea4ed860659aecc394e9323f6583ca9a
4
+ data.tar.gz: 2634c08fa8710dbaf43147e0ea49a7dd39fe9556f3aff10b9d7094ef3ac8c7de
5
5
  SHA512:
6
- metadata.gz: 49a7863e6a368e7fd943eecf95ce3d921dae5557ee271a237cc977b59a50f307a4c6a5d3e6df0af39c7e2bb291260cd1f976a840d70792179fb56746375a724c
7
- data.tar.gz: 80f8636a6fe334747f38ebba686d61906ff0f3aca915473995023652d2357056fd09e501cf06da8f9af3b3b1ddb6fe1f7cee10271b4191098df1e132551e6907
6
+ metadata.gz: 156753ba96c9e35412d42e01a3f1306051320d36608af9bedc03f6410f11ced1cad2695c8c449f22f501a40d18bde44331f827f161e684754867285540a7d6d4
7
+ data.tar.gz: dfe62429f49e36a07288af113715dfec3220718f7f871c14b3a0fd682dd5a9b8cb690488155bcb21ab2053942d225614c0bad2abad01d01be245b77fd1f33b99
data/bools.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "bools"
5
- s.version = "0.5.2"
5
+ s.version = "0.5.3"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "Bools is a Ruby gem that makes it easy to evaluate boolean conditionals"
data/lib/bools.rb CHANGED
@@ -1,10 +1,13 @@
1
1
  def bools!
2
2
  vars = method(:test).arity
3
- list = vars.times.map {|i| (97 + i).chr}
3
+ cols = vars.times.map {|i| (97 + i).chr}
4
+ runs = 1 << vars
5
+
4
6
  puts
5
- puts [*list, '|', 'result'] * ' '
6
- puts ['--' * list.size, '-' * 6] * '+-'
7
- (1 << vars).times do |i|
7
+ puts [*cols, '|', 'result'] * ' '
8
+ puts ['--' * cols.size, '-' * 6] * '+-'
9
+
10
+ runs.times do |i|
8
11
  list = ("%0*b" % [vars, i]).split('')
9
12
  vals = list.map {|item| item == '1'}
10
13
  resu = !!test(*vals) ? '1' : '0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve