Class: Composer::Package::CompletePackage

Inherits:
Package show all
Defined in:
lib/composer/package/complete_package.rb

Overview

Package containing additional metadata that is not used by the solver

Direct Known Subclasses

RootAliasPackage, RootPackage

Constant Summary

Constants inherited from BasePackage

BasePackage::STABILITY_ALPHA, BasePackage::STABILITY_BETA, BasePackage::STABILITY_DEV, BasePackage::STABILITY_RC, BasePackage::STABILITY_STABLE, BasePackage::SUPPORTED_LINK_TYPES

Instance Attribute Summary collapse

Attributes inherited from Package

#archive_excludes, #autoload, #binaries, #conflicts, #dev_autoload, #dev_requires, #dist_mirrors, #dist_reference, #dist_sha1_checksum, #dist_type, #dist_url, #extra, #include_paths, #installation_source, #notification_url, #provides, #release_date, #replaces, #requires, #source_mirrors, #source_reference, #source_type, #source_url, #stability, #suggests

Attributes inherited from BasePackage

#id, #name, #pretty_name, #pretty_version, #repository, #stability, #transport_options, #version

Instance Method Summary collapse

Methods inherited from Package

#attributes, #is_dev, #pretty_string, #replace_version, #target_dir, #target_dir=, #type, #type=, #unique_name

Methods inherited from BasePackage

#attributes, #pretty_string, stabilities, #to_s, #type, #type=, #unique_name

Constructor Details

#initialize(name, version, pretty_version) ⇒ CompletePackage

Creates a new in memory package. Param: string name The package’s name Param: string version The package’s version Param: string prettyVersion The package’s non-normalized version



25
26
27
28
29
30
31
32
# File 'lib/composer/package/complete_package.rb', line 25

def initialize(name, version, pretty_version)
  super(name, version, pretty_version)

  @license = []
  @scripts = []
  @support = []
  @abandoned = false
end

Instance Attribute Details

#authorsObject

Returns the value of attribute authors.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def authors
  @authors
end

#descriptionObject

Returns the value of attribute description.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def description
  @description
end

#homepageObject

Returns the value of attribute homepage.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def homepage
  @homepage
end

#keywordsObject

Returns the value of attribute keywords.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def keywords
  @keywords
end

#licenseObject

Returns the value of attribute license.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def license
  @license
end

#repositoriesObject

Returns the value of attribute repositories.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def repositories
  @repositories
end

#scriptsObject

Returns the value of attribute scripts.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def scripts
  @scripts
end

#supportObject

Returns the value of attribute support.



18
19
20
# File 'lib/composer/package/complete_package.rb', line 18

def support
  @support
end

Instance Method Details

#abandoned=(abandoned) ⇒ Object

Set abandoned Param boolean|string $abandoned



42
43
44
# File 'lib/composer/package/complete_package.rb', line 42

def abandoned=(abandoned)
  @abandoned = abandoned
end

#is_abandoned?Boolean

Determine if package is abandoned Return: true if package is abandoned; Otherwise false.

Returns:

  • (Boolean)


36
37
38
# File 'lib/composer/package/complete_package.rb', line 36

def is_abandoned?
  @abandoned
end

#replacement_packageObject

If the package is abandoned and has a suggested replacement, this method returns it

Returns:

  • string|nil



49
50
51
# File 'lib/composer/package/complete_package.rb', line 49

def replacement_package
  return @abandoned.kind_of?(String) ? @abandoned : nil
end