Module: DrawUml::Configure

Defined in:
lib/draw_uml/configure.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.diagram_extensionObject

Returns the value of attribute diagram_extension.



4
5
6
# File 'lib/draw_uml/configure.rb', line 4

def diagram_extension
  @diagram_extension
end

.diagram_pathObject

Returns the value of attribute diagram_path.



4
5
6
# File 'lib/draw_uml/configure.rb', line 4

def diagram_path
  @diagram_path
end

.image_pathObject

Returns the value of attribute image_path.



4
5
6
# File 'lib/draw_uml/configure.rb', line 4

def image_path
  @image_path
end

.static_pathObject

Returns the value of attribute static_path.



4
5
6
# File 'lib/draw_uml/configure.rb', line 4

def static_path
  @static_path
end

Class Method Details

.application_layoutObject



30
31
32
# File 'lib/draw_uml/configure.rb', line 30

def application_layout
  @application_layout ||= File.expand_path('application.html.erb', File.join(self.templates_path, 'layouts'))
end

.application_templateObject



34
35
36
# File 'lib/draw_uml/configure.rb', line 34

def application_template
  File.read(self.application_layout)
end

.dest_pathObject



22
23
24
# File 'lib/draw_uml/configure.rb', line 22

def dest_path
  @dest_path ||= File.expand_path(File.join(self.static_path, self.image_path))
end

.keysObject



14
15
16
# File 'lib/draw_uml/configure.rb', line 14

def keys
  @keys ||= %i[diagram_extension diagram_path static_path image_path]
end

.setupObject



6
7
8
9
10
11
12
# File 'lib/draw_uml/configure.rb', line 6

def setup
  keys.each do |key|
    instance_variable_set(:"@#{key}", DrawUml::Default.send(key))
  end

  FileUtils.mkdir_p(self.source_path)
end

.source_pathObject



18
19
20
# File 'lib/draw_uml/configure.rb', line 18

def source_path
  @source_path ||= File.expand_path(self.diagram_path)
end

.templates_pathObject



26
27
28
# File 'lib/draw_uml/configure.rb', line 26

def templates_path
  @templates_path ||= DrawUml.root.join('lib', 'templates').to_s
end