Skip to content

Commit c8ba90f

Browse files
maxnussbaumGERMAN ATTANASIO RUIZ
authored andcommitted
refactor(global): Move from WatsonAPIs to IBMWatson
1 parent 32030e4 commit c8ba90f

File tree

59 files changed

+299
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+299
-299
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
current_version = 0.1.0
33
commit = True
44

5-
[bumpversion:file:lib/watson_apis/version.rb]
5+
[bumpversion:file:lib/ibm_watson/version.rb]
66
search = {current_version}
77
replace = {new_version}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/test/version_tmp/
1111
/tmp/
1212
.DS_Store
13-
lib/watson_apis/.swagger-codegen-ignore
14-
lib/watson_apis/.swagger-codegen
13+
lib/ibm_watson/.swagger-codegen-ignore
14+
lib/ibm_watson/.swagger-codegen
1515

1616
# Used by dotenv library to load environment variables.
1717
.env

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ deploy:
2727

2828
- provider: rubygems
2929
api_key: $RUBYGEMS_API_KEY
30-
gem: watson_apis
30+
gem: ibm_watson
3131
on:
3232
branch: master
3333
rvm: 2.5.1

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Watson APIs Ruby SDK
1+
# IBM Watson Ruby SDK
22

33
[![Build Status](https://travis-ci.org/watson-developer-cloud/ruby-sdk.svg?branch=master)](https://travis-ci.org/watson-developer-cloud/ruby-sdk)
44
[![Slack](https://wdc-slack-inviter.mybluemix.net/badge.svg)](https://wdc-slack-inviter.mybluemix.net)
55
[![codecov.io](https://codecov.io/github/watson-developer-cloud/ruby-sdk/coverage.svg?branch=master)](https://codecov.io/github/watson-developer-cloud/ruby-sdk?branch=master)
6-
[![Gem Version](https://badge.fury.io/rb/watson_apis.svg)](https://badge.fury.io/rb/watson_apis)
6+
[![Gem Version](https://badge.fury.io/rb/ibm_watson.svg)](https://badge.fury.io/rb/ibm_watson)
77

8-
Ruby gem to quickly get started with the various [Watson APIs][wdc] services.
8+
Ruby gem to quickly get started with the various [IBM Watson][wdc] services.
99

1010
<details>
1111
<summary>Table of Contents</summary>
@@ -36,19 +36,19 @@ Ruby gem to quickly get started with the various [Watson APIs][wdc] services.
3636
Install the gem:
3737

3838
```bash
39-
gem install watson_apis
39+
gem install ibm_watson
4040
```
4141

4242
Install with development dependencies:
4343

4444
```bash
45-
gem install --dev watson_apis
45+
gem install --dev ibm_watson
4646
```
4747

4848
Inside of your Ruby program do:
4949

5050
```ruby
51-
require "watson_apis"
51+
require "ibm_watson"
5252
```
5353

5454
## Examples
@@ -87,7 +87,7 @@ You supply either an IAM service **API key** or an **access token**:
8787

8888
```ruby
8989
# In the constructor, letting the SDK manage the IAM token
90-
discovery = WatsonAPIs::DiscoveryV1.new(
90+
discovery = IBMWatson::DiscoveryV1.new(
9191
version: "2017-10-16",
9292
iam_api_key: "<iam_api_key>",
9393
iam_url: "<iam_url>" # optional - the default value is https://iam.ng.bluemix.net/identity/token
@@ -96,29 +96,29 @@ discovery = WatsonAPIs::DiscoveryV1.new(
9696

9797
```ruby
9898
# after instantiation, letting the SDK manage the IAM token
99-
discovery = WatsonAPIs::DiscoveryV1.new(version: "2017-10-16")
99+
discovery = IBMWatson::DiscoveryV1.new(version: "2017-10-16")
100100
discovery._iam_api_key(iam_api_key: "<iam_api_key>")
101101
```
102102

103103
#### Supplying the access token
104104
```ruby
105105
# in the constructor, assuming control of managing IAM token
106-
discovery = WatsonAPIs::DiscoveryV1.new(
106+
discovery = IBMWatson::DiscoveryV1.new(
107107
version: "2017-10-16",
108108
iam_access_token: "<iam_access_token>"
109109
)
110110
```
111111

112112
```ruby
113113
# after instantiation, assuming control of managing IAM token
114-
discovery = WatsonAPIs::DiscoveryV1.new(version: "2017-10-16")
114+
discovery = IBMWatson::DiscoveryV1.new(version: "2017-10-16")
115115
discovery._iam_access_token(iam_access_token: "<access_token>")
116116
```
117117

118118
### Username and password
119119
```ruby
120-
require "watson_apis"
121-
include WatsonAPIs
120+
require "ibm_watson"
121+
include IBMWatson
122122
# In the constructor
123123
discovery = DiscoveryV1.new(version: "2017-10-16", username: "<username>", password: "<password>")
124124
```
@@ -137,7 +137,7 @@ Requests can be sent asynchronously. There are two asynchronous methods availabl
137137

138138
When `await` is used, the request is made synchronously.
139139
```ruby
140-
speech_to_text = WatsonAPIs::SpeechToTextV1.new(
140+
speech_to_text = IBMWatson::SpeechToTextV1.new(
141141
username: "username",
142142
password: "password"
143143
)
@@ -151,7 +151,7 @@ output = future.value # The response is accessible at future.value
151151

152152
When `async` is used, the request is made asynchronously
153153
```ruby
154-
speech_to_text = WatsonAPIs::SpeechToTextV1.new(
154+
speech_to_text = IBMWatson::SpeechToTextV1.new(
155155
username: "username",
156156
password: "password"
157157
)
@@ -168,8 +168,8 @@ output = future.value
168168
## Sending request headers
169169
Custom headers can be passed in any request in the form of a `Hash` as a parameter to the `headers` chainable method. For example, to send a header called `Custom-Header` to a call in Watson Assistant, pass the headers as a parameter to the `headers` chainable method:
170170
```ruby
171-
require "watson_apis"
172-
include WatsonAPIs
171+
require "ibm_watson"
172+
include IBMWatson
173173

174174
assistant = AssistantV1.new(
175175
username: "xxx",
@@ -185,8 +185,8 @@ response = assistant.headers(
185185
## Parsing HTTP response info
186186
HTTP requests all return `DetailedResponse` objects that have a `body`, `status`, and `headers`
187187
```ruby
188-
require "watson_apis"
189-
include WatsonAPIs
188+
require "ibm_watson"
189+
include IBMWatson
190190

191191
assistant = AssistantV1.new(
192192
username: "xxx",
@@ -215,11 +215,11 @@ Body: <response returned by service>
215215
The Speech-to-Text service supports websockets with the `recognize-with-websockets` method. The method accepts a custom callback class. The `eventmachine` loop that the websocket uses blocks the main thread by default. Here is an example of using the websockets method:
216216

217217
```ruby
218-
require "watson_apis"
218+
require "ibm_watson"
219219

220-
callback = WatsonAPIs::RecognizeCallback.new
220+
callback = IBMWatson::RecognizeCallback.new
221221
audio_file = "<Audio File for Analysis>"
222-
speech_to_text = WatsonAPIs::SpeechToTextV1.new(
222+
speech_to_text = IBMWatson::SpeechToTextV1.new(
223223
username: "<username>",
224224
password: "<password>"
225225
)

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env ruby
22

33
require "bundler/setup"
4-
require "watson_apis"
4+
require "ibm_watson"
55

66
# You can add fixtures and/or initialization code here to make experimenting
77
# with your gem easier. You can also use a different console, if you like.

examples/assistant_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require("watson_apis/assistant_v1")
1+
require("ibm_watson/assistant_v1")
22

33
# If using IAM
44
assistant = AssistantV1(

examples/discovery_v1.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
require("watson_apis/discovery_v1")
1+
require("ibm_watson/discovery_v1")
22

33
# If using IAM
4-
discovery = WatsonAPIs::DiscoveryV1.new(
4+
discovery = IBMWatson::DiscoveryV1.new(
55
iam_api_key: "IAM API KEY",
66
version: "2018-03-05"
77
)
88

99
# If you have username & password in your credentials use:
10-
# discovery = WatsonAPIs::DiscoveryV1.new(
10+
# discovery = IBMWatson::DiscoveryV1.new(
1111
# username: "username",
1212
# password: "password",
1313
# version: "2018-03-05"

examples/language_translator_v3.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
require("watson_apis/language_translator_v3")
1+
require("ibm_watson/language_translator_v3")
22

33
# If using IAM
4-
language_translator = WatsonAPIs::LanguageTranslatorV3.new(
4+
language_translator = IBMWatson::LanguageTranslatorV3.new(
55
version: "2018-05-31",
66
### url is optional, and defaults to the URL below. Use the correct URL for your region.
77
# url: "https://gateway.watsonplatform.net/language-translator/api",
88
iam_api_key: "your_api_key"
99
)
1010

1111
# If you have username & password in your credentials use:
12-
# language_translator = WatsonAPIs::LanguageTranslatorV3.new(
12+
# language_translator = IBMWatson::LanguageTranslatorV3.new(
1313
# version: "2018-05-31",
1414
# username: "username",
1515
# password: "password"

examples/natural_language_classifier_v1.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
require("watson_apis/natural_language_classifier_v1")
1+
require("ibm_watson/natural_language_classifier_v1")
22

33
# If using IAM
4-
natural_language_classifier = WatsonAPIs::NaturalLanguageClassifierV1.new(
4+
natural_language_classifier = IBMWatson::NaturalLanguageClassifierV1.new(
55
iam_api_key: "IAM API KEY"
66
)
77

88
# If you have username & password in your credentials use:
9-
# natural_language_classifier = WatsonAPIs::NaturalLanguageClassifierV1.new(
9+
# natural_language_classifier = IBMWatson::NaturalLanguageClassifierV1.new(
1010
# username: "YOUR SERVICE USERNAME",
1111
# password: "YOUR SERVICE PASSWORD"
1212
# )

examples/natural_language_understanding_v1.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
require("watson_apis/natural_language_understanding_v1")
1+
require("ibm_watson/natural_language_understanding_v1")
22

33
# If using IAM
4-
natural_language_understanding = WatsonAPIs::NaturalLanguageUnderstandingV1.new(
4+
natural_language_understanding = IBMWatson::NaturalLanguageUnderstandingV1.new(
55
iam_api_key: "IAM API KEY",
66
version: "2018-03-16"
77
)
88

99
# If you have username & password in your credentials use:
10-
# natural_language_understanding = WatsonAPIs::NaturalLanguageUnderstandingV1.new(
10+
# natural_language_understanding = IBMWatson::NaturalLanguageUnderstandingV1.new(
1111
# username: "YOUR SERVICE USERNAME",
1212
# password: "YOUR SERVICE PASSWORD",
1313
# version: "2018-03-16"

0 commit comments

Comments
 (0)