Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename gem and namespace everything #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Platform API
# Heroku Platform API

Ruby HTTP client for the Heroku API.

Expand All @@ -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:
Expand All @@ -19,7 +19,7 @@ bundle
Or install it yourself as:

```
gem install platform-api
gem install heroku-platform_api
```

## API documentation
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -285,15 +285,15 @@ 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

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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions platform-api.gemspec → heroku-platform_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ['[email protected]']
spec.description = 'Ruby HTTP client for the Heroku API.'
Expand Down
13 changes: 7 additions & 6 deletions lib/platform-api/client.rb → lib/heroku/platform_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions lib/heroku/platform_api/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Heroku
module PlatformAPI
VERSION = '0.8.0'
end
end
8 changes: 0 additions & 8 deletions lib/platform-api.rb

This file was deleted.

3 changes: 0 additions & 3 deletions lib/platform-api/version.rb

This file was deleted.

10 changes: 10 additions & 0 deletions lib/platform_api.rb
Original file line number Diff line number Diff line change
@@ -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'