Class: LTX::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ltx/config.rb

Overview

Load config from project.yaml

Defined Under Namespace

Classes: Error

Constant Summary collapse

MISSING_MAIN_ERROR =
'Please supply path to main tex file!'
DEFAULT_PROJECT_YAML =
'project.yml'
DEFAULT_MAIN_TEX =
'main.tex'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



20
21
22
23
# File 'lib/ltx/config.rb', line 20

def initialize
  @config = load_config
  fetch_settings
end

Instance Attribute Details

#compile_dirObject (readonly)

Returns the value of attribute compile_dir.



10
11
12
# File 'lib/ltx/config.rb', line 10

def compile_dir
  @compile_dir
end

#compilerObject (readonly)

Returns the value of attribute compiler.



9
10
11
# File 'lib/ltx/config.rb', line 9

def compiler
  @compiler
end

#mainObject (readonly)

Returns the value of attribute main.



8
9
10
# File 'lib/ltx/config.rb', line 8

def main
  @main
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



11
12
13
# File 'lib/ltx/config.rb', line 11

def timeout
  @timeout
end

#titleObject (readonly)

Returns the value of attribute title.



12
13
14
# File 'lib/ltx/config.rb', line 12

def title
  @title
end

#versionObject (readonly)

Returns the value of attribute version.



13
14
15
# File 'lib/ltx/config.rb', line 13

def version
  @version
end

#version_prefixObject (readonly)

Returns the value of attribute version_prefix.



14
15
16
# File 'lib/ltx/config.rb', line 14

def version_prefix
  @version_prefix
end

Instance Method Details

#rootObject



25
26
27
# File 'lib/ltx/config.rb', line 25

def root
  File.dirname(@main)
end