Class: ComposerProject

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Serializers::JSON, ActiveModel::Validations
Defined in:
lib/yadecli/model/composer_project.rb

Overview

Project

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gitUrlObject

Returns the value of attribute gitUrl.



12
13
14
# File 'lib/yadecli/model/composer_project.rb', line 12

def gitUrl
  @gitUrl
end

#idObject

Returns the value of attribute id.



12
13
14
# File 'lib/yadecli/model/composer_project.rb', line 12

def id
  @id
end

#nameObject

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

#attributesObject



16
17
18
# File 'lib/yadecli/model/composer_project.rb', line 16

def attributes
  instance_values
end

#git_repo_nameObject



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_dirObject



20
21
22
# File 'lib/yadecli/model/composer_project.rb', line 20

def install_dir
  "#{AppConfig[:composer_home]}/#{name}"
end

#installed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/yadecli/model/composer_project.rb', line 24

def installed?
  File.directory?("#{AppConfig[:composer_home]}/#{name}")
end

#uninstallObject



28
29
30
# File 'lib/yadecli/model/composer_project.rb', line 28

def uninstall
  FileUtils.rm_rf("#{AppConfig[:composer_home]}/#{name}")
end