Skip to content

Commit

Permalink
Update README files to use new factory methods
Browse files Browse the repository at this point in the history
  • Loading branch information
blowmage committed Oct 6, 2016
1 parent 302884e commit 9a9bd9c
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 84 deletions.
71 changes: 34 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ $ gem install google-cloud-bigquery
#### Preview

```ruby
require "google/cloud"
require "google/cloud/bigquery"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
bigquery = gcloud.bigquery
bigquery = Google::Cloud::Bigquery.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Create a new table to archive todos
dataset = bigquery.dataset "my-todo-archive"
Expand Down Expand Up @@ -104,11 +105,12 @@ $ gem install google-cloud-datastore
#### Preview

```ruby
require "google/cloud"
require "google/cloud/datastore"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
datastore = gcloud.datastore
datastore = Google::Cloud::Datastore.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Create a new task to demo datastore
task = datastore.entity "Task", "sampleTask" do |t|
Expand Down Expand Up @@ -143,10 +145,9 @@ $ gem install google-cloud-dns
#### Preview

```ruby
require "google/cloud"
require "google/cloud/dns"

gcloud = Google::Cloud.new
dns = gcloud.dns
dns = Google::Cloud::Dns.new

# Retrieve a zone
zone = dns.zone "example-com"
Expand Down Expand Up @@ -180,10 +181,9 @@ $ gem install google-cloud-logging
#### Preview

```ruby
require "google/cloud"
require "google/cloud/logging"

gcloud = Google::Cloud.new
logging = gcloud.logging
logging = Google::Cloud::Logging.new

# List all log entries
logging.entries.each do |e|
Expand Down Expand Up @@ -220,10 +220,9 @@ $ gem install google-cloud-language
#### Preview

```ruby
require "google/cloud"
require "google/cloud/language"

gcloud = Google::Cloud.new
language = gcloud.language
language = Google::Cloud::Language.new

content = "Darth Vader is the best villain in Star Wars."
document = language.document content
Expand Down Expand Up @@ -252,11 +251,12 @@ $ gem install google-cloud-pubsub
#### Preview

```ruby
require "google/cloud"
require "google/cloud/pubsub"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
pubsub = gcloud.pubsub
pubsub = Google::Cloud::Pubsub.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Retrieve a topic
topic = pubsub.topic "my-topic"
Expand Down Expand Up @@ -287,10 +287,9 @@ $ gem install google-cloud-resource_manager
#### Preview

```ruby
require "google/cloud"
require "google/cloud/resource_manager"

gcloud = Google::Cloud.new
resource_manager = gcloud.resource_manager
resource_manager = Google::Cloud::ResourceManager.new

# List all projects
resource_manager.projects.each do |project|
Expand Down Expand Up @@ -323,10 +322,9 @@ $ gem install google-cloud-speech
#### Preview

```ruby
require "google/cloud"
require "google/cloud/speech"

gcloud = Google::Cloud.new
speech = gcloud.speech
speech = Google::Cloud::Speech.new

audio = speech.audio "path/to/audio.raw",
encoding: :raw, sample_rate: 16000
Expand All @@ -353,11 +351,12 @@ $ gem install google-cloud-storage
#### Preview

```ruby
require "google/cloud"
require "google/cloud/storage"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
storage = gcloud.storage
storage = Google::Cloud::Storage.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

bucket = storage.bucket "task-attachments"

Expand Down Expand Up @@ -387,10 +386,9 @@ $ gem install google-cloud-translate
#### Preview

```ruby
require "google/cloud"
require "google/cloud/translate"

gcloud = Google::Cloud.new
translate = gcloud.translate
translate = Google::Cloud::Translate.new

translation = translate.translate "Hello world!", to: "la"

Expand Down Expand Up @@ -418,10 +416,9 @@ $ gem install google-cloud-vision
#### Preview

```ruby
require "google/cloud"
require "google/cloud/vision"

gcloud = Google::Cloud.new
vision = gcloud.vision
vision = Google::Cloud::Vision.new

image = vision.image "path/to/landmark.jpg"

Expand Down
11 changes: 6 additions & 5 deletions google-cloud-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/bigquery"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
bigquery = gcloud.bigquery
bigquery = Google::Cloud::Bigquery.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Create a new table to archive todos
dataset = bigquery.dataset "my-todo-archive"
Expand Down Expand Up @@ -70,4 +71,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
11 changes: 6 additions & 5 deletions google-cloud-datastore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/datastore"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
datastore = gcloud.datastore
datastore = Google::Cloud::Datastore.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Create a new task to demo datastore
task = datastore.entity "Task", "sampleTask" do |t|
Expand Down Expand Up @@ -71,4 +72,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
7 changes: 3 additions & 4 deletions google-cloud-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/dns"

gcloud = Google::Cloud.new
dns = gcloud.dns
dns = Google::Cloud::Dns.new

# Retrieve a zone
zone = dns.zone "example-com"
Expand Down Expand Up @@ -66,4 +65,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
6 changes: 2 additions & 4 deletions google-cloud-language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/language"

gcloud = Google::Cloud.new
language = gcloud.language
language = Google::Cloud::Language.new

content = "Darth Vader is the best villain in Star Wars."
document = language.document content
Expand Down Expand Up @@ -65,4 +64,3 @@ This library is licensed under Apache 2.0. Full license text is available in [LI

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).

7 changes: 3 additions & 4 deletions google-cloud-logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/logging"

gcloud = Google::Cloud.new
logging = gcloud.logging
logging = Google::Cloud::Logging.new

# List all log entries
logging.entries.each do |e|
Expand Down Expand Up @@ -70,4 +69,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
11 changes: 6 additions & 5 deletions google-cloud-pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/pubsub"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
pubsub = gcloud.pubsub
pubsub = Google::Cloud::Pubsub.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

# Retrieve a topic
topic = pubsub.topic "my-topic"
Expand Down Expand Up @@ -65,4 +66,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
7 changes: 3 additions & 4 deletions google-cloud-resource_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/resource_manager"

gcloud = Google::Cloud.new
resource_manager = gcloud.resource_manager
resource_manager = Google::Cloud::ResourceManager.new

# List all projects
resource_manager.projects.each do |project|
Expand Down Expand Up @@ -98,4 +97,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
6 changes: 2 additions & 4 deletions google-cloud-speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/speech"

gcloud = Google::Cloud.new
speech = gcloud.speech
speech = Google::Cloud::Speech.new

audio = speech.audio "path/to/audio.raw",
encoding: :raw, sample_rate: 16000
Expand Down Expand Up @@ -61,4 +60,3 @@ This library is licensed under Apache 2.0. Full license text is available in [LI

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).

11 changes: 6 additions & 5 deletions google-cloud-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/storage"

gcloud = Google::Cloud.new "my-todo-project-id",
"/path/to/keyfile.json"
storage = gcloud.storage
storage = Google::Cloud::Storage.new(
project: "my-todo-project",
keyfile: "/path/to/keyfile.json"
)

bucket = storage.bucket "task-attachments"

Expand Down Expand Up @@ -64,4 +65,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
7 changes: 3 additions & 4 deletions google-cloud-translate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/translate"

gcloud = Google::Cloud.new
translate = gcloud.translate
translate = Google::Cloud::Translate.new

translation = translate.translate "Hello world!", to: "la"

Expand Down Expand Up @@ -69,4 +68,4 @@ This library is licensed under Apache 2.0. Full license text is available in [LI
## Support

Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
5 changes: 2 additions & 3 deletions google-cloud-vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ Instructions and configuration options are covered in the [Authentication Guide]
## Example

```ruby
require "google/cloud"
require "google/cloud/vision"

gcloud = Google::Cloud.new
vision = gcloud.vision
vision = Google::Cloud::Vision.new

image = vision.image "path/to/landmark.jpg"

Expand Down

0 comments on commit 9a9bd9c

Please sign in to comment.