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)|[^\/]+)).*}.freeze
Constants inherited from Project
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Attributes inherited from Project
#detect_packages, #detect_readme
Instance Method Summary collapse
-
#initialize(github_url, **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, **args) ⇒ GitHubProject
Returns a new instance of GitHubProject.
20 21 22 23 24 25 |
# File 'lib/licensee/projects/github_project.rb', line 20 def initialize(github_url, **args) @repo = github_url[GITHUB_REPO_PATTERN, 1] raise ArgumentError, "Not a github URL: #{github_url}" unless @repo super(**args) end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
27 28 29 |
# File 'lib/licensee/projects/github_project.rb', line 27 def repo @repo end |