SHIMADA Koji
null+****@clear*****
Wed Nov 21 15:41:32 JST 2012
SHIMADA Koji 2012-11-21 15:41:32 +0900 (Wed, 21 Nov 2012) New Revision: bb3d1ca3c6d6d33e9e13a394957e6d1a999a668d https://github.com/logaling/logaling-command/commit/bb3d1ca3c6d6d33e9e13a394957e6d1a999a668d Log: Rename instance variable @logaling_home to @path Modified files: lib/logaling/repository.rb Modified: lib/logaling/repository.rb (+12 -9) =================================================================== --- lib/logaling/repository.rb 2012-11-21 15:34:35 +0900 (4965676) +++ lib/logaling/repository.rb 2012-11-21 15:41:32 +0900 (bb0ccdf) @@ -21,9 +21,8 @@ require "logaling/project" module Logaling class Repository - attr_reader :logaling_home def initialize(path) - @logaling_home = path + @path = path end def register(dot_logaling_path, register_name) @@ -160,36 +159,40 @@ module Logaling end def config_path - path = File.join(@logaling_home, "config") + path = File.join(logaling_home, "config") File.exist?(path) ? path : nil end def logaling_db_home - File.join(@logaling_home, "db") + File.join(logaling_home, "db") end def expand_path(relative_path) - File.expand_path(File.join(@logaling_home, relative_path)) + File.expand_path(File.join(logaling_home, relative_path)) end def relative_path(full_path) require 'pathname' path = Pathname.new(full_path) - base = Pathname.new(@logaling_home) + base = Pathname.new(logaling_home) path.relative_path_from(base).to_s end private + def logaling_home + @path + end + def logaling_projects_path - File.join(@logaling_home, "projects") + File.join(logaling_home, "projects") end def personal_glossary_root_path - File.join(@logaling_home, "personal") + File.join(logaling_home, "personal") end def cache_path - File.join(@logaling_home, "cache") + File.join(logaling_home, "cache") end def registered_project_paths -------------- next part -------------- An HTML attachment was scrubbed... Download