Class: EasyHtmlGenerator::ProjectPathResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_html_generator/project_path_resolver.rb

Overview

this class represents a project and handles generators and ressources

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ ProjectPathResolver

Returns a new instance of ProjectPathResolver.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/easy_html_generator/project_path_resolver.rb', line 5

def initialize(project)
  @project = project
  @path_prefix_replace_map = {
    'src'            => project.src_path,
    'dist'           => project.dist_path,
    'src.scripts'    => project.src_path_to(:scripts),
    'src.styles'     => project.src_path_to(:styles),
    'src.images'     => project.src_path_to(:images),
    'src.public'     => project.src_path_to(:public),
    'src.views'      => project.src_path_to(:views),
    'dist.scripts'   => project.dist_path_to(:scripts),
    'dist.styles'    => project.dist_path_to(:styles),
    'dist.images'    => project.dist_path_to(:images),
    'dist.public'    => project.dist_path_to(:public),
    'dist.views'     => project.dist_path_to(:views),
    'workspace.root' => EasyHtmlGenerator::WORKSPACE_PATH,
    'ehg.root'       => EasyHtmlGenerator::EHG_SRC_PATH
  }
end

Instance Method Details

#resolve_config(config) ⇒ Object



25
26
27
# File 'lib/easy_html_generator/project_path_resolver.rb', line 25

def resolve_config(config)
  resolve_hash(config)
end