Skip to content

Commit

Permalink
Merge pull request signalwire#25 from signalwire/hotfix/env-names
Browse files Browse the repository at this point in the history
Change ENV name from SIGNALWIRE_ACCOUNT to SIGNALWIRE_PROJECT_KEY
  • Loading branch information
lpradovera authored Jul 30, 2019
2 parents 6d3fe86 + fe2ce88 commit 984b270
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- `Relay::Task` and `on_task` handler for `Consumer`
- Fax API for Relay
- `Detect` API for Relay
### Changed
- Changed `SIGNALWIRE_ACCOUNT` environment variable to `SIGNALWIRE_PROJECT_KEY` to match UI

## [2.0.0] - 2019-07-16
### Added
Expand Down
2 changes: 1 addition & 1 deletion examples/relay/inbound_consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
].each { |f| require f }

# Setup your ENV with:
# SIGNALWIRE_ACCOUNT=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_PROJECT_KEY=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_TOKEN=YOUR_SIGNALWIRE_ACCOUNT_TOKEN
#
Signalwire::Logger.logger.level = ::Logger::DEBUG
Expand Down
2 changes: 1 addition & 1 deletion examples/relay/inbound_dial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
].each { |f| require f }

# Setup your ENV with:
# SIGNALWIRE_ACCOUNT=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_PROJECT_KEY=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_TOKEN=YOUR_SIGNALWIRE_ACCOUNT_TOKEN
#
# Set logging to debug for testing
Expand Down
2 changes: 1 addition & 1 deletion examples/relay/tasking/tasking_receive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
].each { |f| require f }

# Setup your ENV with:
# SIGNALWIRE_ACCOUNT=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_PROJECT_KEY=YOUR_SIGNALWIRE_ACCOUNT_ID
# SIGNALWIRE_TOKEN=YOUR_SIGNALWIRE_ACCOUNT_TOKEN
#
Signalwire::Logger.logger.level = ::Logger::DEBUG
Expand Down
2 changes: 1 addition & 1 deletion examples/relay/tasking/tasking_send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
].each { |f| require f }

task = Signalwire::Relay::Task.new(
project: ENV['SIGNALWIRE_ACCOUNT'],
project: ENV['SIGNALWIRE_PROJECT_KEY'],
token: ENV['SIGNALWIRE_TOKEN'],
host: ENV['SIGNALWIRE_HOST']
)
Expand Down
4 changes: 2 additions & 2 deletions lib/signalwire/relay/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def contexts(val = nil)
# Creates a Consumer instance ready to be run
#
# The initialization parameters can also be supplied via ENV variables
# (SIGNALWIRE_ACCOUNT, SIGNALWIRE_TOKEN and SIGNALWIRE_HOST)
# (SIGNALWIRE_PROJECT_KEY, SIGNALWIRE_TOKEN and SIGNALWIRE_HOST)
# Passed-in values override the environment ones.
#
# @param project [String] Your SignalWire project identifier
# @param token [String] Your SignalWire secret token
# @param SIGNALWIRE_HOST [String] Your SignalWire space URL (not needed for production usage)

def initialize(project: nil, token: nil, host: nil)
@project = project || ENV['SIGNALWIRE_ACCOUNT']
@project = project || ENV['SIGNALWIRE_PROJECT_KEY']
@token = token || ENV['SIGNALWIRE_TOKEN']
@url = host || ENV['SIGNALWIRE_HOST'] || Signalwire::Relay::DEFAULT_URL
@client = Signalwire::Relay::Client.new(project: @project,
Expand Down
2 changes: 1 addition & 1 deletion spec/signalwire/rest/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end

before :each do
@client = Signalwire::REST::Client.new ENV.fetch('SIGNALWIRE_ACCOUNT', 'xyz123-xyz123-xyz123'),
@client = Signalwire::REST::Client.new ENV.fetch('SIGNALWIRE_PROJECT_KEY', 'xyz123-xyz123-xyz123'),
ENV.fetch('SIGNALWIRE_TOKEN', 'PTxyz123-xyz123-xyz123')
end

Expand Down

0 comments on commit 984b270

Please sign in to comment.