Skip to content
This repository
Browse code

Remove unused attribute reader, folding it into existing getter.

  • Loading branch information...
commit 857f5dacaea82815b7c72f7f7ffbeef27a4bb4b4 1 parent 6c87cb1
Katrina Owen authored August 17, 2012
4  lib/daemon_kit/initializer.rb
@@ -245,7 +245,7 @@ class Configuration
245 245
     attr_accessor :instance
246 246
 
247 247
     # Path to the pid file, defaults to 'log/<daemon_name>.pid'
248  
-    attr_accessor :pid_file
  248
+    attr_writer :pid_file
249 249
 
250 250
     # The application name
251 251
     configurable :daemon_name, :locked => true
@@ -325,7 +325,7 @@ def at_shutdown( proc = nil, &block )
325 325
       @shutdown_hooks << ( proc || block )
326 326
     end
327 327
 
328  
-    def pid_file( instance )
  328
+    def pid_file( instance = nil )
329 329
       @pid_file ||= "#{File.dirname(self.log_path)}/#{self.daemon_name}.#{instance}.pid"
330 330
     end
331 331
 
4  spec/initializer_spec.rb
@@ -18,6 +18,10 @@
18 18
     @configuration.log_level.should_not be_nil
19 19
   end
20 20
 
  21
+  it "should have a default pid file" do
  22
+    @configuration.pid_file.should_not be_nil
  23
+  end
  24
+
21 25
   it "should set a default umask" do
22 26
     File.umask.should_not eq(0)
23 27
     File.umask.should eq(18)

0 notes on commit 857f5da

Please sign in to comment.
Something went wrong with that request. Please try again.