Class: QB::Repo
- Inherits:
-
Util::Resource
- Object
- Util::Resource
- QB::Repo
- Defined in:
- lib/qb/repo.rb,
lib/qb/repo/git.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Git
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The string name of the repo.
-
#ref_path ⇒ String | Pathname?
readonly
User-provided path value used to construct the resource instance, if any.
-
#root_path ⇒ Pathname
readonly
Absolute path to the gem's root directory.
Class Method Summary collapse
-
.from_path(path, git: {}) ⇒ nil, QB::Repo
Get an instance for whatever repo
path
is in. -
.from_path!(path, **opts) ⇒ QB::Repo
Instantiate a Repo for the repo
path
is in or raise if it's not in any single recognizable repo.
Instance Method Summary collapse
Methods inherited from Util::Resource
Constructor Details
This class inherits a constructor from QB::Util::Resource
Instance Attribute Details
#name ⇒ String (readonly)
The string name of the repo.
109 |
# File 'lib/qb/repo.rb', line 109 prop :name, type: t.maybe( t.non_empty_str ) |
#ref_path ⇒ String | 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 Git.
92 |
# File 'lib/qb/repo.rb', line 92 prop :ref_path, type: t.maybe( t.path ) |
#root_path ⇒ Pathname (readonly)
Absolute path to the gem's root directory.
100 |
# File 'lib/qb/repo.rb', line 100 prop :root_path, type: t.dir_path |
Class Method Details
.from_path(path, git: {}) ⇒ nil, QB::Repo
Get an instance for whatever repo path
is in.
49 50 51 |
# File 'lib/qb/repo.rb', line 49 def self.from_path path, git: {} QB::Repo::Git.from_path path, **git end |
.from_path!(path, **opts) ⇒ QB::Repo
Instantiate a QB::Repo for the repo path
is in or raise if it's not in
any single recognizable repo.
65 66 67 68 69 70 71 72 |
# File 'lib/qb/repo.rb', line 65 def self.from_path! path, **opts from_path( path, **opts ).tap { |repo| if repo.nil? raise QB::FSStateError, "Path #{ path.inspect } does not appear to be in a repo." end } end |
Instance Method Details
#tags ⇒ Array<String>
Document tags method.
122 123 124 |
# File 'lib/qb/repo.rb', line 122 def raise NotImplementedError end |