Class: Yade::Composer::Rest::Model::ComposerProject
- Inherits:
-
Object
- Object
- Yade::Composer::Rest::Model::ComposerProject
- Includes:
- ActiveModel::Model, ActiveModel::Serializers::JSON, ActiveModel::Validations, Yade::Common::Config
- Defined in:
- lib/yade/composer/rest/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.
18 19 20 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 18 def gitUrl @gitUrl end |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 18 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 18 def name @name end |
Instance Method Details
#attributes ⇒ Object
22 23 24 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 22 def attributes instance_values end |
#git_repo_name ⇒ Object
38 39 40 41 42 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 38 def git_repo_name uri = URI(gitUrl) uri.path.split('/').last.split('.').first end |
#install_dir ⇒ Object
26 27 28 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 26 def install_dir "#{ComposerConfig[:composer_home]}/#{name}" end |
#installed? ⇒ Boolean
30 31 32 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 30 def installed? File.directory?("#{ComposerConfig[:composer_home]}/#{name}") end |
#uninstall ⇒ Object
34 35 36 |
# File 'lib/yade/composer/rest/model/composer_project.rb', line 34 def uninstall FileUtils.rm_rf("#{ComposerConfig[:composer_home]}/#{name}") end |