Class: Licensee::GitProject
Overview
Git-based project
analyze a given git repository for license information
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.
Instance Method Summary collapse
-
#initialize(repo, revision: nil, detect_packages: false) ⇒ GitProject
constructor
A new instance of GitProject.
Methods inherited from Project
#detect_packages?, #license, #license_file, #matched_file, #package_file
Constructor Details
#initialize(repo, revision: nil, detect_packages: false) ⇒ GitProject
Returns a new instance of GitProject.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/licensee/project.rb', line 55 def initialize(repo, revision: nil, detect_packages: false) if repo.kind_of? Rugged::Repository @repository = repo else @repository = Rugged::Repository.new(repo) end @revision = revision super(detect_packages) rescue Rugged::RepositoryError raise InvalidRepository end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
51 52 53 |
# File 'lib/licensee/project.rb', line 51 def repository @repository end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
51 52 53 |
# File 'lib/licensee/project.rb', line 51 def revision @revision end |