guard-puma 0.3.1 → 0.3.2

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
2
  SHA1:
3
- metadata.gz: 036598d285f6aa1103ccf4e48abb0c58e66530c1
4
- data.tar.gz: 1ebf5c56e2076d16d9aacb1f7bfe0cf37957ae3c
3
+ metadata.gz: f82c7f0d0161b84644bcc3cc3ad5c3ae7bdeef03
4
+ data.tar.gz: 862bc63da4eecb9d3715639c72827f13bde94bf0
5
5
  SHA512:
6
- metadata.gz: 83f78820ab526fd80559a5db1626934b5f39731353970cd24527edc5a0e23a6e8d11858392311b7e3512064033be3389dcf31395deaa6eb62716d65928cf00b8
7
- data.tar.gz: 7e72cb3b760f031f1a8044c5dd916faa8afde30d6454284933ecbf19932b427d0997a4502854dc9a766cdf5ada043fee6d174df1406d264d812b4a854bc0dab3
6
+ metadata.gz: 312508f7cfaecb959ab5d093298d2da205f6da13c15f474df40ea9f6fb199c2bc86db9202f41470fa2b1bcde306ab6476ea3eb5ee9ad1c74c0a38d78217a2b74
7
+ data.tar.gz: 87130577132cd45658b41b4e2502ca3a68edf135b2f20c0c36008957545321d2d65c95595e8e3d07b0349303d8d794427edf5bf11c49137aac0110438981f91b
@@ -1,7 +1,7 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 1.9.3
4
- - 2.1.2
5
+ - 2.2.3
5
6
  - rbx-2
6
- - jruby-19mode
7
- install: bundle install --retry=3
7
+ - jruby-9.0.0.0
data/CHANGES.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changes
2
2
 
3
+ * Update Guardfile to support new options
4
+ * Let --config take precedence over default options
5
+
3
6
  ## 0.3.1
4
7
 
5
8
  * Update RSpec to 3.1.0+
data/Guardfile CHANGED
@@ -1,7 +1,13 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
3
 
4
- guard 'rspec', version: 2, cli: '--colour', focus: true, all_on_start: false, all_after_pass: false, keep_failed: false do
4
+ guard 'rspec', {
5
+ cmd: 'bundle exec rspec',
6
+ cmd_additional_args: '--colour',
7
+ focus: true,
8
+ all_on_start: false,
9
+ all_after_pass: false,
10
+ failed_mode: :none } do
5
11
  watch(%r{^spec/.+_spec\.rb$})
6
12
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
13
  watch('spec/spec_helper.rb') { "spec" }
@@ -14,6 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ["lib"]
15
15
  gem.version = Guard::PumaVersion::VERSION
16
16
  gem.add_dependency "guard", "~> 2.8"
17
+ gem.add_dependency "guard-compat", "~> 1.0"
17
18
  gem.add_dependency "puma"
18
19
  gem.add_development_dependency "rake", "~> 10.2"
19
20
  gem.add_development_dependency "rspec", "~> 3.1.0"
@@ -3,6 +3,7 @@ require "guard/plugin"
3
3
  require "guard/puma/runner"
4
4
  require "rbconfig"
5
5
  require "guard/puma/version"
6
+ require "guard/compat/plugin"
6
7
 
7
8
  module Guard
8
9
  class Puma < Plugin
@@ -15,13 +15,19 @@ module Guard
15
15
  @quiet = options.delete(:quiet) { true }
16
16
  @options = options
17
17
 
18
- puma_options = {
19
- '--port' => options[:port],
20
- '--control-token' => @control_token,
21
- '--control' => "tcp://#{@control_url}",
22
- '--environment' => options[:environment]
23
- }
24
- [:config, :bind, :threads].each do |opt|
18
+ if options[:config]
19
+ puma_options = {
20
+ '--config' => options[:config]
21
+ }
22
+ else
23
+ puma_options = {
24
+ '--port' => options[:port],
25
+ '--control-token' => @control_token,
26
+ '--control' => "tcp://#{@control_url}",
27
+ '--environment' => options[:environment]
28
+ }
29
+ end
30
+ [:bind, :threads].each do |opt|
25
31
  puma_options["--#{opt}"] = options[opt] if options[opt]
26
32
  end
27
33
  puma_options = puma_options.to_a.flatten
@@ -46,7 +52,7 @@ module Guard
46
52
  end
47
53
 
48
54
  private
49
-
55
+
50
56
  def run_puma_command!(cmd)
51
57
  Net::HTTP.get build_uri(cmd)
52
58
  return true
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module PumaVersion
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ describe Guard::PumaRunner do
5
5
  let(:runner) { Guard::PumaRunner.new(options) }
6
6
  let(:environment) { 'development' }
7
7
  let(:port) { 4000 }
8
-
8
+
9
9
  let(:default_options) { { :environment => environment, :port => port } }
10
10
  let(:options) { default_options }
11
11
 
@@ -14,7 +14,7 @@ describe Guard::PumaRunner do
14
14
  expect(runner.options).to eq(options)
15
15
  end
16
16
  end
17
-
17
+
18
18
  %w(halt restart).each do |cmd|
19
19
  describe cmd do
20
20
  before do
@@ -27,7 +27,7 @@ describe Guard::PumaRunner do
27
27
  end
28
28
  end
29
29
  end
30
-
30
+
31
31
 
32
32
  describe '#sleep_time' do
33
33
  let(:timeout) { 30 }
@@ -48,6 +48,13 @@ describe Guard::PumaRunner do
48
48
  it "adds path to command" do
49
49
  expect(runner.cmd_opts).to match("--config #{path}")
50
50
  end
51
+
52
+ context "and additional options" do
53
+ let(:options) {{ :config => path, :port => "4000", quiet: false }}
54
+ it "assumes options are set in config" do
55
+ expect(runner.cmd_opts).to eq("--config #{path}")
56
+ end
57
+ end
51
58
  end
52
59
 
53
60
  context "with bind" do
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
  require 'guard/puma'
3
+ require 'guard/compat/test/helper'
3
4
 
4
5
  describe Guard::Puma do
5
6
  let(:guard) { Guard::Puma.new(options) }
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-compat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: puma
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
150
  version: '0'
137
151
  requirements: []
138
152
  rubyforge_project:
139
- rubygems_version: 2.2.2
153
+ rubygems_version: 2.5.1
140
154
  signing_key:
141
155
  specification_version: 4
142
156
  summary: Restart puma when files change