Class: Licensee::Projects::GitProject
- Defined in:
- lib/licensee/projects/git_project.rb
Defined Under Namespace
Classes: InvalidRepository
Constant Summary
Constants inherited from Project
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Attributes inherited from Project
#detect_packages, #detect_readme
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(repo, revision: nil, **args) ⇒ GitProject
constructor
A new instance of GitProject.
Methods inherited from Project
#license, #license_file, #license_files, #licenses, #matched_file, #matched_files, #package_file, #readme_file
Methods included from HashHelper
Constructor Details
#initialize(repo, revision: nil, **args) ⇒ GitProject
Returns a new instance of GitProject.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/licensee/projects/git_project.rb', line 18 def initialize(repo, revision: nil, **args) @repository = if repo.is_a? Rugged::Repository repo else Rugged::Repository.new(repo) end @revision = revision super(**args) rescue Rugged::OSError, Rugged::RepositoryError raise InvalidRepository end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
14 15 16 |
# File 'lib/licensee/projects/git_project.rb', line 14 def repository @repository end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
14 15 16 |
# File 'lib/licensee/projects/git_project.rb', line 14 def revision @revision end |
Instance Method Details
#close ⇒ Object
31 32 33 |
# File 'lib/licensee/projects/git_project.rb', line 31 def close @repository.close end |