diff --git a/README.md b/README.md index 0915752..cf15bfb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Platform API +# Heroku Platform API Ruby HTTP client for the Heroku API. @@ -7,7 +7,7 @@ Ruby HTTP client for the Heroku API. Add this line to your application's Gemfile: ``` -gem 'platform-api' +gem 'heroku-platform_api' ``` And then execute: @@ -19,7 +19,7 @@ bundle Or install it yourself as: ``` -gem install platform-api +gem install heroku-platform_api ``` ## API documentation @@ -77,8 +77,8 @@ Created OAuth authorization. Use the `Token` value when instantiating a client: ```ruby -require 'platform-api' -heroku = PlatformAPI.connect_oauth('e7dd6ad7-3c6a-411e-a2be-c9fe52ac7ed2') +require 'heroku/platform_api' +heroku = Heroku::PlatformAPI.connect_oauth('e7dd6ad7-3c6a-411e-a2be-c9fe52ac7ed2') ``` The [OAuth article](https://devcenter.heroku.com/articles/oauth) has more information about OAuth tokens, including how to @@ -275,7 +275,7 @@ The various `connect` methods take an options hash that you can use to include custom headers to include with every request: ```ruby -client = PlatformAPI.connect('my-api-key', default_headers: {'Foo' => 'Bar'}) +client = Heroku::PlatformAPI.connect('my-api-key', default_headers: {'Foo' => 'Bar'}) ``` ### Using a custom cache @@ -285,7 +285,7 @@ Use a different caching by passing in the [Moneta](https://github.com/minad/mone instance you want to use: ```ruby -client = PlatformAPI.connect('my-api-key', cache: Moneta.new(:Memory)) +client = Heroku::PlatformAPI.connect('my-api-key', cache: Moneta.new(:Memory)) ``` ### Connecting to a different host @@ -293,7 +293,7 @@ client = PlatformAPI.connect('my-api-key', cache: Moneta.new(:Memory)) Connect to a different host by passing a `url` option: ```ruby -client = PlatformAPI.connect('my-api-key', url: 'https://api.example.com') +client = Heroku::PlatformAPI.connect('my-api-key', url: 'https://api.example.com') ``` ## Building and releasing @@ -310,7 +310,7 @@ Remember to commit and push the changes to Github. ### Release a new gem -* Bump the version in `lib/platform-api/version.rb` +* Bump the version in `lib/heroku/platform_api/version.rb` * `bundle install` to update Gemfile.lock * `git commit -m 'vX.Y.Z' to stage the version and Gemfile.lock changes * `rake release` to push git changes and to release to Rubygems diff --git a/platform-api.gemspec b/heroku-platform_api.gemspec similarity index 90% rename from platform-api.gemspec rename to heroku-platform_api.gemspec index 7543aba..eda0f08 100644 --- a/platform-api.gemspec +++ b/heroku-platform_api.gemspec @@ -3,11 +3,11 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'platform-api/version' +require 'heroku/platform_api/version' Gem::Specification.new do |spec| spec.name = 'platform-api' - spec.version = PlatformAPI::VERSION + spec.version = Heroku::PlatformAPI::VERSION spec.authors = ['jkakar'] spec.email = ['jkakar@kakar.ca'] spec.description = 'Ruby HTTP client for the Heroku API.' diff --git a/lib/platform-api/client.rb b/lib/heroku/platform_api/client.rb similarity index 99% rename from lib/platform-api/client.rb rename to lib/heroku/platform_api/client.rb index 3832d94..367902f 100644 --- a/lib/platform-api/client.rb +++ b/lib/heroku/platform_api/client.rb @@ -9,8 +9,9 @@ require 'heroics' require 'uri' - -module PlatformAPI +module Heroku +end +module Heroku::PlatformAPI # Get a Client configured to use HTTP Basic or header-based authentication. # # @param api_key [String] The API key to use when connecting. @@ -405,7 +406,7 @@ def otp_secret @otp_secret_resource ||= OtpSecret.new(@client) end - # An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with. + # An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with. # # @return [OutboundRuleset] def outbound_ruleset @@ -1758,14 +1759,14 @@ def initialize(client) # Retrieve Organization Preferences # - # @param organization_preferences_identity: + # @param organization_preferences_identity: def list(organization_preferences_identity) @client.organization_preferences.list(organization_preferences_identity) end # Update Organization Preferences # - # @param organization_preferences_identity: + # @param organization_preferences_identity: # @param body: the object to pass as the request payload def update(organization_preferences_identity, body = {}) @client.organization_preferences.update(organization_preferences_identity, body) @@ -1811,7 +1812,7 @@ def create() end end - # An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with. + # An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with. class OutboundRuleset def initialize(client) @client = client diff --git a/lib/platform-api/schema.json b/lib/heroku/platform_api/schema.json similarity index 100% rename from lib/platform-api/schema.json rename to lib/heroku/platform_api/schema.json diff --git a/lib/heroku/platform_api/version.rb b/lib/heroku/platform_api/version.rb new file mode 100644 index 0000000..b3198ac --- /dev/null +++ b/lib/heroku/platform_api/version.rb @@ -0,0 +1,5 @@ +module Heroku + module PlatformAPI + VERSION = '0.8.0' + end +end diff --git a/lib/platform-api.rb b/lib/platform-api.rb deleted file mode 100644 index ca4a589..0000000 --- a/lib/platform-api.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'heroics' - -# Ruby HTTP client for the Heroku API. -module PlatformAPI -end - -require 'platform-api/client' -require 'platform-api/version' diff --git a/lib/platform-api/version.rb b/lib/platform-api/version.rb deleted file mode 100644 index f7f8bfa..0000000 --- a/lib/platform-api/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module PlatformAPI - VERSION = '0.8.0' -end diff --git a/lib/platform_api.rb b/lib/platform_api.rb new file mode 100644 index 0000000..607bf08 --- /dev/null +++ b/lib/platform_api.rb @@ -0,0 +1,10 @@ +require 'heroics' + +# Ruby HTTP client for the Heroku API. +module Heroku + module PlatformAPI + end +end + +require 'heroku/platform_api/client' +require 'heroku/platform_api/version'