From 935f0ef07403d561e99a10ecc1e775380c1b1940 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 12 Nov 2024 09:43:43 +0100 Subject: [PATCH] Assume default config is located at `config/pitchfork.rb` Fix: https://github.com/Shopify/pitchfork/discussions/146 --- CHANGELOG.md | 2 ++ lib/pitchfork/configurator.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3944a64..639c0db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Assume config file is located at `config/pitchfork.rb` if `-c` argument isn't provided. + # 0.16.0 - Use `exit!` for exiting the middle process when forking a new worker or mold. diff --git a/lib/pitchfork/configurator.rb b/lib/pitchfork/configurator.rb index a5a75081..6afe06c0 100644 --- a/lib/pitchfork/configurator.rb +++ b/lib/pitchfork/configurator.rb @@ -85,7 +85,7 @@ class Configurator def initialize(defaults = {}) #:nodoc: self.set = Hash.new(:unset) @use_defaults = defaults.delete(:use_defaults) - self.config_file = defaults.delete(:config_file) + self.config_file = defaults.delete(:config_file) { "config/pitchfork.rb" if File.exist?("config/pitchfork.rb") } set.merge!(DEFAULTS) if @use_defaults defaults.each { |key, value| self.__send__(key, value) }