Class: Logaling::FileBasedProject

Inherits:
Project
  • Object
show all
Defined in:
lib/logaling/project.rb

Direct Known Subclasses

ImportedProject, PersonalProject

Instance Attribute Summary

Attributes inherited from Project

#path, #repository

Instance Method Summary collapse

Methods inherited from Project

find_dotfile, find_path, #glossaries, #glossary, #glossary_db_path, #imported?, #initialize, #personal?, #relative_path, #same?, #type

Constructor Details

This class inherits a constructor from Logaling::Project

Instance Method Details

#absolute_pathObject Also known as: glossary_source_path



136
137
138
# File 'lib/logaling/project.rb', line 136

def absolute_path
  @repository.expand_path(@path)
end

#glossary_sourcesObject



126
127
128
129
# File 'lib/logaling/project.rb', line 126

def glossary_sources
  name, source_language, target_language, type = File.basename(@path).split(/\./)
  [GlossarySource.create(@path, glossary(source_language, target_language))]
end

#has_glossary?(source_language, target_language) ⇒ Boolean

Returns:

  • (Boolean)


131
132
133
134
# File 'lib/logaling/project.rb', line 131

def has_glossary?(source_language, target_language)
  glossary_source_language, glossary_target_language = File.basename(@path).split(/\./)[1..2]
  glossary_source_language == source_language && glossary_target_language == target_language
end

#nameObject



122
123
124
# File 'lib/logaling/project.rb', line 122

def name
  File.basename(@path).split(/\./).first
end

#normal_project?Boolean

Returns:

  • (Boolean)


141
142
143
# File 'lib/logaling/project.rb', line 141

def normal_project?
  false
end

#source_directory_pathObject



145
146
147
# File 'lib/logaling/project.rb', line 145

def source_directory_path
  File.dirname(glossary_source_path)
end