config-reader 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8e34a3d24b7bfa6ca50291dda7cd876997daba180ab835d3115cc80fc63235d4
4
+ data.tar.gz: c93da14263ca62012051ffce6a348bc0e7b6bb2f2d970f2e2058cda40807380a
5
+ SHA512:
6
+ metadata.gz: bf864827bca7100e31a75ed9fcdd32b4eaccdd41d2499487e98f6c2ddcede7fc60cbf256dfe93be70f8d521871dda49d692012d61fa13ca2483773def1426f88
7
+ data.tar.gz: '003001860394573a4b3a4531002d752ad522416af9faa53997c4ee2d15ed1a9c85bb2f8f4c587e453881b4693289673ec4fc92e34108f312965eaf8521e2e828'
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ require 'erb'
3
+ require 'ostruct'
4
+ require 'yaml'
5
+
6
+ class ConfigReader < OpenStruct
7
+ def self.load(path, env)
8
+ contents = IO.read(path)
9
+ processed = ERB.new(contents).result
10
+ new(YAML.load(processed)[env.to_s])
11
+ end
12
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ class ConfigReader
3
+ VERSION = '0.0.1'
4
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: config-reader
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Tulino
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Process yaml files with embedded ruby
14
+ email: rtulino@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/config-reader.rb
20
+ - lib/config-reader/version.rb
21
+ homepage: http://rubygems.org/gems/config-reader
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.4'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.1.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Config Reader
44
+ test_files: []