Class: LicenseAuto::Package
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- LicenseAuto::Package
- Extended by:
- LicenseAuto
- Defined in:
- lib/license_auto/package.rb
Overview
Package:
language: 'Ruby', # Ruby|Golang|Java|NodeJS|Erlang|Python|
name: 'bundler',
group: 'com.google.http-client', # Optional: Assign nil if your package is not a Java
version: '1.11.2', # Optional: Assign nil if check the latest
server: 'rubygems.org' # Optional: github.com|rubygems.org|pypi.python.org/pypi|registry.npmjs.org
Constant Summary collapse
- LANGUAGES_PACKAGE_SERVER =
Default project server of all kinds of languages.
Key: language name
Value: default project server
{ Ruby: RubyGemsOrg }
- ALL_SERVERS =
[ RubyGemsOrg, GemfuryCom, GithubCom, ]
Instance Method Summary collapse
-
#get_license_info ⇒ LicenseAuto::LicenseInfoWrapper
Class Entry { “readmes”: [ { “name”: “README.md”, “path”: “README.md”, “sha”: “c46767306718fbbb1320d43f6b5668a950c6b0d7”, “size”: 2389, “url”: “api.github.com/repos/bundler/bundler/contents/README.md?ref=v1.11.2”, “html_url”: “github.com/bundler/bundler/blob/v1.11.2/README.md”, “git_url”: “api.github.com/repos/bundler/bundler/git/blobs/c46767306718fbbb1320d43f6b5668a950c6b0d7”, “download_url”: “raw.githubusercontent.com/bundler/bundler/v1.11.2/README.md”, “type”: “file”, “_links”: { “self”: “api.github.com/repos/bundler/bundler/contents/README.md?ref=v1.11.2”, “git”: “api.github.com/repos/bundler/bundler/git/blobs/c46767306718fbbb1320d43f6b5668a950c6b0d7”, “html”: “github.com/bundler/bundler/blob/v1.11.2/README.md” } } ], “notices”: [.
-
#initialize(hash) ⇒ Package
constructor
A new instance of Package.
Methods included from LicenseAuto
Constructor Details
#initialize(hash) ⇒ Package
Returns a new instance of Package.
39 40 41 42 |
# File 'lib/license_auto/package.rb', line 39 def initialize(hash) super(hash) @server = nil end |
Instance Method Details
#get_license_info ⇒ LicenseAuto::LicenseInfoWrapper
Class Entry {
"readmes": [
{
"name": "README.md",
"path": "README.md",
"sha": "c46767306718fbbb1320d43f6b5668a950c6b0d7",
"size": 2389,
"url": "https://api.github.com/repos/bundler/bundler/contents/README.md?ref=v1.11.2",
"html_url": "https://github.com/bundler/bundler/blob/v1.11.2/README.md",
"git_url": "https://api.github.com/repos/bundler/bundler/git/blobs/c46767306718fbbb1320d43f6b5668a950c6b0d7",
"download_url": "https://raw.githubusercontent.com/bundler/bundler/v1.11.2/README.md",
"type": "file",
"_links": {
"self": "https://api.github.com/repos/bundler/bundler/contents/README.md?ref=v1.11.2",
"git": "https://api.github.com/repos/bundler/bundler/git/blobs/c46767306718fbbb1320d43f6b5668a950c6b0d7",
"html": "https://github.com/bundler/bundler/blob/v1.11.2/README.md"
}
}
],
"notices": [
],
"licenses": [
{
"name": "LICENSE.md",
"path": "LICENSE.md",
"sha": "e356f59f949264bff1600af3476d5e37147957cc",
"size": 1118,
"url": "https://api.github.com/repos/bundler/bundler/contents/LICENSE.md?ref=v1.11.2",
"html_url": "https://github.com/bundler/bundler/blob/v1.11.2/LICENSE.md",
"git_url": "https://api.github.com/repos/bundler/bundler/git/blobs/e356f59f949264bff1600af3476d5e37147957cc",
"download_url": "https://raw.githubusercontent.com/bundler/bundler/v1.11.2/LICENSE.md",
"type": "file",
"_links": {
"self": "https://api.github.com/repos/bundler/bundler/contents/LICENSE.md?ref=v1.11.2",
"git": "https://api.github.com/repos/bundler/bundler/git/blobs/e356f59f949264bff1600af3476d5e37147957cc",
"html": "https://github.com/bundler/bundler/blob/v1.11.2/LICENSE.md"
}
}
]
}
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/license_auto/package.rb', line 87 def get_license_info() # args = { # fetch_license_text: true # }.merge(args) @server.get_license_info if chose_package_server # TODO: uncomment these line, add Google or Yahoo! # if @server.nil? # @server.get_license_info if chose_search_engine # end end |