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
sxross/MotionModel
https://github.com/sxross/MotionModel
motion/adapters/array_model_adapter.rb
Ruby
mit
189
master
4,182
module MotionModel module ArrayModelAdapter def adapter 'Array Model Adapter' end def self.included(base) base.extend(PrivateClassMethods) base.extend(PublicClassMethods) base.instance_eval do _reset_next_id end end module PublicClassMethods def colle...
github
sxross/MotionModel
https://github.com/sxross/MotionModel
motion/adapters/array_model_persistence.rb
Ruby
mit
189
master
5,047
module MotionModel module ArrayModelAdapter class PersistFileError < Exception; end class VersionNumberError < ArgumentError; end module PublicClassMethods def validate_schema_version(version_number) raise MotionModel::ArrayModelAdapter::VersionNumberError.new('version number must be a str...
github
tomohiro/fluentular
https://github.com/tomohiro/fluentular
Gemfile
Ruby
mit
189
main
414
# frozen_string_literal: true source 'https://rubygems.org' ruby '3.2.1' gem 'fluentd' gem 'haml' gem 'puma' gem 'sinatra' gem 'sinatra-contrib' group :development, :test do # Testing tools gem 'rack-test' gem 'rspec' gem 'simplecov', require: false gem 'simplecov-lcov', require: false # Lint/Analyse/De...
github
tomohiro/fluentular
https://github.com/tomohiro/fluentular
app.rb
Ruby
mit
189
main
8,032
# frozen_string_literal: true require 'sinatra' require 'sinatra/reloader' if development? require 'fluent/env' require 'fluent/version' require 'fluent/engine' require 'fluent/plugin/parser_regexp' YJIT_STATUS = ENV.fetch('RUBYOPT', nil)&.match('--yjit') ? '+YJIT' : '' module Fluentular VERSION = ::Fluent::VERSI...
github
tomohiro/fluentular
https://github.com/tomohiro/fluentular
spec/fluentular_spec.rb
Ruby
mit
189
main
2,855
# frozen_string_literal: true require 'simplecov' require 'simplecov-lcov' SimpleCov::Formatter::LcovFormatter.config do |c| c.report_with_single_file = true c.single_report_path = 'coverage/lcov.info' end SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter SimpleCov.start Warning[:deprecated] = true ENV['R...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
redis-sentinel.gemspec
Ruby
mit
188
master
1,521
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'redis-sentinel/version' Gem::Specification.new do |gem| gem.name = "redis-sentinel" gem.version = Redis::Sentinel::VERSION gem.authors = ["Richard Huang"] g...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
Rakefile
Ruby
mit
188
master
512
#!/usr/bin/env rake require "bundler/gem_tasks" require "rake" require "rdoc/task" require "rspec" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = "spec/redis-sentinel/client_spec.rb" end RSpec::Core::RakeTask.new('spec:progress') do |spec| spec.rspec_opts = %w(--format ...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
example/test_wait_for_failover.rb
Ruby
mit
188
master
469
require 'redis' require 'redis-sentinel' redis = Redis.new(:master_name => "example-test", :sentinels => [ {:host => "localhost", :port => 26379}, {:host => "localhost", :port => 26380} ], :failover_reconnect_timeout => 30) r...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
example/test_wait_for_failover_write.rb
Ruby
mit
188
master
547
require 'redis' require 'redis-sentinel' redis = Redis.new(:master_name => "example-test", :sentinels => [ {:host => "localhost", :port => 26379}, {:host => "localhost", :port => 26380} ], :failover_reconnect_timeout => 30, ...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
example/test.rb
Ruby
mit
188
master
390
require 'redis' require 'redis-sentinel' redis = Redis.new(:master_name => "example-test", :sentinels => [ {:host => "localhost", :port => 26379}, {:host => "localhost", :port => 26380} ]) redis.set "foo", "bar" while true begin puts re...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
spec/spec_helper.rb
Ruby
mit
188
master
285
require "rspec" require 'coveralls' Coveralls.wear! $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) require "redis" require "redis-sentinel" RSpec.configure do |config| config.filter_run :focus => true config.run_all_when_everything_filtered = true end
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
spec/redis-sentinel/client_spec.rb
Ruby
mit
188
master
8,158
require "spec_helper" describe Redis::Client do let(:client) { double("Client", :reconnect => true) } let(:current_sentinel) { double("Redis", :client => client) } let(:sentinels) do [ { :host => "localhost", :port => 26379 }, 'sentinel://localhost:26380', { :url => 'sentinel://localhost:...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
spec/redis-sentinel/em_client_spec.rb
Ruby
mit
188
master
1,346
require "spec_helper" require "em-synchrony/redis-sentinel" require "eventmachine" describe Redis::Client do context "#auto_retry_with_timeout" do subject { described_class.new(:failover_reconnect_timeout => 3, :failover_reconnect_wait => 0.1, :...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
lib/redis-sentinel/client.rb
Ruby
mit
188
master
7,192
require "redis" class Redis::Client DEFAULT_FAILOVER_RECONNECT_WAIT_SECONDS = 0.1 class_eval do attr_reader :current_sentinel def initialize_with_sentinel(options={}) options = options.dup # Don't touch my options @master_name = fetch_option(options, :master_name) @master_password = fet...
github
flyerhzm/redis-sentinel
https://github.com/flyerhzm/redis-sentinel
lib/em-synchrony/redis-sentinel.rb
Ruby
mit
188
master
281
require 'redis/connection/synchrony' unless defined? Redis::Connection::Synchrony require 'redis-sentinel' class Redis::Client class_eval do private def sleep(seconds) f = Fiber.current EM::Timer.new(seconds) { f.resume } Fiber.yield end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
Gemfile
Ruby
mit
188
main
374
# frozen_string_literal: true source "https://rubygems.org" gemspec gem "base64", "~> 0.3.0" gem "bigdecimal", "~> 4.0" gem "coveralls", "~> 0.8", require: false gem "csv", "~> 3.2" gem "rubocop", "~> 1.75", require: false gem "rubocop-minitest", "~> 0.36", require: false gem "rubocop-performance", "~> 1.25", requir...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
dnsimple.gemspec
Ruby
mit
188
main
925
# -*- encoding: utf-8 -*- $:.push File.expand_path('../lib', __FILE__) require 'dnsimple/version' Gem::Specification.new do |s| s.name = 'dnsimple' s.version = Dnsimple::VERSION s.authors = ['DNSimple'] s.email = ['support@dnsimple.com'] s.homepage = 'https://github.com/dnsimple/dnsim...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
Rakefile
Ruby
mit
188
main
652
require 'bundler/gem_tasks' # By default, run tests and linter. task default: [:test, :rubocop] require 'rake/testtask' Rake::TestTask.new do |t| t.libs << "test" t.test_files = FileList["test/**/*_test.rb"] t.verbose = !ENV["VERBOSE"].nil? end require 'rubocop/rake_task' RuboCop::RakeTask.new require 'y...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/test_helper.rb
Ruby
mit
188
main
697
# frozen_string_literal: true require "minitest/autorun" require "minitest/mock" require "webmock/minitest" if ENV["COVERALL"] require "coveralls" Coveralls.wear! end $:.unshift("#{File.dirname(__FILE__)}/lib") require "dnsimple" unless defined?(TEST_ROOT) TEST_ROOT = File.expand_path(__dir__) end WebMock.di...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/extra_test.rb
Ruby
mit
188
main
1,446
# frozen_string_literal: true require "test_helper" class ExtraTest < Minitest::Test test "join uri joins two or more strings" do assert_equal "foo", Dnsimple::Extra.join_uri("foo") assert_equal "foo/bar", Dnsimple::Extra.join_uri("foo", "bar") assert_equal "foo/bar/baz", Dnsimple::Extra.join_uri("foo",...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client_test.rb
Ruby
mit
188
main
7,450
# frozen_string_literal: true require "test_helper" class ClientTest < Minitest::Test test "initialization accepts base url option" do subject = Dnsimple::Client.new(base_url: "https://api.example.com/") assert_equal "https://api.example.com/", subject.base_url end test "initialization accepts access ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/options/base_test.rb
Ruby
mit
188
main
498
# frozen_string_literal: true require "test_helper" class OptionsBaseTest < Minitest::Test test "initialize accepts a hash" do hash = { a: 1 } assert_equal hash, Dnsimple::Options::Base.new(hash).to_h end test "initialize accepts nil" do assert_empty(Dnsimple::Options::Base.new(nil).to_h) end ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/options/list_options_test.rb
Ruby
mit
188
main
2,853
# frozen_string_literal: true require "test_helper" class ListOptionsTest < Minitest::Test test "to h returns empty hash if given options equal to nil" do options = Dnsimple::Options::ListOptions.new(nil) assert_empty(options.to_h) end test "to h returns empty hash if given options are empty" do o...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/zones_distributions_test.rb
Ruby
mit
188
main
4,970
# frozen_string_literal: true require "test_helper" class ZonesDistributionsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").zones @account_id = 1010 @zone_id = "example.com" @record_id = 5 end test "zone distribution...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/zones_records_test.rb
Ruby
mit
188
main
17,016
# frozen_string_literal: true require "test_helper" class ZonesRecordsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").zones @account_id = 1010 @zone_id = "example.com" end test "list zone records builds correct request" ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/registrar_delegation_test.rb
Ruby
mit
188
main
4,718
# frozen_string_literal: true require "test_helper" class RegistrarDelegationTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").registrar @account_id = 1010 end test "domain delegation builds correct request" do stub_reque...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/vanity_name_servers_test.rb
Ruby
mit
188
main
2,122
# frozen_string_literal: true require "test_helper" class VanityNameServersTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").vanity_name_servers @account_id = 1010 end test "enable vanity name servers builds correct request" d...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/templates_test.rb
Ruby
mit
188
main
8,199
# frozen_string_literal: true require "test_helper" class TemplatesTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").templates @account_id = 1010 end test "list templates builds correct request" do stub_request(:get, %r{/v...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_dnssec_test.rb
Ruby
mit
188
main
3,595
# frozen_string_literal: true require "test_helper" class DomainsDnssecTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 @domain_id = "example.com" end test "enable dnssec builds correct request"...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_test.rb
Ruby
mit
188
main
7,456
# frozen_string_literal: true require "test_helper" class DomainsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 end test "domains builds correct request" do stub_request(:get, %r{/v2/#{@accou...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_research_test.rb
Ruby
mit
188
main
1,534
# frozen_string_literal: true require "test_helper" class DomainsResearchTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 end test "domain_research_status builds the correct request" do stub_req...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/webhooks_test.rb
Ruby
mit
188
main
4,834
# frozen_string_literal: true require "test_helper" class WebhooksTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").webhooks @account_id = 1010 end test "webhooks builds correct request" do stub_request(:get, %r{/v2/#{@acc...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/templates_records_test.rb
Ruby
mit
188
main
9,244
# frozen_string_literal: true require "test_helper" class TemplatesRecordsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").templates @account_id = 1010 @template_id = "alpha" end test "list records builds correct request"...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/identity_test.rb
Ruby
mit
188
main
1,438
# frozen_string_literal: true require "test_helper" class IdentityTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").identity end test "whoami builds correct request" do stub_request(:get, %r{/v2/whoami$}) .to_return(re...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/zones_test.rb
Ruby
mit
188
main
9,352
# frozen_string_literal: true require "test_helper" class ZonesTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").zones @account_id = 1010 end test "zones builds correct request" do stub_request(:get, %r{/v2/#{@account_id}/...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_delegation_signer_records_test.rb
Ruby
mit
188
main
8,887
# frozen_string_literal: true require "test_helper" class DomainsDelegationSignerRecordsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 @domain_id = "example.com" end test "delegation signer re...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/client_service_test.rb
Ruby
mit
188
main
1,236
# frozen_string_literal: true require "test_helper" class ClientServiceTest < Minitest::Test test "loops all the pages" do account_id = 1010 item_class = Class.new(Dnsimple::Struct::Base) do attr_accessor :id end service_class = Class.new(Dnsimple::Client::ClientService) do define_metho...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/registrar_auto_renewal_test.rb
Ruby
mit
188
main
2,601
# frozen_string_literal: true require "test_helper" class RegistrarAutoRenewalTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").registrar @account_id = 1010 @domain_id = "example.com" end test "enable auto renewal builds ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/registrar_transfer_lock_test.rb
Ruby
mit
188
main
4,175
# frozen_string_literal: true require "test_helper" class RegistrarTransferLockTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").registrar @account_id = 1010 @domain_id = "example.com" end test "get domain transfer lock b...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/oauth_test.rb
Ruby
mit
188
main
3,211
# frozen_string_literal: true require "test_helper" class OauthTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test").oauth @client_id = "super-client" @client_secret = "super-secret" @code = "super-code" @state = "super-state" end test "excha...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/dns_analytics_test.rb
Ruby
mit
188
main
3,406
# frozen_string_literal: true require "test_helper" class DnsAnalyticsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").dns_analytics end test "query builds correct request" do stub_request(:get, %r{/v2/1/dns_analytics}) ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/accounts_test.rb
Ruby
mit
188
main
1,192
# frozen_string_literal: true require "test_helper" class AccountsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").accounts end test "builds the correct request" do stub_request(:get, %r{/v2/accounts$}) .to_return(rea...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/registrar_whois_privacy_test.rb
Ruby
mit
188
main
3,567
# frozen_string_literal: true require "test_helper" class RegistrarWhoisPrivacyTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").registrar @account_id = 1010 end test "enable whois privacy when already purchased builds correc...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/certificates_test.rb
Ruby
mit
188
main
26,936
# frozen_string_literal: true require "test_helper" class CertificatesTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").certificates @account_id = 1010 end test "certificates builds the correct request" do domain_id = "ex...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/templates_domains_test.rb
Ruby
mit
188
main
1,157
# frozen_string_literal: true require "test_helper" class TemplatesDomainsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").templates @account_id = 1010 @template_id = 5410 @domain_id = "example.com" end test "apply te...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_pushes_test.rb
Ruby
mit
188
main
6,212
# frozen_string_literal: true require "test_helper" class DomainsPushesTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 @domain_id = "example.com" end test "initiate push builds correct request"...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/contacts_test.rb
Ruby
mit
188
main
8,050
# frozen_string_literal: true require "test_helper" class ContactsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").contacts @account_id = 1010 end test "builds the correct request" do stub_request(:get, %r{/v2/#{@account_...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/domains_email_forwards_test.rb
Ruby
mit
188
main
8,381
# frozen_string_literal: true require "test_helper" class DomainsEmailForwardsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains @account_id = 1010 @domain_id = "example.com" end test "email forwards builds correct ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/services_test.rb
Ruby
mit
188
main
3,921
# frozen_string_literal: true require "test_helper" class ServicesTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").services end test "list services builds correct request" do stub_request(:get, %r{/v2/services}) .to_r...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/registrar_test.rb
Ruby
mit
188
main
24,831
# frozen_string_literal: true require "test_helper" class RegistrarTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").registrar @account_id = 1010 end test "check domain builds correct request" do stub_request(:get, %r{/v2...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/tlds_test.rb
Ruby
mit
188
main
5,755
# frozen_string_literal: true require "test_helper" class TldsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").tlds end test "list tlds builds correct request" do stub_request(:get, %r{/v2/tlds}) .to_return(read_http_...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/services_domains_test.rb
Ruby
mit
188
main
4,564
# frozen_string_literal: true require "test_helper" class ServicesDomainsTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").services @account_id = 1010 @domain_id = "example.com" @service_id = "service1" end test "appli...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
test/dnsimple/client/billing_test.rb
Ruby
mit
188
main
4,404
# frozen_string_literal: true require "test_helper" require "bigdecimal/util" class BillingTest < Minitest::Test def setup @subject = Dnsimple::Client.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").billing @account_id = 1010 end test "builds the correct request" do stub_request...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple.rb
Ruby
mit
188
main
535
# frozen_string_literal: true module Dnsimple # Echoes a deprecation warning message. # # @param message [String] The message to display. # @return [void] # # @api internal # @private def self.deprecate(message = nil) message ||= "You are using deprecated behavior which will be removed from the ne...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/response.rb
Ruby
mit
188
main
2,923
# frozen_string_literal: true module Dnsimple # The Response represents a response returned by a client request. # # It wraps the content of the response data, as well other response metadata such as rate-limiting information. class Response # @return [HTTParty::Response] attr_reader :http_response ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/options.rb
Ruby
mit
188
main
1,224
# frozen_string_literal: true module Dnsimple module Options class Base def initialize(options) @options = (options || {}).dup end def to_h @options end end class ListOptions < Base def initialize(options) super _prepare_query _prepa...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct.rb
Ruby
mit
188
main
1,943
# frozen_string_literal: true module Dnsimple module Struct class Base def initialize(attributes = {}) attributes.each do |key, value| m = :"#{key}=" send(m, value) if respond_to?(m) end end end end end require_relative "struct/account" require_relative "str...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/default.rb
Ruby
mit
188
main
1,848
# frozen_string_literal: true module Dnsimple # Default configuration options for {Client} module Default # Default API endpoint BASE_URL = "https://api.dnsimple.com/" # Default User Agent header USER_AGENT = "dnsimple-ruby/#{VERSION}".freeze class << self # List of configurable keys fo...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/client.rb
Ruby
mit
188
main
8,011
# frozen_string_literal: true require "httparty" require "dnsimple/extra" require "dnsimple/struct" require "dnsimple/response" require "dnsimple/client/clients" module Dnsimple # Client for the DNSimple API # # @see https://developer.dnsimple.com/ # @see https://developer.dnsimple.com/sandbox/ # @see #base...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/error.rb
Ruby
mit
188
main
1,680
# frozen_string_literal: true module Dnsimple class Error < StandardError end # RequestError is raised when an API request fails for an client, a server error or invalid request information. class RequestError < Error attr_reader :http_response attr_reader :attribute_errors def initialize(http_re...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/extra.rb
Ruby
mit
188
main
1,863
# frozen_string_literal: true module Dnsimple module Extra # Joins two pieces of URI with a /. # # @return [String] The joined string. def self.join_uri(*parts) parts.map { |part| part.chomp("/") }.join("/") end # Returns a new hash with +self+ and +other+ merged recursively. # ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/transfer_lock.rb
Ruby
mit
188
main
230
# frozen_string_literal: true module Dnsimple module Struct class TransferLock < Base # @return [Boolean] True if Transfer Lock is enabled on the domain, otherwise false attr_accessor :enabled end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/account.rb
Ruby
mit
188
main
446
# frozen_string_literal: true module Dnsimple module Struct class Account < Base # @return [Integer] The account ID in DNSimple. attr_accessor :id # @return [String] The account email. attr_accessor :email # @return [String] The account name. attr_accessor :name # @re...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/certificate_purchase.rb
Ruby
mit
188
main
715
# frozen_string_literal: true module Dnsimple module Struct class CertificatePurchase < Base # @return [Integer] The certificate purchase ID in DNSimple. attr_accessor :id # @return [Integer] The certificate ID. attr_accessor :certificate_id # @return [String] The certificate rene...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain.rb
Ruby
mit
188
main
1,276
# frozen_string_literal: true module Dnsimple module Struct class Domain < Base # @return [Integer] The domain ID in DNSimple. attr_accessor :id # @return [Integer] The associated account ID. attr_accessor :account_id # @return [Integer] The associated registrant (contact) ID. ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_price.rb
Ruby
mit
188
main
618
# frozen_string_literal: true module Dnsimple module Struct class DomainPrice < Base # @return [String] The domain name attr_accessor :domain # @return [Boolean] Whether the domain is premium. attr_accessor :premium # @return [Float] The price for registration attr_accessor ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/zone_record.rb
Ruby
mit
188
main
1,321
# frozen_string_literal: true module Dnsimple module Struct class ZoneRecord < Base # @return [Integer] The record ID in DNSimple. attr_accessor :id # @return [String] The associated zone ID. attr_accessor :zone_id # @return [Integer] The ID of the parent record, if this record is...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_restore.rb
Ruby
mit
188
main
579
# frozen_string_literal: true module Dnsimple module Struct class DomainRestore < Base # @return [Integer] The domain restore ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [String] The state of the restore. ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/zone.rb
Ruby
mit
188
main
1,018
# frozen_string_literal: true module Dnsimple module Struct class Zone < Base # @return [Integer] The zone ID in DNSimple. attr_accessor :id # @return [Integer] The associated account ID. attr_accessor :account_id # @return [String] The zone name. attr_accessor :name ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/charge.rb
Ruby
mit
188
main
2,251
# frozen_string_literal: true require "bigdecimal" module Dnsimple module Struct class Charge < Base class ChargeItem < Base # @return [String] The description of the charge item. attr_accessor :description # @return [Float] The amount of the charge item. attr_reader :amou...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_registration.rb
Ruby
mit
188
main
1,116
# frozen_string_literal: true module Dnsimple module Struct class DomainRegistration < Base # @return [Integer] The domain registration ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Integer] The associated regis...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/tld.rb
Ruby
mit
188
main
1,396
# frozen_string_literal: true module Dnsimple module Struct class Tld < Base # @return [String] The TLD in DNSimple. attr_accessor :tld # @return [Integer] The TLD type. attr_accessor :tld_type # @return [Boolean] True if Whois Privacy Protection is available. attr_accessor ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_research_status.rb
Ruby
mit
188
main
597
# frozen_string_literal: true module Dnsimple module Struct class DomainResearchStatus < Base # @return [String] UUID identifier for this research request. attr_accessor :request_id # @return [String] The domain name that was researched. attr_accessor :domain # @return [String] Th...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_premium_price.rb
Ruby
mit
188
main
298
# frozen_string_literal: true module Dnsimple module Struct class DomainPremiumPrice < Base # @return [String] The domain premium price attr_accessor :premium_price # @return [String] The action: registration/transfer/renewal attr_accessor :action end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/zone_records_batch_change.rb
Ruby
mit
188
main
320
# frozen_string_literal: true module Dnsimple module Struct class ZoneRecordsBatchChange < Base # @return [Array<ZoneRecord>] attr_accessor :creates # @return [Array<ZoneRecord>] attr_accessor :updates # @return [Array<ZoneRecordId>] attr_accessor :deletes end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/extended_attribute.rb
Ruby
mit
188
main
917
# frozen_string_literal: true module Dnsimple module Struct class ExtendedAttribute < Base class Option < Base # The option name attr_accessor :title # The option value attr_accessor :value # A long description of the option attr_accessor :description ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/email_forward.rb
Ruby
mit
188
main
811
# frozen_string_literal: true module Dnsimple module Struct class EmailForward < Base # @return [Integer] The email forward ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [String] The receiving email recipient. ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/registrant_change.rb
Ruby
mit
188
main
1,122
# frozen_string_literal: true module Dnsimple module Struct class RegistrantChange < Base # @return [Integer] The registrant change ID in DNSimple. attr_accessor :id # @return [Integer] The associated account ID. attr_accessor :account_id # @return [Integer] The associated contact...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/contact.rb
Ruby
mit
188
main
1,697
# frozen_string_literal: true module Dnsimple module Struct class Contact < Base # @return [Integer] The contact ID in DNSimple. attr_accessor :id # @return [Integer] The associated account ID. attr_accessor :account_id # @return [String] The label to represent the contact. ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/delegation_signer_record.rb
Ruby
mit
188
main
1,000
# frozen_string_literal: true module Dnsimple module Struct class DelegationSignerRecord < Base # @return [Integer] The ID of the delegation signer record in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [String] The s...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/vanity_name_server.rb
Ruby
mit
188
main
674
# frozen_string_literal: true module Dnsimple module Struct class VanityNameServer < Base # @return [Integer] The vanity name server ID in DNSimple. attr_accessor :id # @return [String] The vanity name server name. attr_accessor :name # @return [String] The vanity name server IPv4...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/user.rb
Ruby
mit
188
main
247
# frozen_string_literal: true module Dnsimple module Struct class User < Base # @return [Integer] The user ID in DNSimple. attr_accessor :id # @return [String] The user email. attr_accessor :email end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_check.rb
Ruby
mit
188
main
385
# frozen_string_literal: true module Dnsimple module Struct class DomainCheck < Base # @return [String] The domain name that was checked. attr_accessor :domain # @return [Boolean] Whether the domain name is available. attr_accessor :available # @return [Boolean] Whether the domain...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/registrant_change_check.rb
Ruby
mit
188
main
516
# frozen_string_literal: true module Dnsimple module Struct class RegistrantChangeCheck < Base # @return [Integer] The associated contact ID. attr_accessor :contact_id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Array<Hash>] The extended attri...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/certificate.rb
Ruby
mit
188
main
1,272
# frozen_string_literal: true module Dnsimple module Struct class Certificate < Base # @return [Integer] The certificate ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [String] The certificate common name. a...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/service.rb
Ruby
mit
188
main
1,648
# frozen_string_literal: true module Dnsimple module Struct class Service < Base class Setting < Base # @return [String] The setting name. attr_accessor :name # @return [String] The setting label. attr_accessor :label # @return [String] A suffix to be appended to t...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_transfer.rb
Ruby
mit
188
main
1,107
# frozen_string_literal: true module Dnsimple module Struct class DomainTransfer < Base # @return [Integer] The domain registration ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Integer] The associated registran...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/certificate_renewal.rb
Ruby
mit
188
main
812
# frozen_string_literal: true module Dnsimple module Struct class CertificateRenewal < Base # @return [Integer] The certificate renewal ID in DNSimple. attr_accessor :id # @return [Integer] The old certificate ID. attr_accessor :old_certificate_id # @return [Integer] The new certi...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/certificate_bundle.rb
Ruby
mit
188
main
557
# frozen_string_literal: true module Dnsimple module Struct class CertificateBundle < Base # @return [String] The certificate private key attr_accessor :private_key # @return [String] The server certificate attr_accessor :server alias server_certificate server # @return [St...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/collaborator.rb
Ruby
mit
188
main
980
# frozen_string_literal: true module Dnsimple module Struct class Collaborator < Base # @return [Integer] The collaborator ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [String] The associated domain name. ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/dnssec.rb
Ruby
mit
188
main
217
# frozen_string_literal: true module Dnsimple module Struct class Dnssec < Base # @return [Boolean] True if DNSSEC is enabled on the domain, otherwise false attr_accessor :enabled end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/whois_privacy.rb
Ruby
mit
188
main
621
# frozen_string_literal: true module Dnsimple module Struct class WhoisPrivacy < Base # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Boolean] Whether the whois privacy is enabled for the domain. attr_accessor :enabled # @return [String] The date ...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/webhook.rb
Ruby
mit
188
main
253
# frozen_string_literal: true module Dnsimple module Struct class Webhook < Base # @return [Integer] The contact ID in DNSimple. attr_accessor :id # @return [String] The callback URL. attr_accessor :url end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/oauth_token.rb
Ruby
mit
188
main
479
# frozen_string_literal: true module Dnsimple module Struct class OauthToken < Base # @return [String] The token you can use to authenticate. attr_accessor :access_token # @return [String] The token type. attr_accessor :token_type # @return [String] The token scope (not used for n...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/template_record.rb
Ruby
mit
188
main
1,014
# frozen_string_literal: true module Dnsimple module Struct class TemplateRecord < Base # @return [Integer] The template record ID in DNSimple. attr_accessor :id # @return [Integer] The template ID in DNSimple. attr_accessor :template_id # @return [String] The type of template rec...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/zone_distribution.rb
Ruby
mit
188
main
265
# frozen_string_literal: true module Dnsimple module Struct class ZoneDistribution < Base # @return [Boolean] true if the zone is properly distributed across # all DNSimple name servers. attr_accessor :distributed end end end
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_push.rb
Ruby
mit
188
main
766
# frozen_string_literal: true module Dnsimple module Struct class DomainPush < Base # @return [Integer] The domain push ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Integer] The associated contact ID. att...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/template.rb
Ruby
mit
188
main
511
# frozen_string_literal: true module Dnsimple module Struct class Template < Base # @return [Integer] The template ID in DNSimple. attr_accessor :id # @return [Integer] The associated account ID. attr_accessor :account_id # @return [String] The template name. attr_accessor :...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/domain_renewal.rb
Ruby
mit
188
main
682
# frozen_string_literal: true module Dnsimple module Struct class DomainRenewal < Base # @return [Integer] The domain renewal ID in DNSimple. attr_accessor :id # @return [Integer] The associated domain ID. attr_accessor :domain_id # @return [Integer] The number of years the domain...
github
dnsimple/dnsimple-ruby
https://github.com/dnsimple/dnsimple-ruby
lib/dnsimple/struct/whoami.rb
Ruby
mit
188
main
692
# frozen_string_literal: true module Dnsimple module Struct class Whoami < Base # @return [Account] The account, if present. attr_reader :account # @return [String] The user, if present. attr_reader :user # Converts account to a Struct::Account and sets it. # # @param...