Class: QB::Package

Inherits:
Util::Resource show all
Defined in:
lib/qb/package.rb,
lib/qb/package/version.rb

Overview

Common properties and methods of package resources, aimed at packages represented as directories in projects.

Direct Known Subclasses

Gem

Defined Under Namespace

Classes: Gem, Version

Instance Attribute Summary collapse

Instance Attribute Details

#nameString (readonly)

The string name the package goes by.

Returns:

  • (String)

    Non-empty string.



92
# File 'lib/qb/package.rb', line 92

prop  :name, type: t.non_empty_str

#ref_pathString | Pathname? (readonly)

User-provided path value used to construct the resource instance, if any.

This may not be the same as a root path for the resource, such as with resource classes that can be constructed from any path inside the directory, like a Repo::Git.

Returns:

  • (String | Pathname)

    If the resource instance was constructed based on a path argument.

  • (nil)

    If the resource instance was not constructed based on a path argument.



67
# File 'lib/qb/package.rb', line 67

prop  :ref_path, type: t.maybe( t.dir_path )

#root_pathPathname (readonly)

Absolute path to the gem's root directory.

Returns:

  • (Pathname)


75
# File 'lib/qb/package.rb', line 75

prop  :root_path, type: t.dir_path

#versionQB::Package::Version (readonly)

Version of the package.



83
# File 'lib/qb/package.rb', line 83

prop  :version, type: QB::Package::Version