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 +5 -5
- data/CHANGES.md +4 -0
- data/lib/guard/puma/runner.rb +8 -0
- data/lib/guard/puma/version.rb +1 -1
- data/spec/lib/guard/puma/runner_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b6e7cb3193562472fe9de202bc57e0de36c193a285fece2aff9483ec507c0b0d
|
4
|
+
data.tar.gz: a7e7804c35f85149bb5ab97f2f262e67f4a61b63dcdaad6202b96824efb1692e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11da58b3176949ebc7ef1918e258aedfb8f4eabe4e76f8e9478b2d644cd5be10f353b134c4b983c10c6e1829ba28ff7f97520515a182bb20ef6e8126c69b26df
|
7
|
+
data.tar.gz: adfd87ad98caa8061173e64978457db3816adcebbfd7829afdfc8a21d1c872d9b6ec530308f2c47dc0b8bc57aa2363f066ee981d4f29f06b362142720886e038
|
data/CHANGES.md
CHANGED
data/lib/guard/puma/runner.rb
CHANGED
@@ -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('_', '-')}" }
|
data/lib/guard/puma/version.rb
CHANGED
@@ -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.
|
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-
|
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
|
139
|
+
rubygems_version: 2.7.6
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Restart puma when files change
|