rubyfca 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/bin/rubyfca +2 -2
  3. data/lib/rubyfca.rb +17 -2
  4. data/rubyfca.gemspec +1 -1
  5. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
data/bin/rubyfca CHANGED
@@ -28,10 +28,10 @@ EOS
28
28
  opt :circle, "Use circle shaped concept nodes", :default=> false
29
29
  opt :full, "Do not contract concept labels", :default=> false
30
30
  opt :legend, "Print the legend of concept nodes (available only when using circle node shape)", :default => false
31
- opt :coloring, "Color concept nodes", :default => false
31
+ opt :coloring, "Color concept nodes [0 = none (default), 1 = lightblue/pink, 2 = monochrome]", :default => 0
32
32
  opt :straight, "Straighten edges (available when output format is either png, jpg, or eps)", :default => false
33
33
  end
34
-
34
+ Trollop::die :coloring, "must be 0, 1, or 2" if (opts[:coloring] > 2 || opts[:coloring] < 0)
35
35
  ############### main program ###############
36
36
 
37
37
  if ARGV.size != 2
data/lib/rubyfca.rb CHANGED
@@ -371,10 +371,25 @@ class FormalContext
371
371
 
372
372
  attr_str = attrfull.join('<br />')
373
373
  attr_str = attr_str == "" ? " " : attr_str
374
- attr_color = (!opts[:coloring] || /\A\s+\z/ =~ attr_str) ? "white" : "lightblue"
374
+
375
+ if opts[:coloring] == 0 or /\A\s+\z/ =~ attr_str
376
+ attr_color = "white"
377
+ elsif opts[:coloring] == 1
378
+ attr_color = "lightblue"
379
+ elsif opts[:coloring] == 2
380
+ attr_color = "gray87"
381
+ end
382
+
375
383
  obj_str = objfull.join('<br />')
376
384
  obj_str = obj_str == "" ? " " : obj_str
377
- obj_color = (!opts[:coloring] || /\A\s+\z/ =~ obj_str) ? "white" : "pink"
385
+
386
+ if opts[:coloring] == 0 or /\A\s+\z/ =~ obj_str
387
+ obj_color = "white"
388
+ elsif opts[:coloring] == 1
389
+ obj_color = "pink"
390
+ elsif opts[:coloring] == 2
391
+ obj_color = "gray92"
392
+ end
378
393
 
379
394
  label = "<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\">" +
380
395
  "<tr><td balign=\"left\" align=\"left\" bgcolor=\"#{attr_color}\">#{attr_str}</td></tr>" +
data/rubyfca.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rubyfca}
8
- s.version = "0.2.6"
8
+ s.version = "0.2.7"
9
9
  s.required_ruby_version = ">=1.8.6"
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yoichiro Hasebe", "Kow Kuroda"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe