dry-view 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4a41e09f937605f77be24092d9da6ff653da34d
4
- data.tar.gz: 5bde51853d38d892bbbba62f42acacfebcfd71b4
3
+ metadata.gz: 4320e5c4ceacedaf135a9a59ab73bb5cd316ac2f
4
+ data.tar.gz: 9ce48d97be8b9c84b3ac473171777783549725f1
5
5
  SHA512:
6
- metadata.gz: b5121bec86b8fa020f4e46dd12beae722fee4eb135a000efff37926061e376206ca507aaea6a3334707df618d9368ca5201af041581fe6f4fedc626ed643df0e
7
- data.tar.gz: 422541634a6634adfdac9cb2fa8e82e0b8cc35efc8aaf9dfe669a08394020ead0ce776a5564bb5819c701a43959f95c8d638a51d4ba389433c7b1fc09f88a3c7
6
+ metadata.gz: 622277285a6cb325c191ce400acd1cf0f200dfef10eeb6c87c5f6bb758c028be6a50b743ac664ff9c9de271c4795df4443ed3a19bcf9aa82c52431c2922957f0
7
+ data.tar.gz: a1340d82a48e85e4a9208f139b9cc3d4c746c704ea7b3bd9e9eef98dc2b41e5010f10488b2bfe9b1b86af3115212a377bcfdf6f776a87ffce5585ed6f8c265d1
@@ -1,3 +1,9 @@
1
+ # 0.2.2 / 2017-01-31
2
+
3
+ ### Changed
4
+
5
+ - Make input passthrough exposures (when there is no block or matching instance metod) return nil instead of raise in the case of a missing input key (timriley)
6
+
1
7
  # 0.2.1 / 2017-01-30
2
8
 
3
9
  ### Fixed
@@ -26,7 +26,7 @@ module Dry
26
26
  alias_method :to_view?, :to_view
27
27
 
28
28
  def call(input, locals = {})
29
- return input.fetch(name) unless proc
29
+ return input[name] unless proc
30
30
 
31
31
  args = dependencies.map.with_index { |name, position|
32
32
  if position.zero?
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module View
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
@@ -178,6 +178,10 @@ RSpec.describe Dry::View::Exposure do
178
178
  it "returns a matching key from the input" do
179
179
  expect(exposure.(input)).to eq "hi there"
180
180
  end
181
+
182
+ it "returns nil when no input key matches" do
183
+ expect(exposure.(nothing_matches_here: true)).to be_nil
184
+ end
181
185
  end
182
186
  end
183
187
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-01-30 00:00:00.000000000 Z
12
+ date: 2017-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: tilt