Class: Box
- Inherits:
-
Object
- Object
- Box
- Defined in:
- lib/pandoras_box/box.rb
Direct Known Subclasses
Constant Summary collapse
- @@description =
''
- @@name =
''
- @@download_repo =
''
- @@download_directory =
''
Class Attribute Summary collapse
-
.boxes ⇒ Object
Returns the value of attribute boxes.
-
.default_boxes ⇒ Object
Returns the value of attribute default_boxes.
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#download_directory ⇒ Object
Returns the value of attribute download_directory.
-
#download_repo ⇒ Object
Returns the value of attribute download_repo.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #custom_install_steps ⇒ Object
-
#initialize ⇒ Box
constructor
A new instance of Box.
- #install ⇒ Object
- #pre_steps ⇒ Object
Constructor Details
#initialize ⇒ Box
Returns a new instance of Box.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/pandoras_box/box.rb', line 34 def initialize @download_repo = @@download_repo @name = @@name @description = @@description if @@download_directory.empty? @download_directory = @@download_directory else @download_directory = @name end if @name.include?('default_') @name = @name.gsub!('default_', '') Box.default_boxes << self end Box.boxes << self end |
Class Attribute Details
.boxes ⇒ Object
Returns the value of attribute boxes.
8 9 10 |
# File 'lib/pandoras_box/box.rb', line 8 def boxes @boxes end |
.default_boxes ⇒ Object
Returns the value of attribute default_boxes.
10 11 12 |
# File 'lib/pandoras_box/box.rb', line 10 def default_boxes @default_boxes end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
15 16 17 |
# File 'lib/pandoras_box/box.rb', line 15 def description @description end |
#download_directory ⇒ Object
Returns the value of attribute download_directory.
17 18 19 |
# File 'lib/pandoras_box/box.rb', line 17 def download_directory @download_directory end |
#download_repo ⇒ Object
Returns the value of attribute download_repo.
16 17 18 |
# File 'lib/pandoras_box/box.rb', line 16 def download_repo @download_repo end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/pandoras_box/box.rb', line 14 def name @name end |
Instance Method Details
#custom_install_steps ⇒ Object
31 32 |
# File 'lib/pandoras_box/box.rb', line 31 def custom_install_steps end |
#install ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/pandoras_box/box.rb', line 19 def install pre_steps FileManager.generate_basic_folders FileManager.current_box = @name FileManager.download_box(@download_repo) custom_install_steps FileManager.symlink_all(@name, @download_repo) end |
#pre_steps ⇒ Object
28 29 |
# File 'lib/pandoras_box/box.rb', line 28 def pre_steps end |