Class: AsciiBinderGabrielRH::DistroBranch
- Inherits:
-
Object
- Object
- AsciiBinderGabrielRH::DistroBranch
- Defined in:
- lib/ascii_binder_gabriel_rh/distro_branch.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#distro ⇒ Object
readonly
Returns the value of attribute distro.
-
#distro_author ⇒ Object
readonly
Returns the value of attribute distro_author.
-
#distro_name ⇒ Object
readonly
Returns the value of attribute distro_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #branch_image_dir ⇒ Object
- #branch_javascript_dir ⇒ Object
- #branch_path ⇒ Object
- #branch_stylesheet_dir ⇒ Object
- #branch_url_base ⇒ Object
- #errors ⇒ Object
-
#initialize(branch_name, branch_config, distro) ⇒ DistroBranch
constructor
A new instance of DistroBranch.
- #is_valid? ⇒ Boolean
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. 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
#dir ⇒ Object (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 |
#distro ⇒ Object (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_author ⇒ Object (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 end |
#distro_name ⇒ Object (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 |
#id ⇒ Object (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 |
#name ⇒ Object (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_dir ⇒ Object
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_dir ⇒ Object
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_path ⇒ Object
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_dir ⇒ Object
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_base ⇒ Object
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 |
#errors ⇒ Object
50 51 52 |
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 50 def errors validate(true) end |
#is_valid? ⇒ Boolean
46 47 48 |
# File 'lib/ascii_binder_gabriel_rh/distro_branch.rb', line 46 def is_valid? validate end |