Class: ComposerProject
- Inherits:
-
Object
- Object
- ComposerProject
- Includes:
- ActiveModel::Model, ActiveModel::Serializers::JSON, ActiveModel::Validations
- Defined in:
- lib/yadecli/model/composer_project.rb
Overview
Project
Instance Attribute Summary collapse
-
#gitUrl ⇒ Object
Returns the value of attribute gitUrl.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #attributes ⇒ Object
- #git_repo_name ⇒ Object
- #install_dir ⇒ Object
- #installed? ⇒ Boolean
- #uninstall ⇒ Object
Instance Attribute Details
#gitUrl ⇒ Object
Returns the value of attribute gitUrl.
12 13 14 |
# File 'lib/yadecli/model/composer_project.rb', line 12 def gitUrl @gitUrl end |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/yadecli/model/composer_project.rb', line 12 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/yadecli/model/composer_project.rb', line 12 def name @name end |
Instance Method Details
#attributes ⇒ Object
16 17 18 |
# File 'lib/yadecli/model/composer_project.rb', line 16 def attributes instance_values end |
#git_repo_name ⇒ Object
32 33 34 35 36 |
# File 'lib/yadecli/model/composer_project.rb', line 32 def git_repo_name uri = URI(gitUrl) uri.path.split('/').last.split('.').first end |
#install_dir ⇒ Object
20 21 22 |
# File 'lib/yadecli/model/composer_project.rb', line 20 def install_dir "#{AppConfig[:composer_home]}/#{name}" end |
#installed? ⇒ Boolean
24 25 26 |
# File 'lib/yadecli/model/composer_project.rb', line 24 def installed? File.directory?("#{AppConfig[:composer_home]}/#{name}") end |
#uninstall ⇒ Object
28 29 30 |
# File 'lib/yadecli/model/composer_project.rb', line 28 def uninstall FileUtils.rm_rf("#{AppConfig[:composer_home]}/#{name}") end |