Class: Licensee::GitProject
- Defined in:
- lib/licensee/projects/git_project.rb
Defined Under Namespace
Classes: InvalidRepository
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, #matched_file, #package_file, #readme_file
Constructor Details
#initialize(repo, revision: nil, **args) ⇒ GitProject
Returns a new instance of GitProject.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/licensee/projects/git_project.rb', line 10 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.
6 7 8 |
# File 'lib/licensee/projects/git_project.rb', line 6 def repository @repository end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
6 7 8 |
# File 'lib/licensee/projects/git_project.rb', line 6 def revision @revision end |
Instance Method Details
#close ⇒ Object
23 24 25 |
# File 'lib/licensee/projects/git_project.rb', line 23 def close @repository.close end |