Class: Licensee::Projects::GitHubProject
- Defined in:
- lib/licensee/projects/github_project.rb
Defined Under Namespace
Classes: RepoNotFound
Constant Summary collapse
- GITHUB_REPO_PATTERN =
If there’s any trailing data (e.g. ‘.git`) this pattern will ignore it: we’re going to use the API rather than clone the repo.
%r{https://github.com/([^/]+/([^/]+(?=\.git)|[^/]+)).*}
Constants inherited from Project
Instance Attribute Summary collapse
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Attributes inherited from Project
#detect_packages, #detect_readme
Instance Method Summary collapse
-
#initialize(github_url, ref: nil, **args) ⇒ GitHubProject
constructor
A new instance of GitHubProject.
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(github_url, ref: nil, **args) ⇒ GitHubProject
Returns a new instance of GitHubProject.
24 25 26 27 28 29 30 31 |
# File 'lib/licensee/projects/github_project.rb', line 24 def initialize(github_url, ref: nil, **args) @repo = github_url[GITHUB_REPO_PATTERN, 1] raise ArgumentError, "Not a github URL: #{github_url}" unless @repo @ref = ref super(**args) end |
Instance Attribute Details
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
15 16 17 |
# File 'lib/licensee/projects/github_project.rb', line 15 def ref @ref end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
15 16 17 |
# File 'lib/licensee/projects/github_project.rb', line 15 def repo @repo end |