dandelion 0.4.2 → 0.4.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: 8a5cdc2196e3f49cc93406574ba713ab938dd879
4
- data.tar.gz: 3b9d3219ac8ca24b1127a5bc1ec7416e624af388
3
+ metadata.gz: 592bd141236ce41cb578379d08093e6d8bc0c8e6
4
+ data.tar.gz: 0f4676b5e9c05d291541542a999b07637a12a96e
5
5
  SHA512:
6
- metadata.gz: 09d290e1ec8abffb0003440b7138f68dda7aae0cdc72063102cc465bbad4dc75a7f4f24abe39c43c5de8bc6d91a53e155d3067fc2c607847fab686206385f824
7
- data.tar.gz: be3d7aabe93bece86627a7af58c9ae8dd80d0570a67d73108dfa14fb81d764695cf9c9a0255f61d2a2030c87de5394b1e55e3854c1dc626fbe2817e57d334051
6
+ metadata.gz: 00c5700ba375d856accb5e0e57dfe323fd8a9b20a98e5abe75b431f5081960d2e93b8b661827fe60a7f2e0fb21201c13043cd2c8d0267ca8ab8c148eb7a26780
7
+ data.tar.gz: 51e050318c8b0dcae8b891bf039ed4d06368ea3b13b71f0fa190784f93defb908a13d5cdb6221c3ae22c549379f7ddfec8c6e225b0fa9f7d4c81010ed0df6a44
@@ -1,11 +1,15 @@
1
1
  module Dandelion
2
2
  class Change
3
- attr_reader :path, :type, :data
3
+ attr_reader :path, :type
4
4
 
5
- def initialize(path, type, data = nil)
5
+ def initialize(path, type, read = nil)
6
6
  @path = path
7
7
  @type = type
8
- @data = data
8
+ @read = read
9
+ end
10
+
11
+ def data
12
+ @read.() if @read
9
13
  end
10
14
  end
11
15
  end
@@ -24,7 +24,8 @@ module Dandelion
24
24
  if change.type == :delete
25
25
  yield Change.new(path, change.type)
26
26
  else
27
- yield Change.new(path, change.type, @tree.data(change.path))
27
+ read = -> { @tree.data(change.path) }
28
+ yield Change.new(path, change.type, read)
28
29
  end
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Dandelion
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
@@ -1,7 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Dandelion::Change do
4
- let(:change) { Dandelion::Change.new('foo', 'bar', 'baz') }
4
+ let(:read) { -> { 'baz' }}
5
+ let(:change) { Dandelion::Change.new('foo', 'bar', read) }
5
6
 
6
7
  it 'has path' do
7
8
  expect(change.path).to eq 'foo'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dandelion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged