Class: Hubba::Github
- Inherits:
-
Object
- Object
- Hubba::Github
- Defined in:
- lib/hubba/github.rb
Instance Method Summary collapse
-
#initialize(cache_dir: './cache') ⇒ Github
constructor
A new instance of Github.
-
#offline! ⇒ Object
switch to offline - todo: find a “better” way - why? why not?.
- #offline? ⇒ Boolean
- #org(name) ⇒ Object
- #org_repos(name) ⇒ Object
- #user(name) ⇒ Object
-
#user_orgs(name) ⇒ Object
note: pagination requests that return multiple items will be paginated to 30 items by default.
- #user_repos(name) ⇒ Object
Constructor Details
Instance Method Details
#offline! ⇒ Object
switch to offline - todo: find a “better” way - why? why not?
37 |
# File 'lib/hubba/github.rb', line 37 def offline!() @offline = true; end |
#offline? ⇒ Boolean
38 |
# File 'lib/hubba/github.rb', line 38 def offline?() @offline; end |
#org(name) ⇒ Object
63 64 65 |
# File 'lib/hubba/github.rb', line 63 def org( name ) Resource.new( get "/orgs/#{name}" ) end |
#org_repos(name) ⇒ Object
67 68 69 |
# File 'lib/hubba/github.rb', line 67 def org_repos( name ) Repos.new( get "/orgs/#{name}/repos?per_page=100" ) end |
#user(name) ⇒ Object
41 42 43 |
# File 'lib/hubba/github.rb', line 41 def user( name ) Resource.new( get "/users/#{name}" ) end |
#user_orgs(name) ⇒ Object
note: pagination
requests that return multiple items will be paginated to 30 items by default.
You can specify further pages with the ?page parameter.
For some resources, you can also set a custom page size up to 100
with the ?per_page=100 parameter
58 59 60 |
# File 'lib/hubba/github.rb', line 58 def user_orgs( name ) Orgs.new( get "/users/#{name}/orgs?per_page=100" ) end |