null+****@clear*****
null+****@clear*****
Tue Jun 26 11:44:38 JST 2012
SUZUKI Miho 2012-06-26 11:44:38 +0900 (Tue, 26 Jun 2012) New Revision: 18077b4b677b7781f64b9e77ebd9d142730f4003 https://github.com/logaling/logaling-command/commit/18077b4b677b7781f64b9e77ebd9d142730f4003 Log: Style Modified files: lib/logaling/project.rb Modified: lib/logaling/project.rb (+14 -12) =================================================================== --- lib/logaling/project.rb 2012-06-25 14:38:15 +0900 (94c54c4) +++ lib/logaling/project.rb 2012-06-26 11:44:38 +0900 (4356a6a) @@ -15,19 +15,21 @@ module Logaling class Project - def self.find_dotfile(base_dir=Dir.pwd) - searched_path = [] - dir = base_dir - loop do - path = File.join(dir, '.logaling') - if File.exist?(path) - return path - else - unless Pathname.new(dir).root? - searched_path << dir - dir = File.dirname(dir) + class << self + def find_dotfile(base_dir=Dir.pwd) + searched_path = [] + dir = base_dir + loop do + path = File.join(dir, '.logaling') + if File.exist?(path) + return path else - raise Logaling::ProjectNotFound, "Can't found .logaling in #{searched_path}" + unless Pathname.new(dir).root? + searched_path << dir + dir = File.dirname(dir) + else + raise Logaling::ProjectNotFound, "Can't found .logaling in #{searched_path}" + end end end end -------------- next part -------------- An HTML attachment was scrubbed... 다운로드