guard-rails 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,9 +5,7 @@ require 'rspec/core/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
 
7
7
  require 'rake/version_task'
8
- Rake::VersionTask.new do |task|
9
- task.with_git_tag = true
10
- end
8
+ Rake::VersionTask.new
11
9
 
12
10
  include Rake::DSL if defined?(Rake::DSL)
13
11
  RVM_PREFIX = "rvm 1.8.7@guard-rails,1.9.3-p327@guard-rails,2.0.0@guard-rails do"
@@ -16,9 +14,8 @@ RVM_PREFIX = "rvm 1.8.7@guard-rails,1.9.3-p327@guard-rails,2.0.0@guard-rails do"
16
14
  namespace :spec do
17
15
  desc "Run on three Rubies"
18
16
  task :platforms do
19
- system %{#{RVM_PREFIX} bundle}
20
- system %{#{RVM_PREFIX} bundle exec rake spec}
21
- exit $?.exitstatus if $?.exitstatus != 0
17
+ exit $?.exitstatus unless system "#{RVM_PREFIX} bundle install"
18
+ exit $?.exitstatus unless system "#{RVM_PREFIX} bundle exec rake spec"
22
19
  end
23
20
  end
24
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -34,15 +34,15 @@ module Guard
34
34
  end
35
35
 
36
36
  def build_rails_command
37
- return %{sh -c 'cd #{Dir.pwd} && #{options[:CLI]} --pid #{pid_file} &'} if options[:CLI]
37
+ return %{#{options[:CLI]} --pid #{pid_file}} if options[:CLI]
38
38
 
39
39
  rails_options = [
40
- options[:daemon] && '-d',
41
- options[:debugger] && '-u',
40
+ options[:daemon] ? '-d' : nil,
41
+ options[:debugger] ? '-u' : nil,
42
42
  '-e', options[:environment],
43
43
  '--pid', pid_file,
44
44
  '-p', options[:port],
45
- options[:server] || '',
45
+ options[:server],
46
46
  ]
47
47
 
48
48
  zeus_options = [
@@ -52,7 +52,7 @@ module Guard
52
52
  # omit env when use zeus
53
53
  rails_runner = options[:zeus] ? "zeus #{zeus_options.join(' ')}" : "RAILS_ENV=#{options[:environment]} rails server"
54
54
 
55
- %{sh -c 'cd #{Dir.pwd} && #{rails_runner} #{rails_options.join(' ')} &'}
55
+ %{#{rails_runner} #{rails_options.join(' ')}}
56
56
  end
57
57
 
58
58
  def pid_file
@@ -69,7 +69,7 @@ module Guard
69
69
 
70
70
  private
71
71
  def run_rails_command!
72
- system build_rails_command
72
+ system "sh -c '#{build_rails_command}'"
73
73
  end
74
74
 
75
75
  def has_pid?
@@ -38,14 +38,14 @@ describe Guard::RailsRunner do
38
38
  let(:custom_cli) { 'custom_CLI_command' }
39
39
  let(:options) { default_options.merge(:CLI => custom_cli) }
40
40
  it "should have only custom CLI" do
41
- runner.build_rails_command.should match(%r{&& #{custom_cli} --pid })
41
+ runner.build_rails_command.should match(%r{#{custom_cli} --pid })
42
42
  end
43
43
 
44
44
  let(:custom_pid_file) { "tmp/pids/rails_dev.pid" }
45
45
  let(:options) { default_options.merge(:CLI => custom_cli, :pid_file => custom_pid_file) }
46
46
  it "should use custom pid_file" do
47
47
  pid_file_path = File.expand_path custom_pid_file
48
- runner.build_rails_command.should match(%r{&& #{custom_cli} --pid #{pid_file_path}})
48
+ runner.build_rails_command.should match(%r{#{custom_cli} --pid #{pid_file_path}})
49
49
  end
50
50
  end
51
51
 
@@ -111,20 +111,27 @@ describe Guard::RailsRunner do
111
111
  context "zeus enabled" do
112
112
  let(:options) { default_options.merge(:zeus => true) }
113
113
  it "should have zeus in command" do
114
- runner.build_rails_command.should match(%r{ zeus server })
114
+ runner.build_rails_command.should match(%r{zeus server })
115
115
  end
116
116
 
117
117
  context "custom zeus plan" do
118
118
  let(:options) { default_options.merge(:zeus => true, :zeus_plan => 'test_server') }
119
119
  it "should use custom zeus plan" do
120
- runner.build_rails_command.should match(%r{ zeus test_server})
120
+ runner.build_rails_command.should match(%r{zeus test_server})
121
+ end
122
+
123
+ context "custom server" do
124
+ let(:options) { default_options.merge(:zeus => true, :zeus_plan => 'test_server', :server => 'thin') }
125
+ it "should use custom server" do
126
+ runner.build_rails_command.should match(%r{zeus test_server .* thin})
127
+ end
121
128
  end
122
129
  end
123
130
  end
124
131
 
125
132
  context "zeus disabled" do
126
133
  it "should not have zeus in command" do
127
- runner.build_rails_command.should_not match(%r{ zeus server })
134
+ runner.build_rails_command.should_not match(%r{zeus server })
128
135
  end
129
136
 
130
137
  let(:options) { default_options.merge(:zeus_plan => 'test_server') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  segments:
115
115
  - 0
116
- hash: 2850314987821883862
116
+ hash: -2667544480743711932
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  segments:
124
124
  - 0
125
- hash: 2850314987821883862
125
+ hash: -2667544480743711932
126
126
  requirements: []
127
127
  rubyforge_project: guard-rails
128
128
  rubygems_version: 1.8.23