fabulator 0.0.10 → 0.0.11

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/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.0.11 2010-11-11
2
+
3
+ * 1 bug fix
4
+ * Type handling - minor corrections
5
+
1
6
  === 0.0.10
2
7
  * 1 minor enhancement:
3
8
  * Form markup supports a selection type
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -47,7 +47,7 @@ module Fabulator
47
47
  def build_conversion_to(to)
48
48
  return [] if to.nil? || self == to
49
49
  ut = self._unify_types(to, true)
50
- return [] if ut.nil? || ut[:t].join('') != to.join('')
50
+ return [] if ut.nil? || ut[:t].nil? || ut[:t].vtype.join('') != to.join('')
51
51
  return ut[:convert]
52
52
  end
53
53
 
@@ -71,24 +71,26 @@ module Fabulator
71
71
  while added
72
72
  added = false
73
73
  [d1, d2].each do |d|
74
- d.keys.each do |t|
75
- d[t][:t].outgoing_conversions.each_pair do |conv_key, conv|
76
- #conv_key = conv.vtype.join('')
77
- w = d[t][:w] * conv.weight
78
- if d.has_key?(conv_key)
79
- if d[conv_key][:w] < w
80
- d[conv_key][:w] = w
81
- d[conv_key][:path] = d[t][:path] + [ conv.vtype ]
82
- d[conv_key][:convert] = d[t][:convert] + [ conv ] - [nil]
74
+ d.keys.each do |t|
75
+ if !d[t][:t].nil?
76
+ d[t][:t].outgoing_conversions.each_pair do |conv_key, conv|
77
+ #conv_key = conv.vtype.join('')
78
+ w = d[t][:w] * conv.weight
79
+ if d.has_key?(conv_key)
80
+ if d[conv_key][:w] < w
81
+ d[conv_key][:w] = w
82
+ d[conv_key][:path] = d[t][:path] + [ conv.vtype ]
83
+ d[conv_key][:convert] = d[t][:convert] + [ conv ] - [nil]
84
+ end
85
+ else
86
+ added = true
87
+ d[conv_key] = {
88
+ :t => conv.vtype.is_a?(Array) ? Fabulator::TagLib.type_handler(conv.vtype) : conv.vtype,
89
+ :w => w,
90
+ :path => d[t][:path] + [ conv.vtype ],
91
+ :convert => d[t][:convert] + [ conv ] - [nil],
92
+ }
83
93
  end
84
- else
85
- added = true
86
- d[conv_key] = {
87
- :t => conv.vtype,
88
- :w => w,
89
- :path => d[t][:path] + [ conv.vtype ],
90
- :convert => d[t][:convert] + [ conv ] - [nil],
91
- }
92
94
  end
93
95
  end
94
96
  end
@@ -108,7 +110,7 @@ module Fabulator
108
110
  else
109
111
  added = true
110
112
  d[to_key] = {
111
- :t => [ ns, ct ],
113
+ :t => Fabulator::TagLib.type_handler([ ns, ct ]),
112
114
  :w => w * 95.0 / 100.0,
113
115
  :path => d[from_key][:path] + [ conv.vtype ],
114
116
  :convert => d[from_key][:convert] + [ conv ],
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fabulator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +00:00
18
+ date: 2010-11-11 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency