guard-puma 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '0763889538f31e4bf352571ab6ec93bf6257eb74'
4
- data.tar.gz: 2af890d006a069d855410ec87d30bd9dade720cf
2
+ SHA256:
3
+ metadata.gz: b6e7cb3193562472fe9de202bc57e0de36c193a285fece2aff9483ec507c0b0d
4
+ data.tar.gz: a7e7804c35f85149bb5ab97f2f262e67f4a61b63dcdaad6202b96824efb1692e
5
5
  SHA512:
6
- metadata.gz: 6e2ebcb761bdc9dfe8dbddd56b7e29fa7486960e2c8790ce859f71404545c92fc23005df5df733882d17cb3a2481efc85a6f2af4df6fdbead649f40b45a82b04
7
- data.tar.gz: 6411ac22464398ac4eba2b98308ace1398d265ce88ffe0b6c6eb35fb918d767591568814d7145dd837ea02a2694fdc72d79b6ecb14cd55e0f305a46c20d7a04b
6
+ metadata.gz: 11da58b3176949ebc7ef1918e258aedfb8f4eabe4e76f8e9478b2d644cd5be10f353b134c4b983c10c6e1829ba28ff7f97520515a182bb20ef6e8126c69b26df
7
+ data.tar.gz: adfd87ad98caa8061173e64978457db3816adcebbfd7829afdfc8a21d1c872d9b6ec530308f2c47dc0b8bc57aa2363f066ee981d4f29f06b362142720886e038
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 0.5.1
4
+
5
+ * Detect and use `config/puma.rb` if present
6
+
3
7
  ## 0.5.0
4
8
 
5
9
  * Add `:pumactl` option
@@ -23,6 +23,8 @@ module Guard
23
23
  }
24
24
  if options[:config]
25
25
  puma_options['--config'] = options[:config]
26
+ elsif default_config_file_exists?
27
+ puma_options['--config'] = DEFAULT_CONFIG_FILE_PATH
26
28
  else
27
29
  puma_options['--port'] = options[:port]
28
30
  end
@@ -67,6 +69,8 @@ module Guard
67
69
 
68
70
  private
69
71
 
72
+ DEFAULT_CONFIG_FILE_PATH = "config/puma.rb".freeze
73
+
70
74
  PUMA_OPTIONS_KEYS_BY_PUMACTL = {
71
75
  true => {
72
76
  config: '--config-file',
@@ -80,6 +84,10 @@ module Guard
80
84
 
81
85
  private_constant :PUMA_OPTIONS_KEYS_BY_PUMACTL
82
86
 
87
+ def default_config_file_exists?
88
+ File.exist?(DEFAULT_CONFIG_FILE_PATH)
89
+ end
90
+
83
91
  def puma_options_key(key)
84
92
  keys = PUMA_OPTIONS_KEYS_BY_PUMACTL[@pumactl]
85
93
  keys.fetch(key) { |k| "--#{k.to_s.tr('_', '-')}" }
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module PumaVersion
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -93,6 +93,17 @@ describe Guard::PumaRunner do
93
93
  let(:path) { "/tmp/elephants" }
94
94
  let(:environment) { "special_dev" }
95
95
 
96
+ context "without pumactl but with a default config file" do
97
+ let(:options) { { pumactl: false } }
98
+
99
+ it "assumes options are set in config" do
100
+ allow_any_instance_of(Guard::PumaRunner).
101
+ to receive(:default_config_file_exists?).
102
+ and_return(true)
103
+ expect(runner.cmd_opts).to match("--config config/puma.rb")
104
+ end
105
+ end
106
+
96
107
  context "without pumactl" do
97
108
  let(:options) { { config: path, pumactl: false } }
98
109
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-11 00:00:00.000000000 Z
11
+ date: 2018-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.14
139
+ rubygems_version: 2.7.6
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Restart puma when files change