pears 0.0.9 → 0.1.1

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: 1d48dc1834011f1ab1d1f037bd06b020fd6bf6d7f0beacd57b19a112b823a552
4
- data.tar.gz: b308278beb7815bb429fb43ee5c8169b3b07edce515464272884ad95ed66fce6
3
+ metadata.gz: 8c15dd21fc557f0dcb711e9b64e8c05cd7aa17277d8d78fcd6b352a62b9dc46f
4
+ data.tar.gz: b98aed17f7ac9ca2594cc6b59afdbfbad0eb542430ed523ca4954c09cfd911e4
5
5
  SHA512:
6
- metadata.gz: 307711c578ed670bd4fdb947547f822ae8293f54de4d1b930c9416282277e89a8f3bf23fe07b4786b8e89d1657894be8cd77797d5511847ae40c7ea44bc6cb2d
7
- data.tar.gz: dc1853a4df443259b4b67239ca62c54add9ee106ce34aeb7e3169c92c516e414f54e211ff178fbe1563007007f4ede2661e0ffdc313c01384e73ffe61e9296cb
6
+ metadata.gz: eeb4ad72657094f50ad3edbcac4bdd717184e6e645b9a0b92eb247d4befc757e2ae41c26d25b689c78c9bd2008d08d0341e0dd375373ffe9b88dc6d0f4944984
7
+ data.tar.gz: 2e5a5e00e406c55235f1a7893500dc6fa6272220f05446b4544b5ffa3896efbfc87b6349153ec20b80ca0c41240af98e36622116524c468982b5c8833c2a9fc0
data/Gemfile CHANGED
@@ -9,3 +9,4 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
+ gem "rspec-collection_matchers"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pears (0.0.8)
4
+ pears (0.0.11)
5
5
  activesupport
6
6
  dry-configurable (>= 0.13.0)
7
7
  redis
@@ -32,6 +32,8 @@ GEM
32
32
  rspec-core (~> 3.10.0)
33
33
  rspec-expectations (~> 3.10.0)
34
34
  rspec-mocks (~> 3.10.0)
35
+ rspec-collection_matchers (1.2.0)
36
+ rspec-expectations (>= 2.99.0.beta1)
35
37
  rspec-core (3.10.1)
36
38
  rspec-support (~> 3.10.0)
37
39
  rspec-expectations (3.10.1)
@@ -54,6 +56,7 @@ DEPENDENCIES
54
56
  pears!
55
57
  rake (~> 13.0)
56
58
  rspec (~> 3.0)
59
+ rspec-collection_matchers
57
60
 
58
61
  BUNDLED WITH
59
- 2.2.31
62
+ 2.3.5
@@ -25,6 +25,10 @@ module Pears
25
25
  yaml_data = YAML.load(yaml_data)
26
26
  raise Pears::InvalidProviderData if yaml_data.is_a? String
27
27
  yaml_data.with_indifferent_access
28
+ rescue Psych::SyntaxError => e
29
+ logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
30
+ logger.warn "#{e.class} #{e.message}"
31
+ raise Pears::InvalidProviderData
28
32
  end
29
33
  end
30
34
  end
@@ -8,7 +8,8 @@ module Pears
8
8
  def initialize(file_path, on_failure: :raise)
9
9
  yaml_data = File.read(file_path)
10
10
  @data = parse_yaml(yaml_data)
11
- rescue Errno::ENOENT => error
11
+ rescue Errno::ENOENT,
12
+ Pears::InvalidProviderData => error
12
13
  if on_failure == :null
13
14
  @data = {}
14
15
  else
@@ -8,7 +8,11 @@ module Pears
8
8
  yaml_data = Net::HTTP.get(URI(remote_url))
9
9
  @data = parse_yaml(yaml_data)
10
10
 
11
- rescue SocketError, InvalidProviderData, Errno::ECONNREFUSED => e
11
+ rescue SocketError,
12
+ InvalidProviderData,
13
+ Errno::ECONNREFUSED,
14
+ Errno::EHOSTUNREACH,
15
+ Errno::EADDRNOTAVAIL => e
12
16
  if on_failure == :null
13
17
  @data = {}
14
18
  else
data/lib/pears/subject.rb CHANGED
@@ -5,6 +5,7 @@ module Pears
5
5
  # You could different Pears::Subjects in your application for different parts
6
6
  # of its domain. for instance: application_settings, theming or translations.
7
7
  class Subject
8
+ include Enumerable
8
9
  attr_reader :name
9
10
 
10
11
  def initialize(name, *layers)
@@ -40,6 +41,10 @@ module Pears
40
41
  end.with_indifferent_access
41
42
  end
42
43
 
44
+ def each(&block)
45
+ project.each(&block)
46
+ end
47
+
43
48
  private
44
49
 
45
50
  def layers
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.0.9"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Kemp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-24 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.2.22
120
+ rubygems_version: 3.2.3
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: An overly complicated library for juggling configuration data.