Class: Stove::CommunitySite
- Inherits:
-
Object
- Object
- Stove::CommunitySite
- Includes:
- HTTParty
- Defined in:
- lib/stove/community_site.rb
Class Method Summary collapse
-
.cookbook(name, version = nil) ⇒ Object
Get and cache a community cookbook’s JSON response from the given name and version.
-
.http_uri(arg = nil) ⇒ String
The URI for the web-based version of the site.
Class Method Details
.cookbook(name, version = nil) ⇒ Object
Get and cache a community cookbook’s JSON response from the given name and version.
44 45 46 47 48 49 50 |
# File 'lib/stove/community_site.rb', line 44 def cookbook(name, version = nil) if version.nil? get("/cookbooks/#{name}") else get("/cookbooks/#{name}/versions/#{format_version(version)}") end end |
.http_uri(arg = nil) ⇒ String
The URI for the web-based version of the site. (default: community.opscode.com).
If a parameter is given, the http_uri is set to that value.
16 17 18 19 20 21 22 23 |
# File 'lib/stove/community_site.rb', line 16 def http_uri(arg = nil) if arg.nil? @http_uri ||= 'https://community.opscode.com' else @http_uri = arg @http_uri end end |