diff options
author | Tim Smith <tsmith@chef.io> | 2019-08-07 10:56:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-07 10:56:06 -0700 |
commit | 3486c8da2b8e97fad1f3dd534f0c6d89bac33b83 (patch) | |
tree | bf2e67c994025f3403e58ab53b253fed0b92b5d3 | |
parent | 20848a394e034189660be0a5460334c8ef344fb0 (diff) | |
parent | 581a557efe1b3a685e2dfa092863c0addb914404 (diff) | |
download | mixlib-config-3486c8da2b8e97fad1f3dd534f0c6d89bac33b83.tar.gz |
Merge pull request #77 from chef/bk
Test on Windows and use the smaller containers
-rw-r--r-- | .expeditor/config.yml | 2 | ||||
-rw-r--r-- | .expeditor/verify.pipeline.yml | 27 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | Rakefile | 2 | ||||
-rw-r--r-- | features/steps/config_steps.rb | 2 | ||||
-rw-r--r-- | lib/mixlib/config.rb | 18 |
6 files changed, 36 insertions, 16 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 7d2223e..e6d81c5 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -11,6 +11,8 @@ rubygems: github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true + # The tag format to use (e.g. v1.0.0) + version_tag_format: "v{{version}}" # allow bumping the minor release via label minor_bump_labels: - "Expeditor: Bump Version Minor" diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index a3efc1c..7865325 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -1,28 +1,43 @@ +--- +expeditor: + defaults: + buildkite: + timeout_in_minutes: 30 + steps: - label: run-lint-and-specs-ruby-2.4 command: - - asdf local ruby 2.4.5 - - bundle install --jobs=7 --retry=3 + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: docker: + image: ruby:2.4-stretch - label: run-lint-and-specs-ruby-2.5 command: - - asdf local ruby 2.5.5 - - bundle install --jobs=7 --retry=3 + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: docker: + image: ruby:2.5-stretch - label: run-lint-and-specs-ruby-2.6 command: - - asdf local ruby 2.6.3 - - bundle install --jobs=7 --retry=3 + - bundle install --jobs=7 --retry=3 --without docs debug + - bundle exec rake + expeditor: + executor: + docker: + image: ruby:2.6-stretch + +- label: run-specs-windows + command: + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: docker: + host_os: windows @@ -1,6 +1,7 @@ # Mixlib::Config [![Gem Version](https://badge.fury.io/rb/mixlib-config.svg)](https://badge.fury.io/rb/mixlib-config) +[![Build status](https://badge.buildkite.com/038bff14d03b1f91115dbb444ca81b387bd23855413f017fc0.svg?branch=master)](https://buildkite.com/chef-oss/chef-mixlib-config-master-verify) **Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md) @@ -3,7 +3,7 @@ require "rspec/core/rake_task" Bundler::GemHelper.install_tasks -task default: [:style, :spec] +task default: %i{style spec} desc "Run specs" RSpec::Core::RakeTask.new(:spec) do |spec| diff --git a/features/steps/config_steps.rb b/features/steps/config_steps.rb index 738f175..93b7373 100644 --- a/features/steps/config_steps.rb +++ b/features/steps/config_steps.rb @@ -46,7 +46,7 @@ Then(/^in configuration class '(.+)' config option '(.+)' is '(.+)'$/) do |class end When(/^I set '(.+)' to:$/) do |key, foo_table| - ConfigIt[key.to_sym] = Array.new + ConfigIt[key.to_sym] = [] foo_table.hashes.each do |hash| ConfigIt[key.to_sym] << hash["key"] end diff --git a/lib/mixlib/config.rb b/lib/mixlib/config.rb index 6809b24..9937182 100644 --- a/lib/mixlib/config.rb +++ b/lib/mixlib/config.rb @@ -33,11 +33,11 @@ module Mixlib class << base; attr_accessor :config_context_lists; end class << base; attr_accessor :config_context_hashes; end class << base; attr_accessor :config_parent; end - base.configuration = Hash.new - base.configurables = Hash.new - base.config_contexts = Hash.new - base.config_context_lists = Hash.new - base.config_context_hashes = Hash.new + base.configuration = ({}) + base.configurables = ({}) + base.config_contexts = ({}) + base.config_context_lists = ({}) + base.config_context_hashes = ({}) base.initialize_mixlib_config end @@ -165,8 +165,8 @@ module Mixlib # Resets all config options to their defaults. def reset - self.configuration = Hash.new - config_contexts.values.each { |config_context| config_context.reset } + self.configuration = ({}) + config_contexts.values.each(&:reset) end # Makes a copy of any non-default values. @@ -372,6 +372,7 @@ module Mixlib if config_contexts.key?(symbol) raise ReopenedConfigContextWithConfigurableError, "Cannot redefine config_context #{symbol} as a configurable value" end + configurables[symbol] = Configurable.new(symbol) define_attr_accessor_methods(symbol) end @@ -531,9 +532,10 @@ module Mixlib # <ArgumentError>:: if value is set to something other than true, false, or :warn # def config_strict_mode=(value) - if ![ true, false, :warn, nil ].include?(value) + unless [ true, false, :warn, nil ].include?(value) raise ArgumentError, "config_strict_mode must be true, false, nil or :warn" end + @config_strict_mode = value end |