Class: TerrImporter::Application::Configuration

Inherits:
Hash
  • Object
show all
Defined in:
lib/terrimporter/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#validationsObject

Returns the value of attribute validations.



5
6
7
# File 'lib/terrimporter/configuration.rb', line 5

def validations
  @validations
end

Instance Method Details

#application_urlObject



7
8
9
# File 'lib/terrimporter/configuration.rb', line 7

def application_url
  self['application_url']
end

#css_export_pathObject



11
12
13
# File 'lib/terrimporter/configuration.rb', line 11

def css_export_path
  self['css_export_path']
end

#dynamic_librariesObject



61
62
63
64
# File 'lib/terrimporter/configuration.rb', line 61

def dynamic_libraries
  libraries = self['javascripts']['dynamic_libraries'].robust_split
  libraries.add_missing_extension!('.js')
end

#dynamic_pluginsObject



66
67
68
69
# File 'lib/terrimporter/configuration.rb', line 66

def dynamic_plugins
  libraries = self['javascripts']['dynamic_plugins'].robust_split
  libraries.add_missing_extension!('.js')
end

#export_settingsObject



93
94
95
# File 'lib/terrimporter/configuration.rb', line 93

def export_settings
  self['export_settings']
end

#has_dynamic_javascripts?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/terrimporter/configuration.rb', line 101

def has_dynamic_javascripts?
  !self['javascripts'].nil? and !self['javascripts']['dynamic_libraries'].nil?
end

#has_dynamic_plugins?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/terrimporter/configuration.rb', line 105

def has_dynamic_plugins?
  !self['javascripts'].nil? and !self['javascripts']['dynamic_plugins'].nil?
end

#has_images?Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/terrimporter/configuration.rb', line 109

def has_images?
  !self['images'].nil?
end

#has_modules?Boolean

Returns:

  • (Boolean)


113
114
115
# File 'lib/terrimporter/configuration.rb', line 113

def has_modules?
  !self['modules'].nil?
end

#has_stylesheets?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/terrimporter/configuration.rb', line 97

def has_stylesheets?
  !self['stylesheets'].nil? and !self['stylesheets']['styles'].nil?
end

#imagesObject



41
42
43
# File 'lib/terrimporter/configuration.rb', line 41

def images
  self['images']
end

#images_server_pathObject



49
50
51
# File 'lib/terrimporter/configuration.rb', line 49

def images_server_path
  self['image_server_path']
end

#javascripts_destinationObject



27
28
29
# File 'lib/terrimporter/configuration.rb', line 27

def javascripts_destination
  self['javascripts']['destination_path']
end

#js_export_pathObject



15
16
17
# File 'lib/terrimporter/configuration.rb', line 15

def js_export_path
  self['js_export_path']
end

#libraries_destination_pathObject



77
78
79
80
81
82
83
# File 'lib/terrimporter/configuration.rb', line 77

def libraries_destination_path
  if !self['javascripts']['libraries_destination_path'].nil?
    File.join(self['javascripts']['libraries_destination_path'])
  else
    File.join(self['javascripts']['destination_path'])
  end
end

#libraries_server_pathObject



53
54
55
# File 'lib/terrimporter/configuration.rb', line 53

def libraries_server_path
  self['libraries_server_path']
end

#modulesObject



45
46
47
# File 'lib/terrimporter/configuration.rb', line 45

def modules
  self['modules']
end

#plugins_destination_pathObject



85
86
87
88
89
90
91
# File 'lib/terrimporter/configuration.rb', line 85

def plugins_destination_path
  if !self['javascripts']['plugins_destination_path'].nil?
    File.join(self['javascripts']['plugins_destination_path'])
  else
    File.join(self['javascripts']['destination_path'])
  end
end

#plugins_server_pathObject



57
58
59
# File 'lib/terrimporter/configuration.rb', line 57

def plugins_server_path
  self['plugins_server_path']
end

#replace_style_strings?Boolean

Returns:

  • (Boolean)


71
72
73
74
75
# File 'lib/terrimporter/configuration.rb', line 71

def replace_style_strings?
  !self['stylesheets'].nil? and
      !self['stylesheets']['replace_strings'].nil? and
      !self['stylesheets']['replace_strings'].first.nil?
end

#stylesheet_replace_stringsObject



23
24
25
# File 'lib/terrimporter/configuration.rb', line 23

def stylesheet_replace_strings
  self['stylesheets']['replace_strings']
end

#stylesheetsObject



31
32
33
34
35
36
37
38
39
# File 'lib/terrimporter/configuration.rb', line 31

def stylesheets
  stylesheet_list = ["base.css"]
  if has_stylesheets?
    stylesheet_list = stylesheet_list + self['stylesheets']['styles'].to_s.robust_split
  else
    LOG.debug "No additional stylesheets defined in configuration file."
  end
  stylesheet_list.add_missing_extension!('.css')
end

#stylesheets_destinationObject



19
20
21
# File 'lib/terrimporter/configuration.rb', line 19

def stylesheets_destination
  self['stylesheets']['destination_path']
end