Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 5250407

Browse files
authored
Merge pull request #957 from TwilioDevEd/fix-ruby-snippets
Fix ruby snippets linter issues
2 parents 44496e0 + 4ed1f78 commit 5250407

File tree

147 files changed

+346
-349
lines changed

Some content is hidden

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

147 files changed

+346
-349
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ Style/FrozenStringLiteralComment:
1111
Enabled: false
1212
Metrics/BlockLength:
1313
Enabled: false
14+
Metrics/MethodLength:
15+
Enabled: false

api-auth/api-auth.5.x.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'twilio-ruby'
22

33
# To set up environmental variables, see http://twil.io/secure
4-
account_sid = ENV['TWILIO_ACCOUNT_SID'] # Your Account SID from www.twilio.com/console
5-
api_key = ENV['TWILIO_API_KEY'] # You can generate this from www.twilio.com/console/runtime/api-keys/create
6-
api_secret = ENV['TWILIO_API_KEY_SECRET'] # You can generate this from www.twilio.com/console/runtime/api-keys/create
4+
account_sid = ENV['TWILIO_ACCOUNT_SID'] # Your Account SID from www.twilio.com/console
5+
api_key = ENV['TWILIO_API_KEY'] # You can generate this from www.twilio.com/console/runtime/api-keys/create
6+
api_secret = ENV['TWILIO_API_KEY_SECRET'] # You can generate this from www.twilio.com/console/runtime/api-keys/create
77

88
# DANGER! This is insecure. See http://twil.io/secure
99
@client = Twilio::REST::Client.new api_key, api_secret, account_sid

client/capability-token-2way/capability-token.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'sinatra'
33

44
get '/token' do
5-
# To set up environmental variables, see http://twil.io/secure
5+
# To set up environmental variables, see http://twil.io/secure
66
account_sid = ENV['TWILIO_ACCOUNT_SID']
77
auth_token = ENV['TWILIO_AUTH_TOKEN']
88
capability = Twilio::JWT::ClientCapability.new(account_sid, auth_token)

client/capability-token-incoming/capability-token.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'sinatra'
33

44
get '/token' do
5-
# To set up environmental variables, see http://twil.io/secure
5+
# To set up environmental variables, see http://twil.io/secure
66
account_sid = ENV['TWILIO_ACCOUNT_SID']
77
auth_token = ENV['TWILIO_AUTH_TOKEN']
88
capability = Twilio::JWT::ClientCapability.new(account_sid, auth_token)

client/capability-token-outgoing/capability-token.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'sinatra'
33

44
get '/token' do
5-
# To set up environmental variables, see http://twil.io/secure
5+
# To set up environmental variables, see http://twil.io/secure
66
account_sid = ENV['TWILIO_ACCOUNT_SID']
77
auth_token = ENV['TWILIO_AUTH_TOKEN']
88
capability = Twilio::JWT::ClientCapability.new(account_sid, auth_token)

client/capability-token/capability-token.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'sinatra'
33

44
get '/token' do
5-
# To set up environmental variables, see http://twil.io/secure
5+
# To set up environmental variables, see http://twil.io/secure
66
account_sid = ENV['TWILIO_ACCOUNT_SID']
77
auth_token = ENV['TWILIO_AUTH_TOKEN']
88
capability = Twilio::JWT::ClientCapability.new(account_sid, auth_token)

client/response-twiml-client/response-twiml-client.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
r.Dial callerId: '+15017122661' do |d|
88
# wrap the phone number or client name in the appropriate TwiML verb
99
# by checking if the number given has only digits and format symbols
10-
if params['To'].match?(/^[\d\+\-\(\) ]+$/)
10+
if params['To'].match?(/^[\d+\-() ]+$/)
1111
d.Number params['To']
1212
else
1313
d.Client params['To']

fax/basic-send/basic-send.5.x.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
Net::HTTP.start(uri.host, uri.port,
1212
use_ssl: uri.scheme == 'https') do |http|
13-
1413
request = Net::HTTP::Post.new uri.request_uri
1514
request.basic_auth account_sid, auth_token
1615
request.body = URI.encode_www_form(To: '+15558675310',

fax/instance-get-example/instance-get-example.5.x.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
Net::HTTP.start(uri.host, uri.port,
1212
use_ssl: uri.scheme == 'https') do |http|
13-
1413
request = Net::HTTP::Get.new uri.request_uri
1514
request.basic_auth(account_sid, auth_token)
1615

fax/instance-post-example/instance-post-example.5.x.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
Net::HTTP.start(uri.host, uri.port,
1212
use_ssl: uri.scheme == 'https') do |http|
13-
1413
request = Net::HTTP::Post.new uri.request_uri
1514
request.basic_auth(account_sid, auth_token)
1615
request.body = URI.encode_www_form(Status: 'canceled')

0 commit comments

Comments
 (0)