configs 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/actions/setup-rubygems/action.yml +19 -0
- data/.github/actions/test/action.yml +15 -0
- data/.github/workflows/test-release.yml +49 -0
- data/.gitignore +1 -0
- data/README.md +2 -3
- data/Rakefile +24 -4
- data/configs.gemspec +11 -8
- data/lib/configs/railtie.rb +2 -2
- data/lib/configs/version.rb +1 -1
- data/lib/configs.rb +1 -1
- data/test/defaults_test.rb +5 -1
- data/test/test_helper.rb +1 -1
- metadata +28 -10
- data/.ruby-version +0 -1
- data/.travis.yml +0 -9
- data/gemfiles/activesupport3.2 +0 -4
- data/gemfiles/activesupport4.0 +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: de0e2b901b6f5da20a315913a8b32e037ad94ef51cbc46354934d7850ac2c81d
|
4
|
+
data.tar.gz: fd7b364e6fe10d4ecfc08fcce38c5f45a4f095a38b9d357124bdff8430b92933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47e2945d7ec363b35b4c1f89788b5defbc4ad58a41d81abd85bc2947cb684937b5d21eb0fa2bc133f2fd2fbc27dabf32159da461698c2fbad8d9e5d9ebec82bc
|
7
|
+
data.tar.gz: cb8b46fd96bf1520262b3b90787b25f6092a5d8ff73cbf618868a47fbcd9de857037bec8c98c56f29285f7b35754c26c1308c41a917872edc9dabbb79078c4d1
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: Setup RubyGems
|
2
|
+
description: Setup RubyGems credentials
|
3
|
+
inputs:
|
4
|
+
rubygems_api_key:
|
5
|
+
description: RubyGems API key
|
6
|
+
required: true
|
7
|
+
runs:
|
8
|
+
using: composite
|
9
|
+
steps:
|
10
|
+
- run: mkdir -p ~/.gem
|
11
|
+
shell: bash
|
12
|
+
- run: |
|
13
|
+
cat <<-YAML > ~/.gem/credentials
|
14
|
+
---
|
15
|
+
:rubygems_api_key: ${{ inputs.rubygems_api_key }}
|
16
|
+
YAML
|
17
|
+
shell: bash
|
18
|
+
- run: chmod 0600 ~/.gem/credentials
|
19
|
+
shell: bash
|
@@ -0,0 +1,15 @@
|
|
1
|
+
name: Test
|
2
|
+
description: Run tests
|
3
|
+
inputs:
|
4
|
+
activesupport-version:
|
5
|
+
description: ActiveSupport version constraint
|
6
|
+
required: true
|
7
|
+
runs:
|
8
|
+
using: composite
|
9
|
+
steps:
|
10
|
+
- run: bundle add activesupport -v '${{ inputs.activesupport-version }}'
|
11
|
+
shell: bash
|
12
|
+
- run: bundle install
|
13
|
+
shell: bash
|
14
|
+
- run: bundle exec rake
|
15
|
+
shell: bash
|
@@ -0,0 +1,49 @@
|
|
1
|
+
name: Test and Release
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push:
|
5
|
+
release:
|
6
|
+
types:
|
7
|
+
- published
|
8
|
+
jobs:
|
9
|
+
test:
|
10
|
+
name: >-
|
11
|
+
Test
|
12
|
+
[Ruby ${{ matrix.ruby-version }},
|
13
|
+
ActiveSupport ${{ matrix.activesupport-version }}]
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
activesupport-version:
|
18
|
+
- ~> 3.2
|
19
|
+
- ~> 4.0
|
20
|
+
- ~> 5.0
|
21
|
+
- ~> 6.0
|
22
|
+
- ~> 7.0
|
23
|
+
ruby-version:
|
24
|
+
- "3.1"
|
25
|
+
- "3.2"
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@v3
|
28
|
+
- uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby-version }}
|
31
|
+
- uses: ./.github/actions/test
|
32
|
+
with:
|
33
|
+
activesupport-version: ${{ matrix.activesupport-version }}
|
34
|
+
push:
|
35
|
+
name: Publish Gem
|
36
|
+
if: ${{ github.event.release }}
|
37
|
+
needs:
|
38
|
+
- test
|
39
|
+
runs-on: ubuntu-latest
|
40
|
+
steps:
|
41
|
+
- uses: actions/checkout@v3
|
42
|
+
- uses: ruby/setup-ruby@v1
|
43
|
+
with:
|
44
|
+
ruby-version: "3.2"
|
45
|
+
- uses: ./.github/actions/setup-rubygems
|
46
|
+
with:
|
47
|
+
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
|
48
|
+
- run: bundle install
|
49
|
+
- run: bundle exec rake gem:push
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Configs
|
2
2
|
|
3
|
+
[![Test and Release](https://github.com/kickstarter/configs/actions/workflows/test-release.yml/badge.svg)](https://github.com/kickstarter/configs/actions/workflows/test-release.yml)
|
4
|
+
|
3
5
|
Loads and manages config/*.yml files.
|
4
6
|
|
5
7
|
Searches through a few locations to find the right environment config:
|
@@ -9,9 +11,6 @@ Searches through a few locations to find the right environment config:
|
|
9
11
|
3. config/$name/default.yml
|
10
12
|
3. config/$name.yml (with 'default' key)
|
11
13
|
|
12
|
-
[![Build
|
13
|
-
Status](https://travis-ci.org/kickstarter/configs.png?branch=master)](https://travis-ci.org/kickstarter/configs)
|
14
|
-
|
15
14
|
## Installation
|
16
15
|
|
17
16
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
@@ -1,11 +1,31 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
require
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
task :default => :test
|
3
5
|
|
4
6
|
require 'rake/testtask'
|
5
7
|
Rake::TestTask.new do |t|
|
6
|
-
t.libs
|
8
|
+
t.libs << 'test'
|
7
9
|
t.test_files = FileList['test/*test.rb']
|
8
|
-
t.verbose
|
10
|
+
t.verbose = true
|
9
11
|
end
|
10
12
|
|
11
|
-
|
13
|
+
namespace :gem do
|
14
|
+
require 'bundler/gem_tasks'
|
15
|
+
|
16
|
+
@gem = "pkg/configs-#{ Configs::VERSION }.gem"
|
17
|
+
|
18
|
+
desc "Push #{ @gem } to rubygems.org"
|
19
|
+
task :push => %i[test build git:check] do
|
20
|
+
sh %{gem push #{ @gem }}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
namespace :git do
|
25
|
+
desc 'Check git workspace'
|
26
|
+
task :check do
|
27
|
+
sh %{git diff HEAD --quiet} do |ok|
|
28
|
+
abort "\e[31mRefusing to continue - git workspace is dirty\e[0m" unless ok
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/configs.gemspec
CHANGED
@@ -2,20 +2,23 @@
|
|
2
2
|
require File.expand_path('../lib/configs/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = [
|
6
|
-
gem.email = [
|
5
|
+
gem.authors = ['Lance Ivy']
|
6
|
+
gem.email = ['lance@cainlevy.net']
|
7
7
|
gem.description = "Easy (easier?) management of config/*.yml files. Defines a lookup priority for the current environment's settings."
|
8
|
-
gem.summary =
|
9
|
-
gem.homepage =
|
8
|
+
gem.summary = 'Easy (easier?) management of config/*.yml files.'
|
9
|
+
gem.homepage = 'http://github.com/kickstarter/configs'
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name =
|
15
|
-
gem.require_paths = [
|
14
|
+
gem.name = 'configs'
|
15
|
+
gem.require_paths = ['lib']
|
16
16
|
gem.version = Configs::VERSION
|
17
17
|
gem.license = 'MIT'
|
18
18
|
|
19
|
-
gem.add_dependency 'activesupport', '>3.0'
|
20
|
-
gem.add_development_dependency
|
19
|
+
gem.add_dependency 'activesupport', '> 3.0'
|
20
|
+
gem.add_development_dependency 'minitest', '> 4', '< 5.19'
|
21
|
+
gem.add_development_dependency 'rake'
|
22
|
+
|
23
|
+
gem.required_ruby_version = '~> 3.1'
|
21
24
|
end
|
data/lib/configs/railtie.rb
CHANGED
data/lib/configs/version.rb
CHANGED
data/lib/configs.rb
CHANGED
@@ -64,7 +64,7 @@ module Configs
|
|
64
64
|
def yml_file(name)
|
65
65
|
path = config_dir.join(name + '.yml')
|
66
66
|
contents = ERB.new(File.read(path)).result(binding)
|
67
|
-
YAML.load(contents).with_indifferent_access
|
67
|
+
YAML.load(contents, aliases: true).with_indifferent_access
|
68
68
|
rescue Errno::ENOENT
|
69
69
|
# If file is missing, return nil
|
70
70
|
nil
|
data/test/defaults_test.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
2
|
|
3
3
|
class DefaultsTest < Configs::TestCase
|
4
|
+
def get_environment
|
5
|
+
ENV['RACK_ENV'] ? ENV['RACK_ENV'] : 'default'
|
6
|
+
end
|
7
|
+
|
4
8
|
should "have sane defaults" do
|
5
9
|
assert_equal Pathname.new('./configs'), Configs.config_dir
|
6
|
-
assert_equal
|
10
|
+
assert_equal get_environment, Configs.environment
|
7
11
|
end
|
8
12
|
end
|
data/test/test_helper.rb
CHANGED
@@ -4,7 +4,7 @@ Bundler.require(:default, :test)
|
|
4
4
|
|
5
5
|
require 'minitest/autorun'
|
6
6
|
|
7
|
-
class Configs::TestCase < Minitest::
|
7
|
+
class Configs::TestCase < Minitest::Unit::TestCase
|
8
8
|
def self.should(name, &block) # very simple syntax
|
9
9
|
define_method("test_should_#{name.gsub(/[ -\/]/, '_').gsub(/[^a-z0-9_]/i, '_')}", &block)
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Ivy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,6 +24,26 @@ dependencies:
|
|
24
24
|
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '5.19'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '4'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.19'
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: rake
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,16 +66,15 @@ executables: []
|
|
46
66
|
extensions: []
|
47
67
|
extra_rdoc_files: []
|
48
68
|
files:
|
69
|
+
- ".github/actions/setup-rubygems/action.yml"
|
70
|
+
- ".github/actions/test/action.yml"
|
71
|
+
- ".github/workflows/test-release.yml"
|
49
72
|
- ".gitignore"
|
50
|
-
- ".ruby-version"
|
51
|
-
- ".travis.yml"
|
52
73
|
- Gemfile
|
53
74
|
- LICENSE
|
54
75
|
- README.md
|
55
76
|
- Rakefile
|
56
77
|
- configs.gemspec
|
57
|
-
- gemfiles/activesupport3.2
|
58
|
-
- gemfiles/activesupport4.0
|
59
78
|
- lib/configs.rb
|
60
79
|
- lib/configs/railtie.rb
|
61
80
|
- lib/configs/version.rb
|
@@ -73,17 +92,16 @@ require_paths:
|
|
73
92
|
- lib
|
74
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
94
|
requirements:
|
76
|
-
- - "
|
95
|
+
- - "~>"
|
77
96
|
- !ruby/object:Gem::Version
|
78
|
-
version: '
|
97
|
+
version: '3.1'
|
79
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
99
|
requirements:
|
81
100
|
- - ">="
|
82
101
|
- !ruby/object:Gem::Version
|
83
102
|
version: '0'
|
84
103
|
requirements: []
|
85
|
-
|
86
|
-
rubygems_version: 2.2.2
|
104
|
+
rubygems_version: 3.4.10
|
87
105
|
signing_key:
|
88
106
|
specification_version: 4
|
89
107
|
summary: Easy (easier?) management of config/*.yml files.
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.2
|
data/.travis.yml
DELETED
data/gemfiles/activesupport3.2
DELETED
data/gemfiles/activesupport4.0
DELETED