Class: AsciiBinderGabrielRH::DistroBranch

Inherits:
Object
  • Object
show all
Defined in:
lib/ascii_binder_gabriel_rh/distro_branch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(branch_name, branch_config, distro) ⇒ DistroBranch

Returns a new instance of DistroBranch.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 9

def initialize(branch_name,branch_config,distro)
  @id            = branch_name
  @name          = branch_config['name']
  @dir           = branch_config['dir']
  @distro        = distro
  @distro_name   = distro.name
  @distro_author = distro.author
  if branch_config.has_key?('distro-overrides')
    if branch_config['distro-overrides'].has_key?('name')
      @distro_name = branch_config['distro-overrides']['name']
    end
    if branch_config['distro-overrides'].has_key?('author')
      @distro_author = branch_config['distro-overrides']['author']
    end
  end
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def dir
  @dir
end

#distroObject (readonly)

Returns the value of attribute distro.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def distro
  @distro
end

#distro_authorObject (readonly)

Returns the value of attribute distro_author.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def distro_author
  @distro_author
end

#distro_nameObject (readonly)

Returns the value of attribute distro_name.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def distro_name
  @distro_name
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 7

def name
  @name
end

Instance Method Details

#branch_image_dirObject



42
43
44
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 42

def branch_image_dir
  @branch_image_dir ||= File.join(branch_path,IMAGE_DIRNAME)
end

#branch_javascript_dirObject



38
39
40
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 38

def branch_javascript_dir
  @branch_javascript_dir ||= File.join(branch_path,JAVASCRIPT_DIRNAME)
end

#branch_pathObject



26
27
28
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 26

def branch_path
  @branch_path ||= File.join(preview_dir,@distro.id,@dir)
end

#branch_stylesheet_dirObject



34
35
36
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 34

def branch_stylesheet_dir
  @branch_stylesheet_dir ||= File.join(branch_path,STYLESHEET_DIRNAME)
end

#branch_url_baseObject



30
31
32
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 30

def branch_url_base
  @branch_url_base ||= File.join('/',@dir)
end

#errorsObject



50
51
52
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 50

def errors
  validate(true)
end

#is_valid?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 46

def is_valid?
  validate
end