pears 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 3e5f72a743be10db15756a0223ec43b75ca764aeeec8271999359324b8df5556
4
- data.tar.gz: ec6603a5cace923b98ea1f80f8f4876c94d94118f4cd6975f63eae3e75fb5991
3
+ metadata.gz: 576ee9ad4705f36e9dcbccd59c7905f17e4b0acd1774597c3e9bb131f8f14027
4
+ data.tar.gz: eee99597b7909aa5bc35a7b9852e5b6a1251db4c425fb0ea9d2eeb0c86f4e408
5
5
  SHA512:
6
- metadata.gz: 7f78200980505f2f354d87890f02b4ab094e36c1da304c387b8352595a7a9f2e9e74f145f1bc8da3c320f37f56a764c43068a75c6cd6b6e42511d4804acccf66
7
- data.tar.gz: 60259e0a407ff67e0a3301825de82fb45b3f87a6afd08d9e5c2de34743bbe092e3e86a38bd50b99c6cae9ae81e4aab96d9951f21f7091d17febc3fb17ae14387
6
+ metadata.gz: af3f76aeeae69b0ca9fb7c53e81f008d443069b092cafbf5c0637a306b4c637c879b93289d2ddb57f4875e4e0cd6de3e643228df422e4eb40a3f406229395b61
7
+ data.tar.gz: 85f198de8136d0bf3ef42b4603cebbdce1a42cc7d5d80b6347d2372958b2011f99a3cf984ffef1d4ffefec2f5bbfc4a4c412e7223af769c823e05f23c61e2a0e
@@ -21,9 +21,13 @@ module Pears
21
21
 
22
22
  private
23
23
 
24
- def parse_yaml(yaml_data)
25
- yaml_data = YAML.load(yaml_data)
26
- raise Pears::InvalidProviderData unless yaml_data.is_a? Hash
24
+ def parse_yaml(yaml_string)
25
+ yaml_data = YAML.load(yaml_string)
26
+
27
+ unless yaml_data.respond_to? :with_indifferent_access
28
+ raise Pears::InvalidProviderData
29
+ end
30
+
27
31
  yaml_data.with_indifferent_access
28
32
  rescue Psych::SyntaxError => e
29
33
  logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
data/lib/pears/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pears
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/pears.rb CHANGED
@@ -16,9 +16,10 @@ module Pears
16
16
 
17
17
  # This is the main way of locating a subject.
18
18
  def self.subject(name)
19
+ subjects
19
20
  Subject.new(name).tap do |subject|
20
21
  builder = Provider::Builder.new(subject)
21
- yield(builder)
22
+ @subjects << yield(builder)
22
23
  end
23
24
  end
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pears
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
  - Steven Kemp