blinkist-config 1.3.1 → 1.4.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/.github/workflows/ci.yml +27 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/Dockerfile +7 -3
- data/Gemfile +8 -1
- data/README.md +21 -9
- data/Rakefile +5 -6
- data/blinkist-config.gemspec +16 -17
- data/docker-compose.yml +2 -3
- data/lib/blinkist/config/adapters/adapter.rb +1 -1
- data/lib/blinkist/config/adapters/aws_ssm_adapter.rb +13 -10
- data/lib/blinkist/config/adapters/diplomat_adapter.rb +3 -5
- data/lib/blinkist/config/error_handlers/error_handler.rb +1 -1
- data/lib/blinkist/config/error_handlers/production_only_error_handler.rb +1 -1
- data/lib/blinkist/config/error_handlers.rb +0 -1
- data/lib/blinkist/config/factory.rb +2 -2
- data/lib/blinkist/config/version.rb +1 -1
- data/lib/blinkist/config.rb +7 -8
- metadata +12 -53
- data/.circleci/config.yml +0 -26
- data/.rubocop.yml +0 -71
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bb5e2fe4f325f1f3a8d4a9c5c90869bdaa4dbfda924ea1924262343f67516b2
|
4
|
+
data.tar.gz: aff6fc8557d9a1d198441ef9516e7278e347a55d41e192d62b5b1e7dd01d8a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdab1d7adc48147f58e2aa9d38798cfd660eb07496b755ff26b100ae650915e365266c964d2a6491fe3e0aaabe5da03f57af6b0a518ef3465f56bcdc44947ff6
|
7
|
+
data.tar.gz: d9e7e893de135f92651afa148ddef9302d60100e8d54a7216ef3443f21e8428a33fd00747f5e6255963d7f4378aa94134d8b855980013ba18f1b4b8fabf90c93
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: Run tests
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v4
|
12
|
+
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 3.2.8
|
17
|
+
bundler-cache: true
|
18
|
+
bundler: "2.6.9"
|
19
|
+
|
20
|
+
- name: Bundle Install
|
21
|
+
run: bundle install --jobs=4 --retry=3 --path=vendor/bundle
|
22
|
+
|
23
|
+
- name: Run RSpec
|
24
|
+
env:
|
25
|
+
RAILS_ENV: test
|
26
|
+
RACK_ENV: test
|
27
|
+
run: bundle exec rspec --format progress spec
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ main ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ main ]
|
20
|
+
schedule:
|
21
|
+
- cron: '35 19 * * 6'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v2
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v1
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
52
|
+
|
53
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
55
|
+
- name: Autobuild
|
56
|
+
uses: github/codeql-action/autobuild@v1
|
57
|
+
|
58
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
59
|
+
# 📚 https://git.io/JvXDl
|
60
|
+
|
61
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
62
|
+
# and modify them (or add more) to build your code if your project
|
63
|
+
# uses a compiled language
|
64
|
+
|
65
|
+
#- run: |
|
66
|
+
# make bootstrap
|
67
|
+
# make release
|
68
|
+
|
69
|
+
- name: Perform CodeQL Analysis
|
70
|
+
uses: github/codeql-action/analyze@v1
|
data/Dockerfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
FROM ruby:
|
1
|
+
FROM ruby:3.3.0-slim
|
2
2
|
|
3
3
|
ENV RAILS_ENV=test
|
4
4
|
ENV LANG en_US.UTF-8
|
5
5
|
ENV LANGUAGE en_US.UTF-8
|
6
6
|
ENV LC_ALL en_US.UTF-8
|
7
7
|
ENV LC_CTYPE en_US.UTF-8
|
8
|
+
ENV XDG_CACHE_HOME /nonexistent/.cache
|
8
9
|
|
9
10
|
ENV RUNTIME_PACKAGES pkg-config git
|
10
11
|
|
@@ -13,7 +14,8 @@ WORKDIR /tmp/tmpapp
|
|
13
14
|
ADD . /tmp/tmpapp
|
14
15
|
|
15
16
|
RUN echo 'gem: --no-document' >> ~/.gemrc && \
|
16
|
-
apt-get clean && apt-get update -qq &&
|
17
|
+
apt-get clean && apt-get update -qq && \
|
18
|
+
apt-get install -y build-essential $RUNTIME_PACKAGES && \
|
17
19
|
gem install bundler --version 2.2.10 && \
|
18
20
|
gem install gem-release && \
|
19
21
|
bundle update && bundle install --jobs 20 --retry 5 && \
|
@@ -26,7 +28,9 @@ WORKDIR /app
|
|
26
28
|
|
27
29
|
RUN bundle install -j1
|
28
30
|
|
29
|
-
RUN
|
31
|
+
RUN mkdir -p /nonexistent && \
|
32
|
+
mkdir -p /nonexistent/.cache && \
|
33
|
+
chown -R nobody:nogroup /app /nonexistent
|
30
34
|
RUN whoami
|
31
35
|
USER nobody
|
32
36
|
RUN whoami
|
data/Gemfile
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in blinkist-config.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
group :development do
|
7
|
+
gem "bundler", "~> 2.6.9"
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
gem "standard", ">= 1.50.0"
|
10
|
+
end
|
11
|
+
|
6
12
|
group :test do
|
7
13
|
gem "codeclimate-test-reporter", "~> 1.0.0"
|
14
|
+
gem "rspec"
|
8
15
|
gem "simplecov"
|
9
16
|
end
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ my_config_value = Blinkist::Config.get! "some/folder/config"
|
|
27
27
|
### Error handling
|
28
28
|
|
29
29
|
When configured with `Blinkist::Config.error_handler = :strict` (as recommended)
|
30
|
-
reading a configuration entry for which the value is missing
|
30
|
+
reading a configuration entry for which the value is missing
|
31
31
|
(for example missing enviroment variables) will cause
|
32
32
|
`Blinkist::Config::ValueMissingError` to be raised.
|
33
33
|
|
@@ -48,12 +48,24 @@ my_config_value = Blinkist::Config.get! "some/folder/config", "default value"
|
|
48
48
|
# If ENV["SOME_FOLDER_CONFIG"] is nil, "default value" will be returned
|
49
49
|
```
|
50
50
|
|
51
|
+
### Refetching a value
|
52
|
+
|
53
|
+
If you want to refetch a value from the config store, you can set the `refetch` parameter to `true`.
|
54
|
+
**WARNING**: This will cut into our SSM quota on AWS - please use this with caution and behind another way of caching.
|
55
|
+
See [AWS SSM Quota](https://docs.aws.amazon.com/general/latest/gr/ssm.html#parameter-store) for more information.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
my_config_value = Blinkist::Config.get! "some/folder/config", refetch: true
|
59
|
+
|
60
|
+
# This will reload the value from the config store, even if it's cached. The re-fetched value will then be cached.
|
61
|
+
```
|
62
|
+
|
51
63
|
### Using Diplomat & Consul
|
52
64
|
|
53
65
|
If you want to use Consul's key value store, simply use our diplomat adapter.
|
54
66
|
|
55
|
-
|
56
|
-
|
67
|
+
- [https://www.consul.io/](https://www.consul.io/)
|
68
|
+
- [https://github.com/WeAreFarmGeek/diplomat](https://github.com/WeAreFarmGeek/diplomat)
|
57
69
|
|
58
70
|
The GEM expects consul to listen to `http://172.17.0.1:8500`
|
59
71
|
|
@@ -69,6 +81,7 @@ my_config_value = Blinkist::Config.get! "some/folder/config"
|
|
69
81
|
```
|
70
82
|
|
71
83
|
### Using Diplomat with a folder scope
|
84
|
+
|
72
85
|
```ruby
|
73
86
|
# Here we setting a scope outside of the app
|
74
87
|
|
@@ -99,6 +112,7 @@ Blinkist::Config.preload scope: "global" # in case you need also another scope b
|
|
99
112
|
```
|
100
113
|
|
101
114
|
### Using SSM with a folder scope
|
115
|
+
|
102
116
|
```ruby
|
103
117
|
# Here we setting a scope outside of the app
|
104
118
|
|
@@ -107,7 +121,6 @@ my_config_value = Blinkist::Config.get! "another/config", scope: "global"
|
|
107
121
|
# This will replace `my_nice_app` with `global` and try to resolve "/application/global/another/config"
|
108
122
|
```
|
109
123
|
|
110
|
-
|
111
124
|
## Installation
|
112
125
|
|
113
126
|
Add this line to your application's Gemfile:
|
@@ -141,21 +154,21 @@ require "rails"
|
|
141
154
|
You can build this project easily with [docker compose](https://docs.docker.com/compose/).
|
142
155
|
|
143
156
|
```
|
144
|
-
docker
|
157
|
+
docker compose run rake
|
145
158
|
```
|
146
159
|
|
147
|
-
This will execute rake and run all specs by auto correcting the code with
|
160
|
+
This will execute rake and run all specs by auto correcting the code with StandardRB.
|
148
161
|
|
149
162
|
If you're ready to tag a new version, do this
|
150
163
|
|
151
164
|
```
|
152
|
-
docker
|
165
|
+
docker compose run gem bump -t -v major|minor|patch
|
153
166
|
```
|
154
167
|
|
155
168
|
To deploy to rubygems.org do this then
|
156
169
|
|
157
170
|
```
|
158
|
-
docker
|
171
|
+
docker compose run gem release
|
159
172
|
```
|
160
173
|
|
161
174
|
You'll have to have proper rights to access rubygems.org
|
@@ -164,7 +177,6 @@ You'll have to have proper rights to access rubygems.org
|
|
164
177
|
|
165
178
|
Bug reports and pull requests are welcome on GitHub at https://github.com/blinkist/blinkist-config.
|
166
179
|
|
167
|
-
|
168
180
|
## License
|
169
181
|
|
170
182
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
|
-
require "rubocop/rake_task"
|
4
|
-
|
5
|
-
RuboCop::RakeTask.new do |task|
|
6
|
-
task.options = %w(-a)
|
7
|
-
end
|
8
3
|
|
9
4
|
RSpec::Core::RakeTask.new(:spec)
|
10
5
|
|
6
|
+
task :standardrb do
|
7
|
+
sh "bundle exec standardrb --fix"
|
8
|
+
end
|
9
|
+
|
11
10
|
task(:default).clear
|
12
|
-
task default: %i
|
11
|
+
task default: %i[standardrb spec]
|
data/blinkist-config.gemspec
CHANGED
@@ -1,26 +1,25 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require_relative "lib/blinkist/config/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
6
|
+
spec.name = "blinkist-config"
|
7
|
+
spec.version = Blinkist::Config::VERSION
|
8
|
+
spec.authors = ["Sebastian Schleicher, Blinks Labs GmbH"]
|
9
|
+
spec.email = ["sj@blinkist.com"]
|
10
|
+
|
11
|
+
spec.required_ruby_version = ">= 3.2.8"
|
11
12
|
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
13
|
+
spec.summary = "Simple adapter based configuration handler (supports ENV and Consul/Diplomat)."
|
14
|
+
spec.description = "This GEM allows you to keep your configuration class-based by calling Blinkist::Config.get!(...) instead of accessing the ENV directly. You can set up different types of adapters to connect to various configuration systems like your ENV or Consul's key-value-store."
|
15
|
+
spec.homepage = "https://github.com/blinkist/blinkist-config"
|
16
|
+
spec.license = "MIT"
|
16
17
|
|
17
|
-
spec.files
|
18
|
-
spec.require_paths = %w
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.require_paths = %w[lib]
|
19
20
|
|
20
|
-
spec.
|
21
|
-
spec.
|
22
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
21
|
+
spec.add_dependency "aws-sdk-ssm", "~> 1"
|
22
|
+
spec.add_dependency "diplomat", "~> 2"
|
23
23
|
|
24
|
-
spec.
|
25
|
-
spec.add_runtime_dependency "aws-sdk-ssm", "~> 1"
|
24
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
26
25
|
end
|
data/docker-compose.yml
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
version: "2"
|
2
1
|
services:
|
3
2
|
rake:
|
4
3
|
entrypoint: bundle exec rake
|
@@ -9,7 +8,7 @@ services:
|
|
9
8
|
- RACK_ENV=test
|
10
9
|
volumes:
|
11
10
|
- .:/app
|
12
|
-
|
11
|
+
|
13
12
|
gem:
|
14
13
|
build:
|
15
14
|
context: .
|
@@ -18,4 +17,4 @@ services:
|
|
18
17
|
- .:/app
|
19
18
|
- ~/.gitconfig:/nonexistent/.gitconfig
|
20
19
|
- ~/.ssh:/nonexistent/.ssh
|
21
|
-
- ~/.gem:/nonexistent/.gem
|
20
|
+
- ~/.gem:/nonexistent/.gem
|
@@ -7,16 +7,16 @@ module Blinkist
|
|
7
7
|
DEFAULT_PREFIX = "/application/".freeze
|
8
8
|
|
9
9
|
def initialize(env, app_name)
|
10
|
-
super
|
10
|
+
super
|
11
11
|
|
12
12
|
@items_cache = {}
|
13
13
|
@client = Aws::SSM::Client.new
|
14
14
|
end
|
15
15
|
|
16
|
-
def get(key, default=nil, scope: nil)
|
16
|
+
def get(key, default = nil, scope: nil, refetch: false)
|
17
17
|
prefix = prefix_for(scope)
|
18
18
|
|
19
|
-
query_ssm_parameter
|
19
|
+
query_ssm_parameter(prefix + key, refetch)
|
20
20
|
rescue Aws::SSM::Errors::ParameterNotFound
|
21
21
|
default
|
22
22
|
end
|
@@ -29,17 +29,20 @@ module Blinkist
|
|
29
29
|
|
30
30
|
def prefix_for(scope)
|
31
31
|
if scope.nil?
|
32
|
-
DEFAULT_PREFIX
|
32
|
+
"#{DEFAULT_PREFIX}#{@app_name}/"
|
33
33
|
else
|
34
|
-
DEFAULT_PREFIX
|
34
|
+
"#{DEFAULT_PREFIX}#{scope}/"
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def query_ssm_parameter(name)
|
39
|
-
|
40
|
-
name
|
41
|
-
|
42
|
-
|
38
|
+
def query_ssm_parameter(name, refetch)
|
39
|
+
if refetch || !@items_cache.key?(name)
|
40
|
+
@items_cache[name] = @client.get_parameter(
|
41
|
+
name: name,
|
42
|
+
with_decryption: true
|
43
|
+
).parameter.value
|
44
|
+
end
|
45
|
+
@items_cache[name]
|
43
46
|
end
|
44
47
|
|
45
48
|
def query_all_ssm_parameters(prefix)
|
@@ -5,19 +5,17 @@ module Blinkist
|
|
5
5
|
class Config
|
6
6
|
class DiplomatAdapter < Adapter
|
7
7
|
def initialize(env, app_name)
|
8
|
-
super
|
8
|
+
super
|
9
9
|
|
10
10
|
@items_cache = {}
|
11
11
|
end
|
12
12
|
|
13
|
-
def get(key, default=nil, scope: nil)
|
13
|
+
def get(key, default = nil, scope: nil, refetch: false)
|
14
14
|
scope ||= @app_name
|
15
15
|
|
16
16
|
diplomat_key = "#{scope}/#{key}"
|
17
17
|
|
18
|
-
|
19
|
-
@items_cache[diplomat_key] = Diplomat::Kv.get(diplomat_key)
|
20
|
-
end
|
18
|
+
@items_cache[diplomat_key] = Diplomat::Kv.get(diplomat_key) if refetch || !@items_cache.key?(diplomat_key)
|
21
19
|
|
22
20
|
@items_cache[diplomat_key]
|
23
21
|
rescue Diplomat::KeyNotFound
|
@@ -7,7 +7,7 @@ module Blinkist
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(key, scope)
|
10
|
-
raise ValueMissingError, "Missing value for #{key} in the scope: #{scope ||
|
10
|
+
raise ValueMissingError, "Missing value for #{key} in the scope: #{scope || "<default>"} (Please check the configuration for missing keys)"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Blinkist
|
2
2
|
class Config
|
3
3
|
class Factory
|
4
|
-
def initialize(aspect, implementations, env=Blinkist::Config.env, app_name=Blinkist::Config.app_name)
|
4
|
+
def initialize(aspect, implementations, env = Blinkist::Config.env, app_name = Blinkist::Config.app_name)
|
5
5
|
@aspect = aspect
|
6
6
|
@implementations = implementations
|
7
7
|
@env = env
|
@@ -12,7 +12,7 @@ module Blinkist
|
|
12
12
|
case strategy
|
13
13
|
when Symbol
|
14
14
|
klass = @implementations[strategy] ||
|
15
|
-
|
15
|
+
raise(NotImplementedError, "Unknown strategy #{strategy} for #{@aspect}")
|
16
16
|
when Class
|
17
17
|
klass = strategy
|
18
18
|
else
|
data/lib/blinkist/config.rb
CHANGED
@@ -17,8 +17,8 @@ module Blinkist
|
|
17
17
|
class << self
|
18
18
|
attr_accessor :adapter_type, :logger, :env, :app_name, :error_handler
|
19
19
|
|
20
|
-
def get(key, default = nil, scope: nil)
|
21
|
-
get!(key, default, scope: scope)
|
20
|
+
def get(key, default = nil, scope: nil, refetch: false)
|
21
|
+
get!(key, default, scope: scope, refetch: refetch)
|
22
22
|
end
|
23
23
|
|
24
24
|
def preload(scope: nil)
|
@@ -28,26 +28,26 @@ module Blinkist
|
|
28
28
|
extend Gem::Deprecate
|
29
29
|
deprecate :get, "get!", 2017, 12
|
30
30
|
|
31
|
-
def get!(key, *args, scope: nil)
|
31
|
+
def get!(key, *args, scope: nil, refetch: false)
|
32
32
|
# NOTE: we need to do this this way
|
33
33
|
# to handle 'nil' default correctly
|
34
34
|
case args.length
|
35
35
|
when 0
|
36
36
|
default = nil
|
37
|
-
bang
|
37
|
+
bang = true
|
38
38
|
when 1
|
39
39
|
default = args.first
|
40
|
-
bang
|
40
|
+
bang = false
|
41
41
|
else
|
42
42
|
raise ArgumentError, "wrong number of arguments (given #{args.length + 1}, expected 1..2)"
|
43
43
|
end
|
44
44
|
|
45
|
-
from_adapter = adapter.get(key, scope: scope)
|
45
|
+
from_adapter = adapter.get(key, scope: scope, refetch: refetch)
|
46
46
|
|
47
47
|
if from_adapter.nil? && bang
|
48
48
|
handle_error(key, scope)
|
49
49
|
else
|
50
|
-
|
50
|
+
from_adapter || default
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -59,7 +59,6 @@ module Blinkist
|
|
59
59
|
handler = Factory.new("Blinkist::Config.error_handler", ErrorHandlers::BUILT_IN).call(error_handler)
|
60
60
|
handler.call(key, scope)
|
61
61
|
end
|
62
|
-
|
63
62
|
end
|
64
63
|
|
65
64
|
# NOTE: default configuration goes here
|
metadata
CHANGED
@@ -1,57 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blinkist-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Schleicher, Blinks Labs GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.2.10
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.2.10
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '12.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '12.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
14
|
+
name: aws-sdk-ssm
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
44
16
|
requirements:
|
45
17
|
- - "~>"
|
46
18
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
19
|
+
version: '1'
|
20
|
+
type: :runtime
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
24
|
- - "~>"
|
53
25
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
26
|
+
version: '1'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: diplomat
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +38,6 @@ dependencies:
|
|
66
38
|
- - "~>"
|
67
39
|
- !ruby/object:Gem::Version
|
68
40
|
version: '2'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: aws-sdk-ssm
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1'
|
83
41
|
description: This GEM allows you to keep your configuration class-based by calling
|
84
42
|
Blinkist::Config.get!(...) instead of accessing the ENV directly. You can set up
|
85
43
|
different types of adapters to connect to various configuration systems like your
|
@@ -90,9 +48,9 @@ executables: []
|
|
90
48
|
extensions: []
|
91
49
|
extra_rdoc_files: []
|
92
50
|
files:
|
93
|
-
- ".
|
51
|
+
- ".github/workflows/ci.yml"
|
52
|
+
- ".github/workflows/codeql-analysis.yml"
|
94
53
|
- ".gitignore"
|
95
|
-
- ".rubocop.yml"
|
96
54
|
- Dockerfile
|
97
55
|
- Gemfile
|
98
56
|
- LICENSE
|
@@ -121,7 +79,8 @@ files:
|
|
121
79
|
homepage: https://github.com/blinkist/blinkist-config
|
122
80
|
licenses:
|
123
81
|
- MIT
|
124
|
-
metadata:
|
82
|
+
metadata:
|
83
|
+
rubygems_mfa_required: 'true'
|
125
84
|
post_install_message:
|
126
85
|
rdoc_options: []
|
127
86
|
require_paths:
|
@@ -130,14 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
89
|
requirements:
|
131
90
|
- - ">="
|
132
91
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
92
|
+
version: 3.2.8
|
134
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
94
|
requirements:
|
136
95
|
- - ">="
|
137
96
|
- !ruby/object:Gem::Version
|
138
97
|
version: '0'
|
139
98
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.5.3
|
141
100
|
signing_key:
|
142
101
|
specification_version: 4
|
143
102
|
summary: Simple adapter based configuration handler (supports ENV and Consul/Diplomat).
|
data/.circleci/config.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
jobs:
|
3
|
-
build:
|
4
|
-
working_directory: ~/blinkist/blinkist-config
|
5
|
-
parallelism: 1
|
6
|
-
docker:
|
7
|
-
- image: cimg/ruby:2.7.3-browsers
|
8
|
-
steps:
|
9
|
-
- checkout
|
10
|
-
- restore_cache:
|
11
|
-
keys:
|
12
|
-
- gem-cache-{{ checksum "Gemfile.lock" }}
|
13
|
-
- gem-cache-
|
14
|
-
- run:
|
15
|
-
name: Bundle Install
|
16
|
-
command: bundle install --jobs=4 --retry=3 --path=vendor/bundle
|
17
|
-
- save_cache:
|
18
|
-
key: gem-cache-{{ checksum "Gemfile.lock" }}
|
19
|
-
paths:
|
20
|
-
- vendor/bundle
|
21
|
-
- run:
|
22
|
-
name: RSpec
|
23
|
-
command: bundle exec rspec --format progress spec
|
24
|
-
environment:
|
25
|
-
RAILS_ENV: test
|
26
|
-
RACK_ENV: test
|
data/.rubocop.yml
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
Lint/ParenthesesAsGroupedExpression:
|
2
|
-
Enabled: true
|
3
|
-
Exclude:
|
4
|
-
- 'spec/**/*'
|
5
|
-
|
6
|
-
Metrics/ModuleLength:
|
7
|
-
Exclude:
|
8
|
-
- "**/*_spec.rb"
|
9
|
-
|
10
|
-
Metrics/BlockLength:
|
11
|
-
Exclude:
|
12
|
-
- "**/*_spec.rb"
|
13
|
-
|
14
|
-
Style/BlockDelimiters:
|
15
|
-
Enabled: true
|
16
|
-
Exclude:
|
17
|
-
- 'spec/**/*'
|
18
|
-
|
19
|
-
Style/Documentation:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Style/EmptyLinesAroundClassBody:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/EmptyLinesAroundModuleBody:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
Style/GuardClause:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
Style/PredicateName:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
Style/SignalException:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Style/SpaceAroundEqualsInParameterDefault:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Style/StringLiterals:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
Style/ZeroLengthPredicate:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
# Offense count: 9
|
47
|
-
Metrics/AbcSize:
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
# Offense count: 1
|
51
|
-
# Configuration parameters: CountComments.
|
52
|
-
Metrics/ClassLength:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
# Offense count: 2
|
56
|
-
Metrics/CyclomaticComplexity:
|
57
|
-
Enabled: false
|
58
|
-
|
59
|
-
# Offense count: 79
|
60
|
-
# Configuration parameters: AllowURI, URISchemes.
|
61
|
-
Metrics/LineLength:
|
62
|
-
Enabled: false
|
63
|
-
|
64
|
-
# Offense count: 10
|
65
|
-
# Configuration parameters: CountComments.
|
66
|
-
Metrics/MethodLength:
|
67
|
-
Enabled: false
|
68
|
-
|
69
|
-
# Offense count: 2
|
70
|
-
Metrics/PerceivedComplexity:
|
71
|
-
Enabled: false
|