guard-rails 0.4.1 → 0.4.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: 9c12d743c819d791cc2c585024b300e5118392ac
4
- data.tar.gz: ef27742597aa30664599456c25154915f7c920b6
3
+ metadata.gz: 039fb7c31f7c5d4e0bc5ed3622d6c4d9802ede96
4
+ data.tar.gz: 3c7fc89eb25b35983b93e923e819f33873c5cd72
5
5
  SHA512:
6
- metadata.gz: f38748f3b965b477fed3c3c082bb16ed961b5cbc1c80773fdbb83ba458bdf385164bc8ed3af973e71e8862470be25a3384334fabc40b04bd6a71a3afffb88573
7
- data.tar.gz: cf17c0c8b22260272328654d5555864e9c369ce3b3d21fc378cefb8690d105004727e498a776471c1e82674382aa7fae5b62bfa00fb462d4e972b69f0b716bbe
6
+ metadata.gz: cf9d5ba863181cd4ced07068dd46362402b40cc2539bebe693ff1c62d1f7785d139bad0551f9cca3b942171de48f8983b1383385768bd514cffb3730d2d457a2
7
+ data.tar.gz: d8eaf8008dbfcf0237ce3df88a18ffbe6f4f467863ed593ab289b24fd6bc5cefcd99a2bf7f0ede9c36e6a29c2cfadb01ef5d0c78bf6b61480c6d877a30da0662
data/README.md CHANGED
@@ -49,6 +49,12 @@ Now I can automatically restart your Rails development server as your files chan
49
49
 
50
50
  * **Multiple instances** use `pid_file` option to run multiple instances with same rails\_env
51
51
 
52
+ ## Philosophy
53
+
54
+ * **All Platforms** MRI is the main test case. But will be tested under REE and JRuby.
55
+ * **Live in edge** I am tested under Ruby 1.8.7, 1.9.3, 2.0.0 with newest gems. Will be rewrited to fit Ruby 2.0.0 when I am released as version 1.0.0.
56
+ * [Semantic Version](http://semver.org/)
57
+
52
58
  ## Contribute
53
59
 
54
60
  The best choise to contact me is the Issues and Pull Request system on GitHub.
@@ -57,8 +63,15 @@ Currently the official fork repository is at [ranmocy/guard-rails](http://github
57
63
  Please, post your issue or pull request there.
58
64
  And I will be there as your call.
59
65
 
60
- ## Philosophy
61
-
62
- * **All Platforms** MRI is the main test case. But will be tested under REE and JRuby.
63
- * **Live in edge** I am tested under Ruby 1.8.7, 1.9.3, 2.0.0 with newest gems. Will be rewrited to fit Ruby 2.0.0 when I am released as version 1.0.0.
64
- * [Semantic Version](http://semver.org/)
66
+ ## Contributor
67
+
68
+ * John Bintz
69
+ * Wanzhang Sheng(Ranmocy)
70
+ * Grant Hutchins and Jonathan Mukai-Heidt
71
+ * Adam Michel
72
+ * Paul Schyska
73
+ * Michel Pavan Macedo
74
+ * Darrin Holst
75
+ * Nathan Broadbent
76
+ * Tim Preston
77
+ * Sidney Burks
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -41,6 +41,16 @@ module Guard
41
41
  "sh -c 'cd \"#{@root}\" && #{command} &'"
42
42
  end
43
43
 
44
+ def environment
45
+ rails_env = if options[:zeus]
46
+ nil
47
+ else
48
+ options[:environment]
49
+ end
50
+
51
+ { "RAILS_ENV" => rails_env }
52
+ end
53
+
44
54
  def pid_file
45
55
  File.expand_path(options[:pid_file] || File.join(@root, "tmp/pids/#{options[:environment]}.pid"))
46
56
  end
@@ -78,19 +88,15 @@ module Guard
78
88
  options[:zeus_plan] || 'server',
79
89
  ]
80
90
 
81
- # To avoid warning of Zeus
82
- # Since setup RAILS_ENV is useless for Zeus
83
- ENV['RAILS_ENV'] = nil
84
91
  "zeus #{zeus_options.join(' ')} #{build_options}"
85
92
  end
86
93
 
87
94
  def build_rails_command
88
- ENV['RAILS_ENV'] = options[:environment] if options[:environment]
89
95
  "rails server #{build_options}"
90
96
  end
91
97
 
92
98
  def run_rails_command!
93
- system build_command
99
+ system environment, build_command
94
100
  end
95
101
 
96
102
  def has_pid?
@@ -164,6 +164,28 @@ describe Guard::RailsRunner do
164
164
  end
165
165
  end
166
166
 
167
+ describe '#environment' do
168
+ it "defaults RAILS_ENV to development" do
169
+ runner.environment["RAILS_ENV"].should == "development"
170
+ end
171
+
172
+ context "with options[:environment]" do
173
+ let(:options) { default_options.merge(:environment => 'bob') }
174
+
175
+ it "defaults RAILS_ENV to nil" do
176
+ runner.environment["RAILS_ENV"].should == "bob"
177
+ end
178
+
179
+ context "zeus enabled" do
180
+ let(:options) { default_options.merge(:zeus => true) }
181
+
182
+ it "should set RAILS_ENV to nil" do
183
+ runner.environment["RAILS_ENV"].should be_nil
184
+ end
185
+ end
186
+ end
187
+ end
188
+
167
189
  describe '#start' do
168
190
  let(:kill_expectation) { runner.expects(:kill_unmanaged_pid!) }
169
191
  let(:pid_stub) { runner.stubs(:has_pid?) }
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bintz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-05 00:00:00.000000000 Z
12
+ date: 2013-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -118,4 +118,3 @@ test_files:
118
118
  - spec/lib/guard/rails/runner_spec.rb
119
119
  - spec/lib/guard/rails_spec.rb
120
120
  - spec/spec_helper.rb
121
- has_rdoc: