Class: VCPort::Base::VCPkg
- Inherits:
-
Object
- Object
- VCPort::Base::VCPkg
- Defined in:
- lib/vcpkg_pipeline/extension/vcport_vpl.rb
Overview
VCPort::Base::VCPkg
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_path ⇒ Object
Returns the value of attribute content_path.
-
#json ⇒ Object
Returns the value of attribute json.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(path) ⇒ VCPkg
constructor
A new instance of VCPkg.
- #parse_content(content) ⇒ Object
- #to_s ⇒ Object
- #version_update(new_version) ⇒ Object
Constructor Details
#initialize(path) ⇒ VCPkg
Returns a new instance of VCPkg.
36 37 38 39 40 41 42 43 44 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 36 def initialize(path) @path = path @content_path = "#{path}/vcpkg.json" VPL.error("#{@content_path} Not Found") unless File.exist? @content_path @content = File.read(@content_path) parse_content(@content) end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def content @content end |
#content_path ⇒ Object
Returns the value of attribute content_path.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def content_path @content_path end |
#json ⇒ Object
Returns the value of attribute json.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def json @json end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def path @path end |
#version ⇒ Object
Returns the value of attribute version.
34 35 36 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 34 def version @version end |
Instance Method Details
#parse_content(content) ⇒ Object
46 47 48 49 50 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 46 def parse_content(content) @json = JSON.parse(content) @name = @json['name'] @version = @json['version'] end |
#to_s ⇒ Object
58 59 60 |
# File 'lib/vcpkg_pipeline/extension/vcport_vpl.rb', line 58 def to_s "#{json['name']}-#{json['version']}" end |