logicgates 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea9c813bab09117d9949491070c590907fac3b14
4
- data.tar.gz: 14e29ef8c84e49869daa76124b6d299068e16710
3
+ metadata.gz: c14eedf6e62bdf59beba879455c874a53a4a3268
4
+ data.tar.gz: 4c3a44c6dcdbbbc4c436f8891e18494fe6e86498
5
5
  SHA512:
6
- metadata.gz: c75ec18329b5b56a41daa70d30d148834c7115a635c09d676cbe67cd5cc7ac5f9706bd725a06cc8ff32e2a6596f7c0db93b84eb21d8f7629b73deb1b264d5de7
7
- data.tar.gz: f06a01a9501a14d880a1572049d89e82effb494f096b25ec37aa12be05b37cf5cf009d2b0a5f56c0a531562a535d882297c6c6af0ffa67936f4793bfdcaaf03a
6
+ metadata.gz: f2530304f59e574598fce57d3f91c0c4a4100a711ca26f04213cd419f5c9f06df34e07dc3f7d6de3c40aaa07fa2baa1e47c549fef5e4c9de28f76dd5205ce0de
7
+ data.tar.gz: bbae317b8ec9d6a9cdf89363ad34262e9a705277af42074c3bf24c029a3b4b0c49357f6d388d9e34429d7f6b6a93c36131e12aa7726b105d5aef84e44606fe69
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ logicgates-0.0.1.gem
7
7
  logicgates-0.0.2.gem
8
8
  logicgates-0.0.3.gem
9
9
  logicgates-0.0.4.gem
10
+ logicgates-0.0.5.gem
data/README.md CHANGED
@@ -1,38 +1,31 @@
1
1
  #LogicGates
2
2
 
3
- Common logic gates written in Ruby. A proof that all logical operations can be derived from AND, OR and NOT.
3
+ A Ruby gem of common logic gates. Also serves as a proof that all logical operations can be derived from AND, OR and NOT.
4
4
 
5
- ```ruby
6
- def my_and(a, b)
7
- a && b
8
- end
9
-
10
- def my_or(a, b)
11
- a || b
12
- end
13
-
14
- def not(a)
15
- !a
16
- end
5
+ ##Installation
17
6
 
18
- def xor(a, b)
19
- my_and(my_or(a, b), not(my_and(a, b)))
20
- end
21
-
22
- def nor(a, b)
23
- not(my_or(a, b))
24
- end
25
-
26
- def nand(a, b)
27
- not(my_and(a, b))
28
- end
7
+ ```ruby
8
+ gem 'baseanything'
9
+ ```
29
10
 
30
- def xnor(a, b)
31
- not(xor(a, b))
32
- end
11
+ And then execute:
12
+ ```ruby
13
+ $ bundle
14
+ ```
15
+ Or install it yourself as:
16
+ ```ruby
17
+ $ gem install baseanything
18
+ ```
33
19
 
34
- def mux(a, b, s)
35
- my_or(my_and(a, not(s)), my_and(b, s))
36
- end
20
+ ##API
37
21
 
22
+ ```ruby
23
+ LogicGates::my_and(a, b)
24
+ LogicGates::my_or(a, b)
25
+ LogicGates::not(a)
26
+ LogicGates::xor(a, b)
27
+ LogicGates::nor(a, b)
28
+ LogicGates::nand(a, b)
29
+ LogicGates::xnor(a, b)
30
+ LogicGates::mux(a, b)
38
31
  ```
@@ -1,3 +1,3 @@
1
1
  module LogicGates
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/logicgates.rb CHANGED
@@ -20,7 +20,7 @@ module LogicGates
20
20
  not(my_or(a, b))
21
21
  end
22
22
 
23
- def self.nmy_and(a, b)
23
+ def self.nand(a, b)
24
24
  not(my_and(a, b))
25
25
  end
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logicgates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DouglasTGordon