cconfig 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -1
- data/.travis.yml +2 -2
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +28 -28
- data/README.md +3 -1
- data/Rakefile +1 -1
- data/cconfig.gemspec +2 -2
- data/lib/cconfig.rb +1 -1
- data/lib/cconfig/cconfig.rb +1 -1
- data/lib/cconfig/errors.rb +2 -2
- data/lib/cconfig/hash_utils.rb +1 -1
- data/lib/cconfig/railtie.rb +16 -2
- data/lib/cconfig/version.rb +2 -2
- data/lib/tasks/info.rake +1 -1
- data/spec/config_spec.rb +1 -1
- data/spec/hash_utils_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ea29ed34d129bc2fc6180e948f2cb36e4c023bf2786c28f0292495a493ae37d
|
4
|
+
data.tar.gz: 7b3e82322ca62ad505898e44fa023f38651efdb8f32fdd4360617dbdec965a88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: badbe8952eab5a3599ad63d76b9bc9c4a2861268c9aac261957c3829dbdbeada380e02f370b7cf176d8dbca5731b3f445e475244b8890a174fe3a2c44ac12e17
|
7
|
+
data.tar.gz: f56de4c02b6870a0d7a0239b62aad54313ac63bdf75e1363a7e691c99bc62e57d49473584cfab873f3c26389ff00cb6f26f1a80c0cd52c8d55d7115df5680b23
|
data/.rubocop.yml
CHANGED
@@ -2,12 +2,13 @@ require:
|
|
2
2
|
- rubocop-rspec
|
3
3
|
|
4
4
|
AllCops:
|
5
|
+
TargetRubyVersion: 2.3
|
5
6
|
DisplayCopNames: true
|
6
7
|
DisplayStyleGuide: false
|
7
8
|
|
8
9
|
# This is a remnant of old SUSE-style alignment for hashes, The table format
|
9
10
|
# looks more human readable.
|
10
|
-
Layout/
|
11
|
+
Layout/HashAlignment:
|
11
12
|
EnforcedHashRocketStyle: table
|
12
13
|
EnforcedColonStyle: table
|
13
14
|
|
@@ -51,3 +52,15 @@ RSpec/ExampleLength:
|
|
51
52
|
# Otherwise CConfig is not allowed ...
|
52
53
|
RSpec/FilePath:
|
53
54
|
Enabled: false
|
55
|
+
|
56
|
+
##
|
57
|
+
# Newly added cops
|
58
|
+
|
59
|
+
Style/HashEachMethods:
|
60
|
+
Enabled: true
|
61
|
+
|
62
|
+
Style/HashTransformKeys:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Style/HashTransformValues:
|
66
|
+
Enabled: true
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.3.0
|
4
|
+
|
5
|
+
- Added Ruby on Rails 6.x support. See
|
6
|
+
[commit](dccbf672614d87cd5bc7171d6db1fdad7d5b7657).
|
7
|
+
- Added support for Ruby 2.7, although nothing has really been done besides
|
8
|
+
adding it on the CI and checking that it works.
|
9
|
+
|
3
10
|
## 1.2.1
|
4
11
|
|
5
12
|
- Added support for Ruby 2.5 and 2.6: nothing has really been done besides
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cconfig (1.
|
4
|
+
cconfig (1.3.0)
|
5
5
|
safe_yaml (~> 1.0.0, >= 1.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,39 +9,39 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
ast (2.4.0)
|
11
11
|
diff-lcs (1.3)
|
12
|
-
jaro_winkler (1.5.
|
13
|
-
parallel (1.
|
14
|
-
parser (2.
|
12
|
+
jaro_winkler (1.5.4)
|
13
|
+
parallel (1.19.1)
|
14
|
+
parser (2.7.0.5)
|
15
15
|
ast (~> 2.4.0)
|
16
|
-
powerpack (0.1.2)
|
17
16
|
rainbow (3.0.0)
|
18
|
-
rake (
|
19
|
-
|
20
|
-
|
21
|
-
rspec-
|
22
|
-
rspec-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
rake (13.0.1)
|
18
|
+
rexml (3.2.4)
|
19
|
+
rspec (3.9.0)
|
20
|
+
rspec-core (~> 3.9.0)
|
21
|
+
rspec-expectations (~> 3.9.0)
|
22
|
+
rspec-mocks (~> 3.9.0)
|
23
|
+
rspec-core (3.9.1)
|
24
|
+
rspec-support (~> 3.9.1)
|
25
|
+
rspec-expectations (3.9.1)
|
26
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.
|
28
|
-
rspec-mocks (3.
|
27
|
+
rspec-support (~> 3.9.0)
|
28
|
+
rspec-mocks (3.9.1)
|
29
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-support (3.
|
32
|
-
rubocop (0.
|
30
|
+
rspec-support (~> 3.9.0)
|
31
|
+
rspec-support (3.9.2)
|
32
|
+
rubocop (0.80.1)
|
33
33
|
jaro_winkler (~> 1.5.1)
|
34
34
|
parallel (~> 1.10)
|
35
|
-
parser (>= 2.
|
36
|
-
powerpack (~> 0.1)
|
35
|
+
parser (>= 2.7.0.1)
|
37
36
|
rainbow (>= 2.2.2, < 4.0)
|
37
|
+
rexml
|
38
38
|
ruby-progressbar (~> 1.7)
|
39
|
-
unicode-display_width (
|
40
|
-
rubocop-rspec (1.
|
41
|
-
rubocop (>= 0.
|
42
|
-
ruby-progressbar (1.10.
|
43
|
-
safe_yaml (1.0.
|
44
|
-
unicode-display_width (1.
|
39
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
40
|
+
rubocop-rspec (1.38.1)
|
41
|
+
rubocop (>= 0.68.1)
|
42
|
+
ruby-progressbar (1.10.1)
|
43
|
+
safe_yaml (1.0.5)
|
44
|
+
unicode-display_width (1.6.1)
|
45
45
|
|
46
46
|
PLATFORMS
|
47
47
|
ruby
|
@@ -51,8 +51,8 @@ DEPENDENCIES
|
|
51
51
|
cconfig!
|
52
52
|
rake (>= 10.0)
|
53
53
|
rspec (>= 3.0)
|
54
|
-
rubocop (~> 0.
|
54
|
+
rubocop (~> 0.80.0)
|
55
55
|
rubocop-rspec
|
56
56
|
|
57
57
|
BUNDLED WITH
|
58
|
-
1.
|
58
|
+
1.17.3
|
data/README.md
CHANGED
@@ -115,6 +115,8 @@ Last but not least, this Railtie also offers a rake task called
|
|
115
115
|
`cconfig:info`. This rake task prints to standard output the evaluated
|
116
116
|
configuration.
|
117
117
|
|
118
|
+
This gem supports Ruby on Rails `5.x` and `6.x`.
|
119
|
+
|
118
120
|
## License
|
119
121
|
|
120
122
|
This project is based on work I did for the
|
@@ -122,7 +124,7 @@ This project is based on work I did for the
|
|
122
124
|
gem so it can be also used for other projects that might be interested in this.
|
123
125
|
|
124
126
|
```
|
125
|
-
Copyright (C) 2017-
|
127
|
+
Copyright (C) 2017-2020 Miquel Sabaté Solà <msabate@suse.com>
|
126
128
|
|
127
129
|
CConfig is free software: you can redistribute it and/or modify
|
128
130
|
it under the terms of the GNU Lesser General Public License as published by
|
data/Rakefile
CHANGED
data/cconfig.gemspec
CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep("^spec/")
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.required_ruby_version = ">= 2.
|
22
|
+
spec.required_ruby_version = ">= 2.3"
|
23
23
|
|
24
24
|
spec.add_dependency "safe_yaml", "~> 1.0.0", ">= 1.0.0"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", ">= 1.0.0"
|
27
27
|
spec.add_development_dependency "rake", ">= 10.0"
|
28
28
|
spec.add_development_dependency "rspec", ">= 3.0"
|
29
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
29
|
+
spec.add_development_dependency "rubocop", "~> 0.80.0"
|
30
30
|
spec.add_development_dependency "rubocop-rspec"
|
31
31
|
end
|
data/lib/cconfig.rb
CHANGED
data/lib/cconfig/cconfig.rb
CHANGED
data/lib/cconfig/errors.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017-
|
3
|
+
# Copyright (C) 2017-2020 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -21,7 +21,7 @@ module CConfig
|
|
21
21
|
# FormatError is the exception to be raised when a configuration file cannot
|
22
22
|
# be parsed.
|
23
23
|
class FormatError < StandardError
|
24
|
-
DEFAULT_MSG = "Wrong format for the config-local file!"
|
24
|
+
DEFAULT_MSG = "Wrong format for the config-local file!"
|
25
25
|
|
26
26
|
def initialize
|
27
27
|
super(DEFAULT_MSG)
|
data/lib/cconfig/hash_utils.rb
CHANGED
data/lib/cconfig/railtie.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017-
|
3
|
+
# Copyright (C) 2017-2020 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -28,7 +28,7 @@ module CConfig
|
|
28
28
|
railtie_name :cconfig
|
29
29
|
|
30
30
|
initializer "cconfig" do |app|
|
31
|
-
prefix =
|
31
|
+
prefix = ::CConfig::Railtie.fetch_prefix(app)
|
32
32
|
default = Rails.root.join("config", "config.yml")
|
33
33
|
local = Rails.root.join("config", "config-local.yml")
|
34
34
|
cfg = ::CConfig::Config.new(default: default, local: local, prefix: prefix)
|
@@ -43,5 +43,19 @@ module CConfig
|
|
43
43
|
load task
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
# fetch_prefix returns a string containing the prefix to be used by our
|
48
|
+
# CConfig::Config instance.
|
49
|
+
#
|
50
|
+
# app contains the Rails application as given by the railtie API.
|
51
|
+
def self.fetch_prefix(app)
|
52
|
+
if ENV["CCONFIG_PREFIX"].present?
|
53
|
+
ENV["CCONFIG_PREFIX"]
|
54
|
+
elsif Rails::VERSION::MAJOR >= 6
|
55
|
+
app.class.module_parent_name.inspect
|
56
|
+
else
|
57
|
+
app.class.parent_name.inspect
|
58
|
+
end
|
59
|
+
end
|
46
60
|
end
|
47
61
|
end
|
data/lib/cconfig/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017-
|
3
|
+
# Copyright (C) 2017-2020 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -19,5 +19,5 @@
|
|
19
19
|
|
20
20
|
module CConfig
|
21
21
|
# The current version of CConfig.
|
22
|
-
VERSION = "1.
|
22
|
+
VERSION = "1.3.0"
|
23
23
|
end
|
data/lib/tasks/info.rake
CHANGED
data/spec/config_spec.rb
CHANGED
data/spec/hash_utils_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mssola
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.0.0
|
20
|
-
- - "
|
20
|
+
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.0.0
|
30
|
-
- - "
|
30
|
+
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.
|
81
|
+
version: 0.80.0
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.
|
88
|
+
version: 0.80.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rubocop-rspec
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,15 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements:
|
146
146
|
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version: '2.
|
148
|
+
version: '2.3'
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
|
-
|
156
|
-
rubygems_version: 2.7.3
|
155
|
+
rubygems_version: 3.0.3
|
157
156
|
signing_key:
|
158
157
|
specification_version: 4
|
159
158
|
summary: Configuration management for container-aware applications.
|