Class: Organize::Project
- Inherits:
-
Object
- Object
- Organize::Project
- Defined in:
- lib/organize/project.rb
Constant Summary collapse
- PREFIX =
File.('~/Projects')
- SHARED_PREFIX =
File.('~/Dropbox')
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #archive_path ⇒ Object
- #create ⇒ Object
-
#initialize(name) ⇒ Project
constructor
A new instance of Project.
- #path ⇒ Object
- #project_archive_path ⇒ Object
- #shared_link_path ⇒ Object
- #shared_path ⇒ Object
Constructor Details
#initialize(name) ⇒ Project
Returns a new instance of Project.
8 9 10 |
# File 'lib/organize/project.rb', line 8 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/organize/project.rb', line 4 def name @name end |
Instance Method Details
#archive_path ⇒ Object
16 17 18 |
# File 'lib/organize/project.rb', line 16 def archive_path File.join(path, 'Archive') end |
#create ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/organize/project.rb', line 32 def create FileUtils.mkdir_p(path) FileUtils.mkdir_p(shared_path) FileUtils.mkdir_p(archive_path) FileUtils.mkdir_p(project_archive_path) FileUtils.ln_s(shared_path, shared_link_path) unless File.exists?(shared_link_path) end |
#path ⇒ Object
12 13 14 |
# File 'lib/organize/project.rb', line 12 def path File.join(PREFIX, name) end |
#project_archive_path ⇒ Object
28 29 30 |
# File 'lib/organize/project.rb', line 28 def project_archive_path File.join(PREFIX, 'Archive') end |
#shared_link_path ⇒ Object
24 25 26 |
# File 'lib/organize/project.rb', line 24 def shared_link_path File.join(path, 'Shared') end |
#shared_path ⇒ Object
20 21 22 |
# File 'lib/organize/project.rb', line 20 def shared_path File.join(SHARED_PREFIX, name) end |