logic 0.0.8 → 0.0.9
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.
- data/README.rdoc +6 -8
- data/bin/logic +8 -5
- data/lib/truth_table.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
= logic
|
2
2
|
|
3
|
+
== Installation
|
4
|
+
|
5
|
+
gem install logic
|
6
|
+
|
3
7
|
== Usage
|
4
8
|
|
5
|
-
|
9
|
+
By default, you get a truth table and a list of MC/DC pairs:
|
6
10
|
|
7
|
-
logic
|
11
|
+
logic '(a or b) and (c or d)'
|
8
12
|
|
9
13
|
Gives you:
|
10
14
|
|
@@ -26,12 +30,6 @@ Gives you:
|
|
26
30
|
15) 1 1 1 0 | 1
|
27
31
|
16) 1 1 1 1 | 1
|
28
32
|
|
29
|
-
MC/DC test case pairs can also be found:
|
30
|
-
|
31
|
-
logic mcdc_pairs '(a or b) and (c or d)'
|
32
|
-
|
33
|
-
Gives you:
|
34
|
-
|
35
33
|
a => [[2, 10], [3, 11], [4, 12]]
|
36
34
|
b => [[2, 6], [3, 7], [4, 8]]
|
37
35
|
c => [[5, 7], [9, 11], [13, 15]]
|
data/bin/logic
CHANGED
@@ -7,18 +7,21 @@ require 'treetop'
|
|
7
7
|
require 'logic_parser'
|
8
8
|
require 'logic_operations'
|
9
9
|
|
10
|
-
options = {
|
10
|
+
options = {
|
11
|
+
:truth_table => true,
|
12
|
+
:mcdc_pairs => true
|
13
|
+
}
|
11
14
|
|
12
15
|
option_parser = OptionParser.new
|
13
16
|
|
14
17
|
option_parser.banner = "Usage: logic [options] <decision>"
|
15
18
|
|
16
|
-
option_parser.on( '-l', '--truth_table', 'Show the truth table for the decision' ) do
|
17
|
-
options[:truth_table] =
|
19
|
+
option_parser.on( '-l', '--[no-]truth_table', 'Show the truth table for the decision' ) do |option|
|
20
|
+
options[:truth_table] = option
|
18
21
|
end
|
19
22
|
|
20
|
-
option_parser.on( '-m', '--mcdc_pairs', 'Show MC/DC test case pairs' ) do
|
21
|
-
options[:mcdc_pairs] =
|
23
|
+
option_parser.on( '-m', '--[no-]mcdc_pairs', 'Show MC/DC test case pairs' ) do |option|
|
24
|
+
options[:mcdc_pairs] = option
|
22
25
|
end
|
23
26
|
|
24
27
|
option_parser.on( '-h', '--help', 'You\'re looking at it' ) do
|
data/lib/truth_table.rb
CHANGED