Class: Logaling::FileBasedProject
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
Instance Method Details
#absolute_path ⇒ Object
Also known as:
glossary_source_path
140
141
142
|
# File 'lib/logaling/project.rb', line 140
def absolute_path
@repository.expand_path(@path)
end
|
#bilingualr_pair ⇒ Object
126
127
128
|
# File 'lib/logaling/project.rb', line 126
def bilingualr_pair
File.basename(@path).split(/\./)[1, 2]
end
|
#glossary_sources ⇒ Object
130
131
132
133
|
# File 'lib/logaling/project.rb', line 130
def glossary_sources
source_language, target_language = bilingualr_pair
[GlossarySource.create(@path, glossary(source_language, target_language))]
end
|
#has_glossary?(source_language, target_language) ⇒ Boolean
135
136
137
138
|
# File 'lib/logaling/project.rb', line 135
def has_glossary?(source_language, target_language)
glossary_source_language, glossary_target_language = bilingualr_pair
glossary_source_language == source_language && glossary_target_language == target_language
end
|
#name ⇒ Object
122
123
124
|
# File 'lib/logaling/project.rb', line 122
def name
File.basename(@path).split(/\./).first
end
|
#normal_project? ⇒ Boolean
145
146
147
|
# File 'lib/logaling/project.rb', line 145
def normal_project?
false
end
|
#source_directory_path ⇒ Object
149
150
151
|
# File 'lib/logaling/project.rb', line 149
def source_directory_path
File.dirname(glossary_source_path)
end
|