source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/stack_output.rb
Ruby
mit
220
main
755
module Ufo::TaskDefinition::Helpers module StackOutput include Ufo::AwsServices include Ufo::Concerns::Names include Ufo::Utils::Logging def stack_output(name) stack_name, output_key = name.split(".") stack_name = names.expansion(stack_name) stack = find_stack(stack_name) unle...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/vpc.rb
Ruby
mit
220
main
1,254
module Ufo::TaskDefinition::Helpers module Vpc extend Memoist include Ufo::AwsServices def default_vpc resp = ec2.describe_vpcs(filters: [name: "isDefault", values: ["true"]]) vpc = resp.vpcs.first if vpc vpc.vpc_id else logger.error "No default vpc found".color(:r...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/acm.rb
Ruby
mit
220
main
727
module Ufo::TaskDefinition::Helpers module Acm include Ufo::Utils::CallLine include Ufo::Utils::Pretty # returns cert arn def acm_cert(domain) certs = acm_certs cert = certs.find do |c| c.domain_name == domain end if cert cert.certificate_arn else ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/ecr.rb
Ruby
mit
220
main
553
module Ufo::TaskDefinition::Helpers module Ecr include Ufo::Utils::CallLine def ecr_repo(name) repository = ecr_repository(name) repository.repository_uri if repository end def ecr_repository(name) resp = ecr.describe_repositories(repository_names: [name]) resp.repositories.f...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/waf.rb
Ruby
mit
220
main
831
module Ufo::TaskDefinition::Helpers module Waf include Ufo::Utils::CallLine include Ufo::Utils::Pretty # Waf names are uniq within their scope. Tested with AWS console # Only use regional since this is for ELB support # Returns waf arn def waf(name, options={}) resp = waf_client.list_we...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/expansion.rb
Ruby
mit
220
main
357
module Ufo::TaskDefinition::Helpers module Expansion include Ufo::Concerns::Names # Note: vars expansion is different than the TaskDefinition expansion helper # See: Ufo::TaskDefinition::Helpers::Vars#expansion def expansion(string) names.expansion(string) # dasherize: false. dont turn SECRET_N...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/docker.rb
Ruby
mit
220
main
1,094
# Core helper methods. # # * docker_image - Docker image name to be used when a the docker image is build. This is defined in .ufo/config.rb # * dockerfile_port - Exposed port in the Dockerfile. Only supports one exposed port, the first one that is encountered. # module Ufo::TaskDefinition::Helpers module Docker ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/vars/builder.rb
Ruby
mit
220
main
6,337
require "aws_data" module Ufo::TaskDefinition::Helpers::Vars class Builder extend Memoist include Ufo::Concerns::Names include Ufo::Config::CallableOption::Concern include Ufo::TaskDefinition::Helpers::AwsHelper include Ufo::Utils::CallLine include Ufo::Utils::Logging include Ufo::Utils::...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/task_definition/helpers/ssm/fetcher.rb
Ruby
mit
220
main
1,024
module Ufo::TaskDefinition::Helpers::Ssm class Fetcher include Ufo::AwsServices include Ufo::Utils::Logging include Ufo::Concerns::Names def initialize(options={}) @options = options @base64 = options[:base64] end def fetch(name) name = names.expansion(name, dasherize: fals...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/hooks/runner.rb
Ruby
mit
220
main
966
module Ufo::Hooks class Runner include Ufo::Utils::Logging include Ufo::Utils::Execute attr_reader :hook def initialize(hook) @hook = hook @execute = @hook["execute"] end def run case @execute when String execute(@execute, exit_on_fail: @hook["exit_on_fail"]) ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/hooks/builder.rb
Ruby
mit
220
main
1,127
module Ufo::Hooks class Builder extend Memoist include Dsl include DslEvaluator include Ufo::Utils::Logging attr_accessor :name def initialize(options={}) @options = options @file = options[:file] # IE: docker.rb @dsl_file = "#{Ufo.root}/.ufo/config/hooks/#{@file}" @na...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/hooks/dsl.rb
Ruby
mit
220
main
401
module Ufo::Hooks module Dsl def before(*commands, **props) commands.each do |name| each_hook(:before, name, props) end end def after(*commands, **props) commands.each do |name| each_hook(:after, name, props) end end def each_hook(type, name, props={}) ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/ufo/hooks/concern.rb
Ruby
mit
220
main
258
module Ufo::Hooks module Concern # options example: {name: "build", file: "docker.rb"} def run_hooks(options={}, &block) hooks = Ufo::Hooks::Builder.new(options) hooks.build # build hooks hooks.run_hooks(&block) end end end
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/templates/init/.ufo/resources/iam_roles/execution_role.rb
Ruby
mit
220
main
710
# Example starter execution role. # IAM Role permissions that EC2 Instance or host needs. # # Docs: https://ufoships.com/docs/iam-roles/ # # Starter IAM permissions for secrets, ssm, and minimal ecr and cloudwatch permissions iam_policy("SsmParameterStore", Action: [ "ssm:GetParameters", ], Effect: "Allow", ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/templates/init/.ufo/resources/iam_roles/task_role.rb
Ruby
mit
220
main
619
# Example starter execution role. # IAM Role permissions that the ECS Task or container needs. # # Docs: https://ufoships.com/docs/intro/task-iam/ # # For `ufo exec` of `aws ecs execute-command` # See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html#ecs-exec-enabling-and-using iam_policy("EcsE...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
lib/templates/init/.ufo/vars/base.rb
Ruby
mit
220
main
614
# Example .ufo/vars/base.rb # Ufo docs # Variables: http://ufoships.com/docs/variables/ # Helpers: http://ufoships.com/docs/helpers/ @family = family # Also: task_definition_name @name = role # IE: web worker clock @image = docker_image # includes the git sha org/repo:ufo-[sha]. # Docs: https://ufoships.com/docs/h...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/spec_helper.rb
Ruby
mit
220
main
497
ENV["UFO_TEST"] = "1" # Ensures aws api never called. Fixture home does not contain ~/.aws/credentials ENV['HOME'] = "spec/fixtures/home" require "pp" require "byebug" root = File.expand_path("../", File.dirname(__FILE__)) require "#{root}/lib/ufo" module Helpers def execute(cmd) show_command = ENV['DEBUG'] || ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/ecr_auth_spec.rb
Ruby
mit
220
main
1,478
describe Ufo::Ecr::Auth do let(:repo_domain) { "123456789.dkr.ecr.us-east-1.amazonaws.com" } let(:username) { "user" } let(:password) { "opensesame" } let(:auth) { Ufo::Ecr::Auth.new(repo_domain) } before(:each) do allow(auth).to receive(:fetch_auth_token).and_return(Base64.encode64("#{username}:#{passwor...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/logs_spec.rb
Ruby
mit
220
main
1,756
describe Ufo::CLI::Logs do let(:logs) do logs = Ufo::CLI::Logs.new allow(logs).to receive(:exit).and_return(null) allow(logs).to receive(:info).and_return(null) allow(logs).to receive(:ecs).and_return(ecs) logs end let(:ecs) do ecs = double(:ecs).as_null_object allow(ecs).to receive(:d...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/ecr_cleaner_spec.rb
Ruby
mit
220
main
1,184
describe Ufo::Ecr::Cleaner do let(:docker_image_name) { "123456789.dkr.ecr.us-east-1.amazonaws.com/my-name" } let(:repo_domain) { "123456789.dkr.ecr.us-east-1.amazonaws.com" } let(:cleaner) do Ufo::Ecr::Cleaner.new(docker_image_name, ecr_keep: 3, # using 3 to test, default is 30 ) end before(:ea...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/utils/squeezer_spec.rb
Ruby
mit
220
main
476
describe Ufo::Utils::Squeezer do subject { Ufo::Utils::Squeezer.new(data) } context("Array with nil") do let(:data) { [nil] } # Prevents infinite loop it "remove nil" do squeezed = subject.squeeze expect(squeezed).to eq [] end end context("Hash with nil value") do let(:data) { ...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/iam_role/builder_spec.rb
Ruby
mit
220
main
1,865
describe Ufo::IamRole::Builder do let(:builder) { described_class.new(role_type) } let(:role_type) { "task_role" } before(:each) do Ufo::IamRole::Registry.register_policy("task_role", "AmazonS3ReadOnlyAccess", {:Action=>["s3:Get*", "s3:List*"], :Effect=>"Allow", :Resource=>"*"} ) Ufo::Iam...
github
boltops-tools/ufo
https://github.com/boltops-tools/ufo
spec/ufo/iam_role/dsl_spec.rb
Ruby
mit
220
main
367
describe Ufo::IamRole::Dsl do let(:dsl) { described_class.new(path) } let(:path) { "spec/fixtures/iam_roles/task_role.rb" } context "evaluate" do it "registers policies from role Dsl" do dsl.evaluate expect(Ufo::IamRole::Registry.policies).not_to be_empty expect(Ufo::IamRole::Registry.manag...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
Rakefile
Ruby
apache-2.0
220
main
460
require 'rake/testtask' require "bundler/gem_tasks" require 'yard' task :default => :test Rake::TestTask.new(:test) do |t| t.test_files = FileList['test/**/*_test.rb'] t.warning = true end YARD::Rake::YardocTask.new desc "Build gem" task :build_gem do `rake build` end desc "Publish gem" task publish_gem: [:b...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
Gemfile
Ruby
apache-2.0
220
main
354
source 'https://rubygems.org' gemspec gem 'rake', '~> 13' gem 'minitest', '~> 5' gem 'webmock', '~> 3' gem 'yard', '~> 0.9' gem 'simplecov', '~> 0.16' gem 'json', '~> 2' gem 'timecop' gem 'sorbet', :group => :development gem 'sorbet-runtime' gem 'phonelib' gem 'codecov', :require => false, :group => :test group :test...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
vonage.gemspec
Ruby
apache-2.0
220
main
1,404
require File.expand_path('lib/vonage/version', File.dirname(__FILE__)) Gem::Specification.new do |s| s.name = 'vonage' s.version = Vonage::VERSION s.license = 'Apache-2.0' s.platform = Gem::Platform::RUBY s.authors = ['Vonage'] s.email = ['devrel@vonage.com'] s.homepage = 'https://github.com/Vonage/vonag...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/params_test.rb
Ruby
apache-2.0
220
main
708
# typed: false require_relative './test' class Vonage::ParamsTest < Minitest::Test Params = Vonage.const_get(:Params) def test_encode_method_returns_urlencoded_string params = {'name' => 'Example App', 'type' => 'voice'} assert_equal Params.encode(params), 'name=Example+App&type=voice' end def test_...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/account_test.rb
Ruby
apache-2.0
220
main
1,038
# typed: false require_relative './test' class Vonage::AccountTest < Vonage::Test def account Vonage::Account.new(config) end def authorization basic_authorization end def test_balance_method uri = 'https://rest.nexmo.com/account/get-balance' stub_request(:get, uri).with(request).to_return...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/user_agent_test.rb
Ruby
apache-2.0
220
main
402
# typed: false require_relative './test' class Vonage::UserAgentTest < Minitest::Test UserAgent = Vonage.const_get(:UserAgent) def app_name 'ExampleApp' end def app_version 'X.Y.Z' end def test_string_method string = UserAgent.string(app_name, app_version) assert_equal string, "vonage-r...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/test.rb
Ruby
apache-2.0
220
main
12,654
# typed: false require "simplecov" SimpleCov.start { add_filter "test/vonage" } if ENV["CI"] == "true" require "codecov" SimpleCov.formatter = SimpleCov::Formatter::Codecov end require "minitest/autorun" require "webmock/minitest" require "timecop" require "vonage" module Vonage class Test < Minitest::Test ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/http_options_test.rb
Ruby
apache-2.0
220
main
932
# typed: false require_relative './test' class Vonage::HTTPOptionsTest < Minitest::Test Options = Vonage.const_get(:HTTP).const_get(:Options) def read_timeout 5 end def proxy_host 'example.com' end def proxy_port 4567 end def ca_file 'cert.pem' end def test_invalid_option_raise...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify_test.rb
Ruby
apache-2.0
220
main
7,574
# typed: false require_relative './test' class Vonage::VerifyTest < Vonage::Test def verify Vonage::Verify.new(config) end def authorization basic_authorization end def request_id '8g88g88eg8g8gg9g90' end def response { headers: response_headers, body: '{"status":"0"}' ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/secrets_test.rb
Ruby
apache-2.0
220
main
1,207
# typed: false require_relative './test' class Vonage::SecretsTest < Vonage::Test def secrets Vonage::Secrets.new(config) end def account_id api_key end def secret_id 'xx-xx-xx-xx' end def secrets_uri "https://api.nexmo.com/accounts/#{account_id}/secrets" end def secret_uri "h...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2_test.rb
Ruby
apache-2.0
220
main
8,135
# typed: false require_relative './test' class Vonage::Verify2Test < Vonage::Test def verify2 Vonage::Verify2.new(config) end def verify2_with_basic_auth config = Vonage::Config.new.merge( { api_key: api_key, api_secret: api_secret, authentication_preference: :basic }...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/network_authentication_test.rb
Ruby
apache-2.0
220
main
510
# typed: false require_relative './test' class Vonage::NetworkAuthenticationTest < Vonage::Test def network_authentication Vonage::NetworkAuthentication.new(config) end def test_client_authentication_method assert_kind_of Vonage::NetworkAuthentication::ClientAuthentication, network_authentication.client...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/response_test.rb
Ruby
apache-2.0
220
main
648
# typed: false require_relative './test' class Vonage::ResponseTest < Minitest::Test def value 'xxxx-xxxx' end def entity Vonage::Entity.new(id: value) end def test_http_response_method http_response = Net::HTTPOK.new('1.1', '200', 'OK') response = Vonage::Response.new(entity, http_respons...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/gsm7_test.rb
Ruby
apache-2.0
220
main
465
# typed: false require_relative './test' class Vonage::GSM7Test < Minitest::Test GSM7 = Vonage.const_get(:GSM7) def test_encoded_method assert GSM7.encoded?('Hello world') assert GSM7.encoded?('Bonjour monde') assert GSM7.encoded?('Hola mundo') refute GSM7.encoded?("Unicode \u2713") refute GS...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/config_test.rb
Ruby
apache-2.0
220
main
2,032
# typed: false require_relative './test' class Vonage::ConfigTest < Vonage::Test def test_api_key_method assert_equal config.api_key, api_key end def test_api_key_method_raises_authentication_error config = Vonage::Config.new exception = assert_raises(Vonage::AuthenticationError) { config.api_key }...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/tfa_test.rb
Ruby
apache-2.0
220
main
715
# typed: false require_relative './test' class Vonage::TFATest < Vonage::Test def tfa Vonage::TFA.new(config) end def uri 'https://rest.nexmo.com/sc/us/2fa/json' end def test_send_method params = {to: msisdn, pin: '12345'} stub_request(:post, uri).with(headers: headers, body: params.merge(...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/files_test.rb
Ruby
apache-2.0
220
main
1,481
# typed: false require_relative './test' class Vonage::FilesTest < Vonage::Test def files Vonage::Files.new(config) end def recording_uri 'https://api.nexmo.com/v1/files/' + recording_id end def recording_id 'xx-xx-xx-xx' end def recording_content 'BODY' end def response {body...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/users_test.rb
Ruby
apache-2.0
220
main
2,239
# typed: false require_relative './test' class Vonage::UsersTest < Vonage::Test def users Vonage::Users.new(config) end def users_uri 'https://api.nexmo.com/v1/users' end def user_uri 'https://api.nexmo.com/v1/users/' + user_id end def test_list_method stub_request(:get, users_uri).wit...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/numbers_test.rb
Ruby
apache-2.0
220
main
3,141
# typed: false require_relative "./test" class Vonage::NumbersTest < Vonage::Test def numbers Vonage::Numbers.new(config) end def test_list_method uri = "https://rest.nexmo.com/account/numbers" params = { size: 25, pattern: "33" } stub_request(:get, uri).with(query: params).to_return(numbers_r...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/number_insight_2_test.rb
Ruby
apache-2.0
220
main
1,550
# typed: false require_relative './test' class Vonage::NumberInsight2Test < Vonage::Test def number_insight_2 Vonage::NumberInsight2.new(config) end def uri 'https://api.nexmo.com/v2/ni' end def number '447700900000' end def test_fraud_check_method params = {type: 'phone', phone: numbe...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging_test.rb
Ruby
apache-2.0
220
main
11,424
# typed: false require_relative './test' class Vonage::MessagingTest < Vonage::Test def messaging Vonage::Messaging.new(config) end def messaging_with_basic_auth config = Vonage::Config.new.merge( { api_key: api_key, api_secret: api_secret, authentication_preference: :basic...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/signature_test.rb
Ruby
apache-2.0
220
main
3,813
# typed: false require_relative './test' class Vonage::SignatureTest < Vonage::Test def signature_secret 'my_secret_key_for_testing' end def signature Vonage::Signature.new(config) end def params { 'message-timestamp' => '2013-11-21 15:27:30', 'messageId' => '020000001B0FE827', ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/sms_test.rb
Ruby
apache-2.0
220
main
3,553
# typed: false require_relative './test' class Vonage::SMSTest < Vonage::Test def sms Vonage::SMS.new(config) end def sms_with_sig_auth config = Vonage::Config.new.merge( { api_key: api_key, signature_secret: signature_secret, authentication_preference: :signature } ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/client_test.rb
Ruby
apache-2.0
220
main
3,265
# typed: false require_relative './test' class Vonage::ClientTest < Vonage::Test def client Vonage::Client.new end def test_signature_method assert_kind_of Vonage::Signature, client.signature end def test_account_method assert_kind_of Vonage::Account, client.account end def test_alerts_met...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/pricing_test.rb
Ruby
apache-2.0
220
main
992
# typed: false require_relative './test' class Vonage::PricingTest < Vonage::Test def type 'sms' end def pricing Vonage::Pricing.new(config, type: type) end def test_get_method uri = 'https://rest.nexmo.com/account/get-pricing/outbound/sms' params = {country: country} stub_request(:ge...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/applications_test.rb
Ruby
apache-2.0
220
main
2,343
# typed: false require_relative './test' class Vonage::ApplicationsTest < Vonage::Test def applications Vonage::Applications.new(config) end def applications_uri 'https://api.nexmo.com/v2/applications' end def application_uri 'https://api.nexmo.com/v2/applications/' + application_id end de...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/network_number_verification_test.rb
Ruby
apache-2.0
220
main
4,710
# typed: false require_relative './test' class Vonage::NetworkNumberVerificationTest < Vonage::Test def network_number_verification Vonage::NetworkNumberVerification.new(config) end def uri 'https://api-eu.vonage.com/camara/number-verification/v031' end def phone_number '+447900000000' end ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/redact_test.rb
Ruby
apache-2.0
220
main
473
# typed: false require_relative './test' class Vonage::RedactTest < Vonage::Test def redact Vonage::Redact.new(config) end def authorization basic_authorization end def test_transaction_method uri = 'https://api.nexmo.com/v1/redact/transaction' params = {id: '00A0B0C0', product: 'sms'} ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/number_insight_test.rb
Ruby
apache-2.0
220
main
2,216
# typed: false require_relative './test' class Vonage::NumberInsightTest < Vonage::Test def number_insight Vonage::NumberInsight.new(config) end def authorization basic_authorization end def params {number: msisdn} end def response { headers: response_headers, body: '{"stat...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/subaccounts_test.rb
Ruby
apache-2.0
220
main
12,091
# typed: false require_relative './test' class Vonage::SubaccountsTest < Vonage::Test def subaccounts Vonage::Subaccounts.new(config) end def accounts_uri "https://api.nexmo.com/accounts/#{api_key}" end def subaccounts_uri "#{accounts_uri}/subaccounts" end def subaccount_api_key 'vonag...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/alerts_test.rb
Ruby
apache-2.0
220
main
1,312
# typed: false require_relative './test' class Vonage::AlertsTest < Vonage::Test def alerts Vonage::Alerts.new(config) end def test_list_method uri = 'https://rest.nexmo.com/sc/us/alert/opt-in/query/json' stub_request(:get, uri).with(query: api_key_and_secret).to_return(response) assert_kind_o...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/network_sim_swap_test.rb
Ruby
apache-2.0
220
main
4,420
# typed: false require_relative './test' class Vonage::NetworkSIMSwapTest < Vonage::Test def network_sim_swap Vonage::NetworkSIMSwap.new(config) end def uri 'https://api-eu.vonage.com/camara/sim-swap/v040' end def phone_number '+447900000000' end def test_check_method bc_authorize_requ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/proactive_connect_test.rb
Ruby
apache-2.0
220
main
699
# typed: false require_relative './test' class Vonage::ProactiveConnectTest < Vonage::Test def proactive_connect Vonage::ProactiveConnect.new(config) end def test_lists_method assert_kind_of Vonage::ProactiveConnect::Lists, proactive_connect.lists end def test_list_method assert_kind_of Vonage:...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/entity_test.rb
Ruby
apache-2.0
220
main
2,374
# typed: false require_relative './test' require 'json' class Vonage::EntityTest < Minitest::Test def test_mapping_keyword_args_to_attribute_names value = 'xxxx-xxxx' entity = Vonage::Entity.new(id: value) assert_equal entity[:id], value assert_equal entity.id, value end def test_mapping_strin...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/identity_insights_test.rb
Ruby
apache-2.0
220
main
3,692
# typed: false require_relative './test' class Vonage::IdentityInsightsTest < Vonage::Test def identity_insights Vonage::IdentityInsights.new(config) end def geospecific_identity_insights config = Vonage::Config.new.merge( { application_id: application_id, private_key: private_key,...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/hosts_test.rb
Ruby
apache-2.0
220
main
821
# typed: false require_relative './test' class Vonage::HostsTest < Vonage::Test def api_host 'api-sg-1.nexmo.com' end def rest_host 'rest-nexmo-com-xxx.curlhub.io' end def authorization basic_authorization end def test_custom_api_host secrets = Vonage::Secrets.new(config.merge(api_host...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/logger_test.rb
Ruby
apache-2.0
220
main
1,612
# typed: false require_relative './test' class Vonage::LoggerTest < Vonage::Test Logger = Vonage.const_get(:Logger) def setup super @io = StringIO.new end attr_reader :io def uri URI('https://api.nexmo.com/v1/calls') end def test_with_null_logger logger = Logger.new(::Logger.new(nil)...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/jwt_test.rb
Ruby
apache-2.0
220
main
3,950
# typed: false require_relative './test' class Vonage::JWTTest < Vonage::Test def private_key @private_key ||= File.read('test/private_key.txt') end def application_id @application_id ||= SecureRandom.uuid end def uuid_pattern /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice_test.rb
Ruby
apache-2.0
220
main
6,355
# typed: false require_relative './test' class Vonage::VoiceTest < Vonage::Test def calls Vonage::Voice.new(config) end def calls_uri 'https://api.nexmo.com/v1/calls' end def call_uri 'https://api.nexmo.com/v1/calls/' + call_uuid end def test_create_method params = { to: [{type: ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/video_test.rb
Ruby
apache-2.0
220
main
5,876
# typed: false require_relative './test' class Vonage::VideoTest < Vonage::Test def video Vonage::Video.new(config) end def video_uri 'https://video.api.vonage.com' end def decode_jwt_payload(token) JWT.decode(token, private_key, false, {algorithm: 'HS256'}).first end def create_session_re...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/conversions_test.rb
Ruby
apache-2.0
220
main
2,269
# typed: false require_relative './test' class Vonage::ConversionsTest < Vonage::Test def conversions Vonage::Conversions.new(config) end def conversions_with_sig_auth config = Vonage::Config.new.merge( { api_key: api_key, signature_secret: signature_secret, authentication_...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/conversations_test.rb
Ruby
apache-2.0
220
main
3,019
# typed: false require_relative './test' class Vonage::ConversationsTest < Vonage::Test def conversations Vonage::Conversations.new(config) end def conversations_uri 'https://api.nexmo.com/beta/conversations' end def conversation_uri 'https://api.nexmo.com/beta/conversations/' + conversation_id...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/conversation_test.rb
Ruby
apache-2.0
220
main
2,724
# typed: false require_relative './test' class Vonage::ConversationTest < Vonage::Test def conversation Vonage::Conversation.new(config) end def conversations_uri 'https://api.nexmo.com/v1/conversations' end def conversation_uri 'https://api.nexmo.com/v1/conversations/' + conversation_id end ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/pricing_types_test.rb
Ruby
apache-2.0
220
main
393
# typed: false require_relative './test' class Vonage::PricingTypesTest < Vonage::Test def pricing Vonage::PricingTypes.new(config) end def test_sms_method assert_kind_of Vonage::Pricing, pricing.sms assert_equal 'sms', pricing.sms.type end def test_voice_method assert_kind_of Vonage::Prici...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messages_test.rb
Ruby
apache-2.0
220
main
1,539
# typed: false require_relative './test' class Vonage::MessagesTest < Vonage::Test def messages Vonage::Messages.new(config) end def message_id '00A0B0C0' end def date 'YYYY-MM-DD' end def test_get_method uri = 'https://rest.nexmo.com/search/message' params = {id: message_id} ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/meetings_test.rb
Ruby
apache-2.0
220
main
758
# typed: false require_relative './test' class Vonage::MeetingsTest < Vonage::Test def meetings Vonage::Meetings.new(config) end def test_rooms_method assert_kind_of Vonage::Meetings::Rooms, meetings.rooms end def test_recordings_method assert_kind_of Vonage::Meetings::Recordings, meetings.reco...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/errors_test.rb
Ruby
apache-2.0
220
main
4,959
# typed: false require_relative './test' class Vonage::ErrorsTest < Minitest::Test Errors = Vonage.const_get(:Errors) def response(code) Net::HTTPResponse::CODE_TO_OBJ[code.to_s].new(nil, code.to_s, nil) end def json_response(code, body) response(code).tap do |response| response['Content-Type']...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/start_verification_options_test.rb
Ruby
apache-2.0
220
main
3,100
# typed: false class Vonage::Verify2::StartVerificationOptionsTest < Vonage::Test def options Vonage::Verify2::StartVerificationOptions.new end def test_locale_getter_method assert_nil options.locale end def test_locale_setter_method opts = options opts.locale = 'en-gb' assert_equal 'e...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/template_fragments_test.rb
Ruby
apache-2.0
220
main
7,037
# typed: false class Vonage::Verify2::TemplateFragmentsTest < Vonage::Test def template_fragments Vonage::Verify2::TemplateFragments.new(config) end def template_fragments_with_basic_auth config = Vonage::Config.new.merge( { api_key: api_key, api_secret: api_secret, authent...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/workflow_test.rb
Ruby
apache-2.0
220
main
1,938
# typed: false class Vonage::Verify2::WorkflowTest < Vonage::Test def workflow Vonage::Verify2::Workflow.new end def test_workflow_with_valid_channel channel = workflow.sms(to: e164_compliant_number) assert_instance_of Vonage::Verify2::Channels::SMS, channel assert_equal 'sms', channel.channel ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/workflow_builder_test.rb
Ruby
apache-2.0
220
main
1,308
# typed: false class Vonage::Verify2::WorkflowTest < Vonage::Test def workflow_bulder Vonage::Verify2::WorkflowBuilder.new end Vonage::Verify2::Workflow::CHANNELS.keys.each do |channel| define_method "test_add_#{channel}_channel_method" do assert_respond_to workflow_bulder, "add_#{channel}" en...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/templates_test.rb
Ruby
apache-2.0
220
main
4,248
# typed: false class Vonage::Verify2::TemplatesTest < Vonage::Test def templates Vonage::Verify2::Templates.new(config) end def templates_with_basic_auth config = Vonage::Config.new.merge( { api_key: api_key, api_secret: api_secret, authentication_preference: :basic }...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/silent_auth_test.rb
Ruby
apache-2.0
220
main
2,302
# typed: false class Vonage::Verify2::Channels::SilentAuthTest < Vonage::Test def silent_auth_channel Vonage::Verify2::Channels::SilentAuth.new(to: e164_compliant_number) end def test_channel_getter_method assert_equal 'silent_auth', silent_auth_channel.channel end def test_with_to_omitted asse...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/voice_test.rb
Ruby
apache-2.0
220
main
1,024
# typed: false class Vonage::Verify2::Channels::VoiceTest < Vonage::Test def voice_channel Vonage::Verify2::Channels::Voice.new(to: e164_compliant_number) end def test_channel_getter_method assert_equal 'voice', voice_channel.channel end def test_with_to_omitted assert_raises(ArgumentError) { V...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/whats_app_interactive_test.rb
Ruby
apache-2.0
220
main
1,170
# typed: false class Vonage::Verify2::Channels::WhatsAppInteractiveTest < Vonage::Test def whatsapp_interactive_channel Vonage::Verify2::Channels::WhatsAppInteractive.new(to: e164_compliant_number) end def test_channel_getter_method assert_equal 'whatsapp_interactive', whatsapp_interactive_channel.chann...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/sms_test.rb
Ruby
apache-2.0
220
main
3,855
# typed: false class Vonage::Verify2::Channels::SMSTest < Vonage::Test def sms_channel Vonage::Verify2::Channels::SMS.new(to: e164_compliant_number) end def valid_android_app_hash 'FA+9qCX9VSu' end def test_channel_getter_method assert_equal 'sms', sms_channel.channel end def test_with_to_...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/email_test.rb
Ruby
apache-2.0
220
main
1,196
# typed: false class Vonage::Verify2::Channels::EmailTest < Vonage::Test def email_channel Vonage::Verify2::Channels::Email.new(to: valid_email) end def valid_email 'alice@example.com' end def test_channel_getter_method assert_equal 'email', email_channel.channel end def test_with_to_omitt...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/verify2/channels/whats_app_test.rb
Ruby
apache-2.0
220
main
2,118
# typed: false class Vonage::Verify2::Channels::WhatsAppTest < Vonage::Test def whatsapp_channel Vonage::Verify2::Channels::WhatsApp.new(to: e164_compliant_number, from: e164_compliant_number) end def test_channel_getter_method assert_equal 'whatsapp', whatsapp_channel.channel end def test_with_to_...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/numbers/list_response_test.rb
Ruby
apache-2.0
220
main
461
# typed: false require_relative '../test' class Vonage::Numbers::ListResponseTest < Vonage::Test def test_each_method entity = Vonage::Entity.new({ msisdn: msisdn }) list_entity = Vonage::Entity.new({ numbers: [ entity ] }) response = Vonage::Numbers::ListResponse.new(...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/numbers/response_test.rb
Ruby
apache-2.0
220
main
395
# typed: false require_relative '../test' class Vonage::Numbers::ResponseTest < Minitest::Test def build_response(attributes) Vonage::Numbers::Response.new(Vonage::Entity.new(attributes)) end def test_success_method response = build_response(error_code: '200') assert response.success? response ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/message_test.rb
Ruby
apache-2.0
220
main
1,102
# typed: false class Vonage::Messaging::MessageTest < Vonage::Test def message_class Vonage::Messaging::Message end def test_message_with_valid_channel channel_obj_data = message_class.sms(message: "Hello world!") expected_data = {:channel=>"sms", :message_type=>"text", :text=>"Hello world!"} a...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/rcs_test.rb
Ruby
apache-2.0
220
main
12,899
# typed: false class Vonage::Messaging::Channels::RCSTest < Vonage::Test def test_rcs_initialize message = Vonage::Messaging::Channels::RCS.new(type: 'text', message: 'Hello world!') assert_kind_of Vonage::Messaging::Channels::RCS, message end def test_rcs_text_message expected = { channel: ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/viber_test.rb
Ruby
apache-2.0
220
main
4,860
# typed: false class Vonage::Messaging::Channels::ViberTest < Vonage::Test def test_viber_initialize viber = Vonage::Messaging::Channels::Viber.new(type: 'text', message: 'Hello world!') assert_kind_of Vonage::Messaging::Channels::Viber, viber assert_equal viber.data, { channel: 'viber_service', messag...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/messenger_test.rb
Ruby
apache-2.0
220
main
4,419
# typed: false class Vonage::Messaging::Channels::MessengerTest < Vonage::Test def test_messenger_initialize messenger = Vonage::Messaging::Channels::Messenger.new(type: 'text', message: 'Hello world!') assert_kind_of Vonage::Messaging::Channels::Messenger, messenger assert_equal messenger.data, { chan...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/sms_test.rb
Ruby
apache-2.0
220
main
2,340
# typed: false class Vonage::Messaging::Channels::SMSTest < Vonage::Test def test_sms_initialize sms = Vonage::Messaging::Channels::SMS.new(message: 'Hello world!') assert_kind_of Vonage::Messaging::Channels::SMS, sms assert_equal sms.data, { channel: 'sms', message_type: 'text', text: 'Hello world!' }...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/whats_app_test.rb
Ruby
apache-2.0
220
main
6,701
# typed: false class Vonage::Messaging::Channels::WhatsAppTest < Vonage::Test def test_whats_app_initialize whatsapp = Vonage::Messaging::Channels::WhatsApp.new(type: 'text', message: 'Hello world!') assert_kind_of Vonage::Messaging::Channels::WhatsApp, whatsapp assert_equal whatsapp.data, { channel: '...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/messaging/channels/mms_test.rb
Ruby
apache-2.0
220
main
4,846
# typed: false class Vonage::Messaging::Channels::MMSTest < Vonage::Test def test_mms_initialize mms = Vonage::Messaging::Channels::MMS.new(type: 'image', message: { url: 'https://example.com/image.jpg' }) assert_kind_of Vonage::Messaging::Channels::MMS, mms assert_equal mms.data, { channel: 'mms', mes...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/applications/list_response_test.rb
Ruby
apache-2.0
220
main
533
# typed: false require_relative '../test' class Vonage::Applications::ListResponseTest < Vonage::Test def test_each_method entity = Vonage::Entity.new({ id: application_id }) list_entity = Vonage::Entity.new({ _embedded: Vonage::Entity.new({ applications: [ entity ]...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/dtmf_test.rb
Ruby
apache-2.0
220
main
428
# typed: false require_relative '../test' class Vonage::Voice::DTMFTest < Vonage::Test def dtmf Vonage::Voice::DTMF.new(config) end def uri 'https://api.nexmo.com/v1/calls/' + call_uuid + '/dtmf' end def test_send_method params = { digits: '1234' } stub_request(:put, uri).with(request(body...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/stream_test.rb
Ruby
apache-2.0
220
main
623
# typed: false require_relative '../test' class Vonage::Voice::StreamTest < Vonage::Test def stream Vonage::Voice::Stream.new(config) end def uri 'https://api.nexmo.com/v1/calls/' + call_uuid + '/stream' end def test_start_method params = {stream_url: 'https://example.com/audio.mp3'} stub_...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/ncco_test.rb
Ruby
apache-2.0
220
main
2,152
# typed: false class Vonage::Voice::NccoTest < Vonage::Test def ncco Vonage::Voice::Ncco end def test_ncco_with_valid_action action = ncco.connect(endpoint: { type: 'phone', number: '12129999999' }) assert_equal action, [{:action=>"connect", :endpoint=>[{:type=>"phone", :number=>"12129999999"}]}] ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/talk_test.rb
Ruby
apache-2.0
220
main
581
# typed: false require_relative '../test' class Vonage::Voice::TalkTest < Vonage::Test def talk Vonage::Voice::Talk.new(config) end def uri 'https://api.nexmo.com/v1/calls/' + call_uuid + '/talk' end def test_start_method params = {text: 'Hello'} stub_request(:put, uri).with(request(body: ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/list_response_test.rb
Ruby
apache-2.0
220
main
505
# typed: false require_relative '../test' class Vonage::Voice::ListResponseTest < Vonage::Test def test_each_method entity = Vonage::Entity.new({ id: call_id }) list_entity = Vonage::Entity.new({ _embedded: Vonage::Entity.new({ calls: [ entity ] }) }) ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/actions/connect_test.rb
Ruby
apache-2.0
220
main
11,057
# typed: false class Vonage::Voice::Actions::ConnectTest < Vonage::Test def test_connect_initialize connect = Vonage::Voice::Actions::Connect.new(endpoint: { type: 'app', user: 'joe' }) assert_kind_of Vonage::Voice::Actions::Connect, connect assert_equal connect.endpoint, { type: 'app', user: 'joe' } ...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/actions/talk_test.rb
Ruby
apache-2.0
220
main
2,191
# typed: false class Vonage::Voice::Actions::TalkTest < Vonage::Test def test_talk_initialize talk = Vonage::Voice::Actions::Talk.new(text: 'Sample Text') assert_kind_of Vonage::Voice::Actions::Talk, talk assert_equal talk.text, 'Sample Text' end def test_create_talk expected = [{ action: 'tal...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/actions/notify_test.rb
Ruby
apache-2.0
220
main
2,178
# typed: false class Vonage::Voice::Actions::NotifyTest < Vonage::Test def test_notify_initialize notify = Vonage::Voice::Actions::Notify.new(payload: { foo: 'bar' }, eventUrl: [ 'https://example.com' ]) assert_kind_of Vonage::Voice::Actions::Notify, notify assert_equal notify.eventUrl, ['https://examp...
github
Vonage/vonage-ruby-sdk
https://github.com/Vonage/vonage-ruby-sdk
test/vonage/voice/actions/record_test.rb
Ruby
apache-2.0
220
main
6,836
# typed: false class Vonage::Voice::Actions::RecordTest < Vonage::Test def test_record_initialize record = Vonage::Voice::Actions::Record.new assert_kind_of Vonage::Voice::Actions::Record, record end def test_create_record expected = [{ action: 'record' }] record = Vonage::Voice::Actions::Reco...