null+****@clear*****
null+****@clear*****
Mon Jun 25 14:34:26 JST 2012
SHIMADA Koji 2012-06-25 14:34:26 +0900 (Mon, 25 Jun 2012) New Revision: 85723d4197b3aa7352992c7bba2569b325866839 https://github.com/logaling/logaling-command/commit/85723d4197b3aa7352992c7bba2569b325866839 Merged 7228757: Merge pull request #60 from logaling/refactor-structure Log: Style Modified files: lib/logaling/project.rb Modified: lib/logaling/project.rb (+12 -14) =================================================================== --- lib/logaling/project.rb 2012-06-25 11:50:49 +0900 (4356a6a) +++ lib/logaling/project.rb 2012-06-25 14:34:26 +0900 (94c54c4) @@ -15,21 +15,19 @@ module Logaling class Project - 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 + 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) else - unless Pathname.new(dir).root? - searched_path << dir - dir = File.dirname(dir) - else - raise Logaling::ProjectNotFound, "Can't found .logaling in #{searched_path}" - end + raise Logaling::ProjectNotFound, "Can't found .logaling in #{searched_path}" end end end -------------- next part -------------- An HTML attachment was scrubbed... 下載