klear 0.1.2 → 0.1.3

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: 4313b5a05eb9c9747c749bfb24a0cdcc682e22e1
4
- data.tar.gz: f4de006b50f0635b3c95e82d230ff9add17d4dac
3
+ metadata.gz: 77d30b3fc67cb36ded1634f501d04b595d2b4fbd
4
+ data.tar.gz: 3c5ff4f6e7e861938787ca00c6dc14ae9ddde8e9
5
5
  SHA512:
6
- metadata.gz: 6fb509385bb4c98c162189d6296d1774d8e464a2be330671b9838c39e92663a6775680fbe994703a9f0c5ab9989ed3d910fd436c061958ea43b3c0a850302882
7
- data.tar.gz: 21f817872560a254bfdbe0f26e381ce9bd93a60075b08fccfb16c3878f4af8e3c395733b5f45acd2d83d38a10fcf0af60cdfbf181385e28d7b7a39e6324c8d40
6
+ metadata.gz: d5a97de9e79d49d94a7b0b4b5aaf82ea7cbfec08469f865e1efb5e532367837b3ffca36283a92eb4fd2516152687acd0de5a1ee4a9c65bd5901a8918ee4b45d3
7
+ data.tar.gz: f77483348a71ac19d7a4576fc8910d30384273ce98cb0fcf175c9ed71ed933ad292e8609a220da47878be5cbaa9e4217f7be32fcea76fa4c2e825cdf85a4427a
@@ -12,6 +12,12 @@ class Klear::Frame
12
12
  column(x)[y]
13
13
  end
14
14
 
15
+ def each_cell &blk
16
+ each_row do |row, y|
17
+ row.each_with_index {|val, x| blk.call(val, x, y)}
18
+ end
19
+ end
20
+
15
21
  def row no
16
22
  @data.slice(no * @column_count, @column_count)
17
23
  end
@@ -1,4 +1,4 @@
1
1
  module Klear
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  DATE = '2013-08-07'
4
4
  end
@@ -9,6 +9,17 @@ describe Klear::Frame do
9
9
  context 'with frame zero from test fixture' do
10
10
  let(:frame) { frames.get(0) }
11
11
 
12
+ it 'loops over all cells' do
13
+ cell_count = 0
14
+ frame.each_cell do |val, x, y|
15
+ cell_count += 1
16
+ expect(val).to eq(frame.cell(x, y))
17
+ expect(val).to eq(frame.row(y)[x])
18
+ expect(val).to eq(frame.column(x)[y])
19
+ end
20
+ expect(cell_count).to eq(frame.size)
21
+ end
22
+
12
23
  it 'has row, column and size' do
13
24
  frame.row_count.should eq(11)
14
25
  frame.column_count.should eq(14)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klear
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - art+com/dirk luesebrink