blinkist-config 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -6
- data/Dockerfile +2 -2
- data/Gemfile +7 -0
- data/README.md +18 -0
- data/Rakefile +2 -3
- data/blinkist-config.gemspec +4 -5
- data/lib/blinkist/config/version.rb +1 -1
- data/lib/blinkist/config.rb +4 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf5bc1176ec1e9eec106cc54d8a178a5d147b88
|
4
|
+
data.tar.gz: 8fc749dbc0a13e1d692ae90551fd391ba1bdf960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d230f960e1941008ba6f7027337e7fe537565bff1f8b7efaafe2a05e32433d9b84ad139db02999329143f23af4bb7f0d2f1ab8243ae42b11a7a84cba92557b26
|
7
|
+
data.tar.gz: c71f8065e3f394ef965e840068d94cc1b603109f9db8d1cf1fb000c02377cd25003d4cb02b059239eefa48e8bf3495711d1abf95c13377775096ed901d5722fb
|
data/.rubocop.yml
CHANGED
data/Dockerfile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
FROM ruby:2.3.1-slim
|
2
2
|
|
3
|
-
ENV RAILS_ENV=
|
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
8
|
|
9
|
-
ENV RUNTIME_PACKAGES pkg-config
|
9
|
+
ENV RUNTIME_PACKAGES pkg-config git
|
10
10
|
|
11
11
|
RUN mkdir /tmp/tmpapp
|
12
12
|
WORKDIR /tmp/tmpapp
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Blinkist::Config
|
2
2
|
|
3
|
+
[![CircleCI](https://circleci.com/gh/blinkist/blinkist-config.svg?style=shield)](https://circleci.com/gh/blinkist/blinkist-config)
|
4
|
+
[![Dependency Status](https://www.versioneye.com/user/projects/58abf0e4b4d2a20036950ef0/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/58abf0e4b4d2a20036950ef0)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/blinkist/blinkist-config/badges/gpa.svg)](https://codeclimate.com/github/blinkist/blinkist-config)
|
6
|
+
|
3
7
|
This GEM allows you to access configuration stores with different adapters. Here're some examples of usage:
|
4
8
|
|
5
9
|
### Using the ENV
|
@@ -92,6 +96,20 @@ docker-compose run rake
|
|
92
96
|
|
93
97
|
This will execute rake and run all specs by auto correcting the code with rubocop.
|
94
98
|
|
99
|
+
If you're ready to tag a new version, do this
|
100
|
+
|
101
|
+
```
|
102
|
+
docker-compose run gem bump -t -v major|minor|patch
|
103
|
+
```
|
104
|
+
|
105
|
+
To deploy to rubygems.org do this then
|
106
|
+
|
107
|
+
```
|
108
|
+
docker-compose run gem release
|
109
|
+
```
|
110
|
+
|
111
|
+
You'll have to have proper rights to access rubygems.org
|
112
|
+
|
95
113
|
## Contributing
|
96
114
|
|
97
115
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/blinkist-config.
|
data/Rakefile
CHANGED
@@ -3,11 +3,10 @@ require "rspec/core/rake_task"
|
|
3
3
|
require "rubocop/rake_task"
|
4
4
|
|
5
5
|
RuboCop::RakeTask.new do |task|
|
6
|
-
|
7
|
-
task.patterns = ["lib/**/*.rb", "spec/**/*.rb"]
|
6
|
+
task.options = %w(-a)
|
8
7
|
end
|
9
8
|
|
10
9
|
RSpec::Core::RakeTask.new(:spec)
|
11
10
|
|
12
11
|
task(:default).clear
|
13
|
-
task default:
|
12
|
+
task default: %i(rubocop spec)
|
data/blinkist-config.gemspec
CHANGED
@@ -9,18 +9,17 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Sebastian Schleicher, Blinks Labs GmbH"]
|
10
10
|
spec.email = ["sj@blinkist.com"]
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
12
|
+
spec.summary = "Simple adapter based configuration handler (supports ENV and Consul/Diplomat)."
|
13
|
+
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."
|
14
14
|
spec.homepage = "https://github.com/blinkist/blinkist-config"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.require_paths =
|
18
|
+
spec.require_paths = %w(lib)
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.12"
|
21
|
-
spec.add_development_dependency "rake", "~>
|
21
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
22
22
|
spec.add_development_dependency "rspec", "~> 3.0"
|
23
|
-
spec.add_development_dependency "rubocop", '~> 0'
|
24
23
|
|
25
24
|
spec.add_runtime_dependency "diplomat", "~> 1"
|
26
25
|
end
|
data/lib/blinkist/config.rb
CHANGED
@@ -8,9 +8,12 @@ module Blinkist
|
|
8
8
|
attr_accessor :adapter_type, :logger, :env, :app_name
|
9
9
|
|
10
10
|
def get(key, default = nil, scope: nil)
|
11
|
-
adapter ||= Adapter.instance_for adapter_type, env, app_name
|
12
11
|
adapter.get(key, scope: scope) || default
|
13
12
|
end
|
13
|
+
|
14
|
+
def adapter
|
15
|
+
@adapter ||= Adapter.instance_for adapter_type, env, app_name
|
16
|
+
end
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blinkist-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Schleicher, Blinks Labs GmbH
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: diplomat
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|