Browse files

Remove unused attribute reader, folding it into existing getter.

  • Loading branch information...
1 parent 6c87cb1 commit 857f5dacaea82815b7c72f7f7ffbeef27a4bb4b4 @kytrinyx kytrinyx committed Aug 17, 2012
Showing with 6 additions and 2 deletions.
  1. +2 −2 lib/daemon_kit/initializer.rb
  2. +4 −0 spec/initializer_spec.rb
View
4 lib/daemon_kit/initializer.rb
@@ -245,7 +245,7 @@ class Configuration
attr_accessor :instance
# Path to the pid file, defaults to 'log/<daemon_name>.pid'
- attr_accessor :pid_file
+ attr_writer :pid_file
# The application name
configurable :daemon_name, :locked => true
@@ -325,7 +325,7 @@ def at_shutdown( proc = nil, &block )
@shutdown_hooks << ( proc || block )
end
- def pid_file( instance )
+ def pid_file( instance = nil )
@pid_file ||= "#{File.dirname(self.log_path)}/#{self.daemon_name}.#{instance}.pid"
end
View
4 spec/initializer_spec.rb
@@ -18,6 +18,10 @@
@configuration.log_level.should_not be_nil
end
+ it "should have a default pid file" do
+ @configuration.pid_file.should_not be_nil
+ end
+
it "should set a default umask" do
File.umask.should_not eq(0)
File.umask.should eq(18)

0 comments on commit 857f5da

Please sign in to comment.