guard-puma 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/README.md +8 -0
- data/lib/guard/puma/runner.rb +17 -1
- data/lib/guard/puma/version.rb +1 -1
- data/spec/lib/guard/puma/runner_spec.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e00ac65e68f7b4921cfa5a02bc117182de5c0d9
|
4
|
+
data.tar.gz: ad040e3870595a66d6aae79cace22b5a59d6ef4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 493b03f73a243ceb4c4a8a6542d80f8e7c5be67a94b83383e80bf064f136918ddb0c37500d1eccb5cfa61a897e9432f876ef28acb87c436c733f5bd8751a2ad4
|
7
|
+
data.tar.gz: 3ec94f2e799ed2a9a8148289a13673118a97c5b62d85e6d7d655b0db0f5dae85f77a2f79011244d68cec92d36df011a3b2765d857f91ebca851833179da50839
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -54,3 +54,11 @@ end
|
|
54
54
|
1. Commit your changes (`git commit -am 'Added some feature'`)
|
55
55
|
1. Push to the branch (`git push origin my-new-feature`)
|
56
56
|
1. Create new Pull Request
|
57
|
+
|
58
|
+
## Releasing
|
59
|
+
|
60
|
+
1. Update [changelog](CHANGES.md)
|
61
|
+
1. Bump version in `lib/guard/puma/version.rb`
|
62
|
+
1. Commit
|
63
|
+
1. `gem build guard-puma.gemspec`
|
64
|
+
1. `gem push guard-puma-VERSION.gem`
|
data/lib/guard/puma/runner.rb
CHANGED
@@ -40,7 +40,11 @@ module Guard
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def start
|
43
|
-
|
43
|
+
if in_windows_cmd?
|
44
|
+
Kernel.system windows_start_cmd
|
45
|
+
else
|
46
|
+
Kernel.system nix_start_cmd
|
47
|
+
end
|
44
48
|
end
|
45
49
|
|
46
50
|
def halt
|
@@ -76,5 +80,17 @@ module Guard
|
|
76
80
|
URI "http://#{control_url}/#{cmd}?token=#{control_token}"
|
77
81
|
end
|
78
82
|
|
83
|
+
def nix_start_cmd
|
84
|
+
%{sh -c 'cd #{Dir.pwd} && puma #{cmd_opts} &'}
|
85
|
+
end
|
86
|
+
|
87
|
+
def windows_start_cmd
|
88
|
+
%{cd "#{Dir.pwd}" && start "" /B cmd /C "puma #{cmd_opts}"}
|
89
|
+
end
|
90
|
+
|
91
|
+
def in_windows_cmd?
|
92
|
+
ENV['SHELL'].nil? && !ENV['COMSPEC'].nil?
|
93
|
+
end
|
94
|
+
|
79
95
|
end
|
80
96
|
end
|
data/lib/guard/puma/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'guard/puma/runner'
|
3
|
+
require 'pry'
|
3
4
|
|
4
5
|
describe Guard::PumaRunner do
|
5
6
|
let(:runner) { Guard::PumaRunner.new(options) }
|
@@ -28,6 +29,31 @@ describe Guard::PumaRunner do
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
32
|
+
describe '#start' do
|
33
|
+
context "when on Windows" do
|
34
|
+
before do
|
35
|
+
allow(runner).to receive(:in_windows_cmd?).and_return(true)
|
36
|
+
allow(runner).to receive(:windows_start_cmd).and_return("echo 'windows'")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "runs the Windows command" do
|
40
|
+
expect(Kernel).to receive(:system).with("echo 'windows'")
|
41
|
+
runner.start
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "when on *nix" do
|
46
|
+
before do
|
47
|
+
allow(runner).to receive(:nix_start_cmd).and_return("echo 'nix'")
|
48
|
+
end
|
49
|
+
|
50
|
+
it "runs the *nix command" do
|
51
|
+
expect(Kernel).to receive(:system).with("echo 'nix'")
|
52
|
+
runner.start
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
31
57
|
|
32
58
|
describe '#sleep_time' do
|
33
59
|
let(:timeout) { 30 }
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|