SHIMADA Koji
null+****@clear*****
Wed Nov 21 14:11:02 JST 2012
SHIMADA Koji 2012-11-21 14:11:02 +0900 (Wed, 21 Nov 2012) New Revision: 2d52de653abbfc6a0f4c01ca279936086919544a https://github.com/logaling/logaling-command/commit/2d52de653abbfc6a0f4c01ca279936086919544a Merged 6a87d99: Merge pull request #90 from logaling/change-glossarysourcepath-fullpath-to-relativepath Log: Add #source_directory_path to Project, ImportedProject, and PersonalProject Modified files: lib/logaling/glossary.rb lib/logaling/project.rb Modified: lib/logaling/glossary.rb (+1 -1) =================================================================== --- lib/logaling/glossary.rb 2012-11-21 13:56:08 +0900 (bf9115d) +++ lib/logaling/glossary.rb 2012-11-21 14:11:02 +0900 (3097e76) @@ -84,7 +84,7 @@ module Logaling @glossary_source else file_name = [@name, @source_language, @target_language, 'yml'].join('.') - source_dir =****@proje*****_project? ? @project.glossary_source_path : File.dirname(@project.glossary_source_path) + source_dir =****@proje*****_directory_path FileUtils.mkdir_p(source_dir) source_path_full = File.join(source_dir, file_name) source_path =****@proje*****_relative_path(source_path_full) Modified: lib/logaling/project.rb (+9 -0) =================================================================== --- lib/logaling/project.rb 2012-11-21 13:56:08 +0900 (f0ccea8) +++ lib/logaling/project.rb 2012-11-21 14:11:02 +0900 (80cbb79) @@ -61,6 +61,7 @@ module Logaling basepath =****@repos*****_path(@path) File.join(basepath, "glossary") end + alias_method :source_directory_path, :glossary_source_path def glossary_db_path @repository.logaling_db_home @@ -134,6 +135,10 @@ module Logaling false end + def source_directory_path + File.dirname(glossary_source_path) + end + private def all_glossary_source_path Dir.glob(File.join(File.dirname(glossary_source_path), "*")) @@ -185,6 +190,10 @@ module Logaling false end + def source_directory_path + File.dirname(glossary_source_path) + end + private def all_glossary_source_path Dir.glob(File.join(File.dirname(glossary_source_path), "*")) -------------- next part -------------- An HTML attachment was scrubbed... Download