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 +4 -4
- data/lib/pears/provider/base.rb +7 -3
- data/lib/pears/version.rb +1 -1
- data/lib/pears.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 576ee9ad4705f36e9dcbccd59c7905f17e4b0acd1774597c3e9bb131f8f14027
|
4
|
+
data.tar.gz: eee99597b7909aa5bc35a7b9852e5b6a1251db4c425fb0ea9d2eeb0c86f4e408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af3f76aeeae69b0ca9fb7c53e81f008d443069b092cafbf5c0637a306b4c637c879b93289d2ddb57f4875e4e0cd6de3e643228df422e4eb40a3f406229395b61
|
7
|
+
data.tar.gz: 85f198de8136d0bf3ef42b4603cebbdce1a42cc7d5d80b6347d2372958b2011f99a3cf984ffef1d4ffefec2f5bbfc4a4c412e7223af769c823e05f23c61e2a0e
|
data/lib/pears/provider/base.rb
CHANGED
@@ -21,9 +21,13 @@ module Pears
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def parse_yaml(
|
25
|
-
yaml_data = YAML.load(
|
26
|
-
|
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
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
|