tafel 1.0.0 → 1.0.1
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/CHANGELOG.txt +6 -1
- data/lib/tafel.rb +9 -3
- metadata +2 -2
data/CHANGELOG.txt
CHANGED
data/lib/tafel.rb
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
module Tafel
|
27
27
|
|
28
|
-
VERSION = '1.0.
|
28
|
+
VERSION = '1.0.1'
|
29
29
|
|
30
30
|
def self.table?(o)
|
31
31
|
|
@@ -104,6 +104,8 @@ module Tafel
|
|
104
104
|
|
105
105
|
iterate(ss) do |x, y, s|
|
106
106
|
|
107
|
+
next unless s
|
108
|
+
|
107
109
|
left = x > 0 ? ss[y][x - 1] : nil
|
108
110
|
above = y > 0 ? ss[y - 1][x] : nil
|
109
111
|
|
@@ -122,7 +124,11 @@ module Tafel
|
|
122
124
|
|
123
125
|
def self.size(o)
|
124
126
|
|
125
|
-
table?(o)
|
127
|
+
if table?(o) && o.any?
|
128
|
+
[ o.collect { |r| r.size }.max, o.size ]
|
129
|
+
else
|
130
|
+
[ 0, 0 ]
|
131
|
+
end
|
126
132
|
end
|
127
133
|
|
128
134
|
def self.copy(target, woff, hoff, source)
|
@@ -140,7 +146,7 @@ module Tafel
|
|
140
146
|
table.size.times do |y|
|
141
147
|
yield(x, y, table[y][x])
|
142
148
|
end
|
143
|
-
end
|
149
|
+
end if table.any?
|
144
150
|
end
|
145
151
|
|
146
152
|
def self.narrow_class(x)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tafel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|