yondu 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -1
- data/CHANGELOG.md +5 -1
- data/LICENSE.txt +1 -1
- data/README.md +6 -3
- data/lib/yondu/version.rb +1 -1
- data/lib/yondu.rb +12 -4
- metadata +4 -6
- data/Gemfile +0 -12
- data/yondu.gemspec +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21f2156523ba226579991a5b9541609740c055aa53da8b188cd08755eae76e6a
|
4
|
+
data.tar.gz: 4be2bf38d8e06121868515a31cd8d2929d27bde78acc505815355b71d018abe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88efeb21f8c354a4e91c321c2092c32f95b161a29941ecb67baaa13a688945348d262a6b8ab3c9c159b35f38ca20b4cf8344655685d87943f2819adacfea6e4f
|
7
|
+
data.tar.gz: dc3d9d810de45cf5f4c169fea24d23e7b240c28eeb97447dd21171553ab0c52c23921975437e96bdc8e72922c7b9d9251333ac12e285f998a0149768fa377c70
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
1
3
|
AllCops:
|
2
|
-
|
4
|
+
NewCops: enable
|
5
|
+
TargetRubyVersion: 2.7
|
3
6
|
|
4
7
|
Style/StringLiterals:
|
5
8
|
Enabled: true
|
@@ -11,3 +14,6 @@ Style/StringLiteralsInInterpolation:
|
|
11
14
|
|
12
15
|
Layout/LineLength:
|
13
16
|
Max: 120
|
17
|
+
|
18
|
+
Style/Documentation:
|
19
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -47,7 +47,10 @@ Rails.configuration.settings.get(:app, :port)
|
|
47
47
|
# => 443
|
48
48
|
|
49
49
|
Rails.configuration.settings.get(:app, :use_ssl)
|
50
|
-
# => Missing setting: app->use_ssl (Yondu::
|
50
|
+
# => Missing setting: app->use_ssl (Yondu::MissingSettingError)
|
51
|
+
|
52
|
+
Rails.configuration.settings.get(:app, :port, :other)
|
53
|
+
# => No hash setting: app->port (Yondu::NoHashSettingError)
|
51
54
|
```
|
52
55
|
|
53
56
|
## Development
|
@@ -67,7 +70,7 @@ to [rubygems.org](https://rubygems.org).
|
|
67
70
|
Bug reports and pull requests are welcome on GitHub at https://github.com/amco/yondu-rb.
|
68
71
|
This project is intended to be a safe, welcoming space for collaboration, and
|
69
72
|
contributors are expected to adhere to the
|
70
|
-
[code of conduct](https://github.com/amco/yondu-rb/blob/
|
73
|
+
[code of conduct](https://github.com/amco/yondu-rb/blob/main/CODE_OF_CONDUCT.md).
|
71
74
|
|
72
75
|
## License
|
73
76
|
|
@@ -78,4 +81,4 @@ The gem is available as open source under the terms of the
|
|
78
81
|
|
79
82
|
Everyone interacting in the Yondu project's codebases, issue trackers,
|
80
83
|
chat rooms and mailing lists is expected to follow the
|
81
|
-
[code of conduct](https://github.com/amco/yondu-rb/blob/
|
84
|
+
[code of conduct](https://github.com/amco/yondu-rb/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/yondu/version.rb
CHANGED
data/lib/yondu.rb
CHANGED
@@ -5,9 +5,15 @@ require_relative "yondu/version"
|
|
5
5
|
module Yondu
|
6
6
|
class Error < StandardError; end
|
7
7
|
|
8
|
-
class
|
9
|
-
def initialize(
|
10
|
-
super("Missing setting: #{
|
8
|
+
class MissingSettingError < Error
|
9
|
+
def initialize(scope)
|
10
|
+
super("Missing setting: #{scope.join("->")}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class NoHashSettingError < Error
|
15
|
+
def initialize(scope)
|
16
|
+
super("No hash setting: #{scope.join("->")}")
|
11
17
|
end
|
12
18
|
end
|
13
19
|
|
@@ -21,8 +27,10 @@ module Yondu
|
|
21
27
|
value = @config
|
22
28
|
|
23
29
|
keys.each do |key|
|
30
|
+
raise NoHashSettingError, scope unless value.is_a?(Hash)
|
31
|
+
|
24
32
|
scope << key
|
25
|
-
value = value.fetch(key) { raise
|
33
|
+
value = value.fetch(key) { raise MissingSettingError, scope }
|
26
34
|
end
|
27
35
|
|
28
36
|
value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yondu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Gutiérrez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Settings object for extending configuration
|
14
14
|
email:
|
@@ -21,21 +21,19 @@ files:
|
|
21
21
|
- ".rubocop.yml"
|
22
22
|
- CHANGELOG.md
|
23
23
|
- CODE_OF_CONDUCT.md
|
24
|
-
- Gemfile
|
25
24
|
- LICENSE.txt
|
26
25
|
- README.md
|
27
26
|
- Rakefile
|
28
27
|
- lib/yondu.rb
|
29
28
|
- lib/yondu/version.rb
|
30
29
|
- sig/yondu.rbs
|
31
|
-
- yondu.gemspec
|
32
30
|
homepage: https://github.com/amco/yondu-rb
|
33
31
|
licenses:
|
34
32
|
- MIT
|
35
33
|
metadata:
|
36
34
|
homepage_uri: https://github.com/amco/yondu-rb
|
37
35
|
source_code_uri: https://github.com/amco/yondu-rb
|
38
|
-
changelog_uri: https://github.com/amco/yondu-rb/blob/
|
36
|
+
changelog_uri: https://github.com/amco/yondu-rb/blob/main/CHANGELOG.md
|
39
37
|
rubygems_mfa_required: 'true'
|
40
38
|
post_install_message:
|
41
39
|
rdoc_options: []
|
@@ -52,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
50
|
- !ruby/object:Gem::Version
|
53
51
|
version: '0'
|
54
52
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
53
|
+
rubygems_version: 3.4.17
|
56
54
|
signing_key:
|
57
55
|
specification_version: 4
|
58
56
|
summary: Settings object for extending configuration
|
data/Gemfile
DELETED
data/yondu.gemspec
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/yondu/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "yondu"
|
7
|
-
spec.version = Yondu::VERSION
|
8
|
-
spec.authors = ["Alejandro Gutiérrez"]
|
9
|
-
spec.email = ["alejandrodevs@gmail.com"]
|
10
|
-
|
11
|
-
spec.summary = "Settings object for extending configuration"
|
12
|
-
spec.description = "Settings object for extending configuration"
|
13
|
-
spec.homepage = "https://github.com/amco/yondu-rb"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.7.0"
|
16
|
-
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
20
|
-
|
21
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
-
spec.metadata["source_code_uri"] = spec.homepage
|
23
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
24
|
-
spec.metadata["rubygems_mfa_required"] = "true"
|
25
|
-
|
26
|
-
# Specify which files should be added to the gem when it is released.
|
27
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
|
-
spec.files = Dir.chdir(__dir__) do
|
29
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
30
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
spec.bindir = "exe"
|
35
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
36
|
-
spec.require_paths = ["lib"]
|
37
|
-
|
38
|
-
# Uncomment to register a new dependency of your gem
|
39
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
40
|
-
|
41
|
-
# For more information and examples about making a new gem, check out our
|
42
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
43
|
-
end
|