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 | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | redpanda/test/redpanda_container_test.rb | Ruby | mit | 184 | main | 1,982 | # frozen_string_literal: true
require "test_helper"
require "rdkafka"
class RedpandaContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::RedpandaContainer.new
@container.start
@container.wait_for_tcp_port(9092)
@host = @container.host
@port = @container.mappe... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | redpanda/test/test_helper.rb | Ruby | mit | 184 | main | 220 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/redpanda"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | redpanda/lib/testcontainers/redpanda.rb | Ruby | mit | 184 | main | 3,006 | require_relative "redpanda/version"
require "testcontainers"
module Testcontainers
# RedpandaContainer class is used to manage containers that run a Redpanda
class RedpandaContainer < ::Testcontainers::DockerContainer
# Default port used by the container
REDPANDA_DEFAULT_PORT = 9092
# Default port use... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mongo/Gemfile | Ruby | mit | 184 | main | 248 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-mongo.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mongo/testcontainers-mongo.gemspec | Ruby | mit | 184 | main | 1,940 | # frozen_string_literal: true
require_relative "lib/testcontainers/mongo/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-mongo"
spec.version = Testcontainers::Mongo::VERSION
spec.authors = ["Pedro Piza", "Guillermo Iguaran"]
spec.email = ["pedro920224@gmail.com", "guilleiguaran@gmail.com... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mongo/test/test_helper.rb | Ruby | mit | 184 | main | 217 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/mongo"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mongo/test/mongo_container_test.rb | Ruby | mit | 184 | main | 2,480 | # frozen_string_literal: true
require "test_helper"
require "mongo"
class MongoContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::MongoContainer.new
@container.start
@host = @container.host
@port = @container.first_mapped_port
end
def after_all
if @con... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mongo/lib/testcontainers/mongo.rb | Ruby | mit | 184 | main | 3,914 | require_relative "mongo/version"
require "testcontainers"
module Testcontainers
# MongoContainer class is used to manage containers that runs a Mongo databese
#
# @attr_reader [String] username used by the container
# @attr_reader [String] password used by the container
# @attr_reader [String] database used ... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mariadb/Gemfile | Ruby | mit | 184 | main | 250 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-mariadb.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mariadb/testcontainers-mariadb.gemspec | Ruby | mit | 184 | main | 1,861 | # frozen_string_literal: true
require_relative "lib/testcontainers/mariadb/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-mariadb"
spec.version = Testcontainers::Mariadb::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Testcontain... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mariadb/lib/testcontainers/mariadb.rb | Ruby | mit | 184 | main | 4,652 | require_relative "mariadb/version"
require "testcontainers"
module Testcontainers
# MariadbContainer class is used to manage containers that runs a MariaDB database
#
# @attr_reader [String] username used by the container
# @attr_reader [String] password used by the container
# @attr_reader [String] database... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mariadb/test/test_helper.rb | Ruby | mit | 184 | main | 219 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/mariadb"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mariadb/test/mariadb_container_test.rb | Ruby | mit | 184 | main | 2,695 | # frozen_string_literal: true
require "test_helper"
require "mysql2"
class MariadbContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::MariadbContainer.new
@container.start
@host = @container.host
@port = @container.first_mapped_port
end
def after_all
if... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | compose/Gemfile | Ruby | mit | 184 | main | 250 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-compose.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | compose/testcontainers-compose.gemspec | Ruby | mit | 184 | main | 1,806 | # frozen_string_literal: true
require_relative "lib/testcontainers/compose/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-compose"
spec.version = Testcontainers::Compose::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Testcontain... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | compose/lib/testcontainers/compose.rb | Ruby | mit | 184 | main | 8,628 | require_relative "compose/version"
require "testcontainers"
require "open3"
module Testcontainers
# ComposeContainer class is used to manage a large number of containers in a synchronous environment
#
# @attr_accesor [String] filepath used by the container
# @attr_accesor [String,List] compose_filename used by... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | compose/test/compose_container_test.rb | Ruby | mit | 184 | main | 5,823 | # frozen_string_literal: true
require_relative "test_helper"
require "socket"
class Status
def initialize(code)
@code = code
end
def success?
@code.zero?
end
end
class ComposeContainerTest < TestcontainersTest
TEST_PATH = __dir__
def test_start
compose = Testcontainers::ComposeContainer.new... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | compose/test/test_helper.rb | Ruby | mit | 184 | main | 219 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/compose"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | kafka/Gemfile | Ruby | mit | 184 | main | 248 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-kafka.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | kafka/testcontainers-kafka.gemspec | Ruby | mit | 184 | main | 1,847 | # frozen_string_literal: true
require_relative "lib/testcontainers/kafka/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-kafka"
spec.version = Testcontainers::Kafka::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Testcontainers fo... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | kafka/lib/testcontainers/kafka.rb | Ruby | mit | 184 | main | 4,329 | require_relative "kafka/version"
require "testcontainers"
require "stringio"
module Testcontainers
# KafkaContainer runs a single-node Kafka broker using KRaft (no ZooKeeper).
class KafkaContainer < ::Testcontainers::DockerContainer
KAFKA_DEFAULT_IMAGE = "confluentinc/cp-kafka:7.6.1"
KAFKA_DEFAULT_PORT = 9... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | kafka/test/kafka_container_test.rb | Ruby | mit | 184 | main | 1,584 | # frozen_string_literal: true
require "test_helper"
require "rdkafka"
class KafkaContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::KafkaContainer.new
@container.start
@container.wait_for_tcp_port(9092)
@host = @container.host
@port = @container.mapped_port... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | kafka/test/test_helper.rb | Ruby | mit | 184 | main | 217 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/kafka"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | opensearch/testcontainers-opensearch.gemspec | Ruby | mit | 184 | main | 1,889 | # frozen_string_literal: true
require_relative "lib/testcontainers/opensearch/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-opensearch"
spec.version = Testcontainers::Opensearch::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Te... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | opensearch/Gemfile | Ruby | mit | 184 | main | 253 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-opensearch.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | opensearch/lib/testcontainers/opensearch.rb | Ruby | mit | 184 | main | 2,297 | require_relative "opensearch/version"
require "testcontainers"
module Testcontainers
# OpensearchContainer manages Docker containers running OpenSearch.
# It mirrors the Elasticsearch container API but targets the OpenSearch images
# and defaults, including disabled security for simple integration tests.
class... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | opensearch/test/opensearch_container_test.rb | Ruby | mit | 184 | main | 1,875 | # frozen_string_literal: true
require "test_helper"
require "opensearch-ruby"
class OpensearchContainerTest < TestcontainersTest
def setup
super
@container = Testcontainers::OpensearchContainer.new
end
def teardown
if @container&.exists?
@container&.stop if @container&.running?
@contain... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | opensearch/test/test_helper.rb | Ruby | mit | 184 | main | 222 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/opensearch"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/testcontainers-core.gemspec | Ruby | mit | 184 | main | 1,806 | # frozen_string_literal: true
require_relative "lib/testcontainers/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-core"
spec.version = Testcontainers::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Testcontainers for Ruby."
spe... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/lib/testcontainers.rb | Ruby | mit | 184 | main | 731 | # frozen_string_literal: true
require "docker"
require "logger"
require "open3"
require "uri"
require "testcontainers/docker_client"
require "testcontainers/network"
require "testcontainers/docker_container"
require_relative "testcontainers/version"
module Testcontainers
class Error < StandardError; end
class Co... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/lib/testcontainers/docker_container.rb | Ruby | mit | 184 | main | 48,986 | module Testcontainers
# The DockerContainer class is used to manage Docker containers.
# It provides an interface to create, start, stop, and manipulate containers
# using the Docker API.
#
# @attr name [String] the container's name
# @attr image [String] the container's image name
# @attr command [Array<... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/lib/testcontainers/network.rb | Ruby | mit | 184 | main | 6,318 | # frozen_string_literal: true
require "securerandom"
require "singleton"
require "forwardable"
module Testcontainers
# Custom error classes for network operations
class NetworkError < StandardError; end
class NetworkNotFoundError < NetworkError; end
class NetworkAlreadyExistsError < NetworkError; end
class ... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/lib/testcontainers/docker_client.rb | Ruby | mit | 184 | main | 1,154 | # frozen_string_literal: true
require "java-properties"
require_relative "version"
module Testcontainers
module DockerClient
module_function
def connection
configure
Docker.connection
end
def configure
configure_from_properties unless current_connection
configure_user_agent... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/test/network_test.rb | Ruby | mit | 184 | main | 6,283 | # frozen_string_literal: true
require "test_helper"
class NetworkTest < TestcontainersTest
def test_create_creates_docker_network
network = Testcontainers::Network.create
assert network.created?
docker_network = Docker::Network.get(network.name)
assert_equal network.name, docker_network.info["Name"... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/test/docker_container_test.rb | Ruby | mit | 184 | main | 19,270 | # frozen_string_literal: true
require "test_helper"
require "tmpdir"
require "securerandom"
class DockerContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::DockerContainer.new("hello-world")
@long_running_container = Testcontainers::DockerContainer.new("alpine:latest", ... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/test/docker_client_test.rb | Ruby | mit | 184 | main | 1,828 | # frozen_string_literal: true
require "test_helper"
require "tmpdir"
class DockerClientTest < TestcontainersTest
def setup
super
@original_env = ENV["TESTCONTAINERS_HOST"]
ENV.delete("TESTCONTAINERS_HOST")
Docker.reset!
end
def teardown
Docker.reset!
if @original_env
ENV["TESTCONT... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/test/test_helper.rb | Ruby | mit | 184 | main | 242 | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | core/test/testcontainers_test.rb | Ruby | mit | 184 | main | 375 | # frozen_string_literal: true
require "test_helper"
class TestcontainersTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Testcontainers::VERSION
end
def test_that_it_sets_user_agent_header
Testcontainers::DockerClient.configure
assert_equal "tc-ruby/#{::Testcontainers::VERSI... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mysql/testcontainers-mysql.gemspec | Ruby | mit | 184 | main | 1,847 | # frozen_string_literal: true
require_relative "lib/testcontainers/mysql/version"
Gem::Specification.new do |spec|
spec.name = "testcontainers-mysql"
spec.version = Testcontainers::Mysql::VERSION
spec.authors = ["Guillermo Iguaran"]
spec.email = ["guilleiguaran@gmail.com"]
spec.summary = "Testcontainers fo... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mysql/Gemfile | Ruby | mit | 184 | main | 248 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in testcontainers-mysql.gemspec
gemspec
# Use the latest version of testcontainers-core from the local path
gem "testcontainers-core", path: "../core" |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mysql/lib/testcontainers/mysql.rb | Ruby | mit | 184 | main | 4,694 | require_relative "mysql/version"
require "testcontainers"
require "uri"
module Testcontainers
# MysqlContainer class is used to manage containers that runs a MySQL database
#
# @attr_reader [String] username used by the container
# @attr_reader [String] password used by the container
# @attr_reader [String] ... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mysql/test/mysql_container_test.rb | Ruby | mit | 184 | main | 2,669 | # frozen_string_literal: true
require "test_helper"
require "mysql2"
class MysqlContainerTest < TestcontainersTest
def before_all
super
@container = Testcontainers::MysqlContainer.new
@container.start
@host = @container.host
@port = @container.first_mapped_port
end
def after_all
if @co... |
github | testcontainers/testcontainers-ruby | https://github.com/testcontainers/testcontainers-ruby | mysql/test/test_helper.rb | Ruby | mit | 184 | main | 217 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "testcontainers/mysql"
require "minitest/autorun"
require "minitest/hooks/test"
class TestcontainersTest < Minitest::Test
include Minitest::Hooks
end |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | Gemfile | Ruby | mit | 184 | master | 528 | source "https://rubygems.org"
ruby ">= 2.2.3"
gemspec
group :development do
# We depend on Vagrant for development, but we don't add it as a
# gem dependency because we expect to be installed within the
# Vagrant environment itself using `vagrant plugin`.
gem "vagrant", git: "https://github.com/mitchellh/vag... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | Vagrantfile | Ruby | mit | 184 | master | 1,906 | # -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
#
# fake a managed linux server by bringing up a virtualbox vm
#
config.vm.define :local_linux do |ll_config|
ll_config.vm.box = "chef/ubuntu-12.04-i386"
ll_config.vm.network :private_network, ip: "192.168.40.35"
ll_config... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | vagrant-managed-servers.gemspec | Ruby | mit | 184 | master | 2,484 | $:.unshift File.expand_path("../lib", __FILE__)
require "vagrant-managed-servers/version"
Gem::Specification.new do |s|
s.name = "vagrant-managed-servers"
s.version = VagrantPlugins::ManagedServers::VERSION
s.platform = Gem::Platform::RUBY
s.authors = "Torben Knerr"
s.email ... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | Rakefile | Ruby | mit | 184 | master | 671 | require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = [].tap do |a|
a.push('--color')
a.push('--format doc')
end.join(' ')
end
# Default task is to run the unit tests
task :default => "spec"
desc "runs the acceptance \"test\" as described in README"
ta... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | spec/vagrant-managed-servers/config_spec.rb | Ruby | mit | 184 | master | 610 | require "vagrant-managed-servers/config"
describe VagrantPlugins::ManagedServers::Config do
let(:instance) { described_class.new }
# Ensure tests are not affected by AWS credential environment variables
before :each do
ENV.stub(:[] => nil)
end
describe "defaults" do
subject do
instance.tap do... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers.rb | Ruby | mit | 184 | master | 493 | require "pathname"
require "vagrant-managed-servers/plugin"
module VagrantPlugins
module ManagedServers
lib_path = Pathname.new(File.expand_path("../vagrant-managed-servers", __FILE__))
autoload :Action, lib_path.join("action")
autoload :Errors, lib_path.join("errors")
# This returns the path to th... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/cap.rb | Ruby | mit | 184 | master | 424 | module VagrantPlugins
module ManagedServers
module Cap
# Returns guest's IP address that can be used to access the VM from the
# host machine.
#
# @return [String] Guest's IP address
def self.public_address(machine)
return nil if machine.state.id != :running
ssh_info... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action.rb | Ruby | mit | 184 | master | 4,561 | require "pathname"
require "vagrant/action/builder"
module VagrantPlugins
module ManagedServers
module Action
# Include the built-in modules so we can use them as top-level things.
include Vagrant::Action::Builtin
# This action is called to establish linkage between vagrant and the managed se... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/config.rb | Ruby | mit | 184 | master | 675 | require "vagrant"
module VagrantPlugins
module ManagedServers
class Config < Vagrant.plugin("2", :config)
# The IP address or hostname of the managed server.
#
# @return [String]
attr_accessor :server
def initialize()
@server = UNSET_VALUE
end
def f... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/provider.rb | Ruby | mit | 184 | master | 1,440 | require "log4r"
require "vagrant"
module VagrantPlugins
module ManagedServers
class Provider < Vagrant.plugin("2", :provider)
def initialize(machine)
@machine = machine
end
def action(name)
# Attempt to get the action method from the Action class if it
# exists, otherwi... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/errors.rb | Ruby | mit | 184 | master | 461 | require "vagrant"
module VagrantPlugins
module ManagedServers
module Errors
class VagrantManagedServersError < Vagrant::Errors::VagrantError
error_namespace("vagrant_managed_servers.errors")
end
class ManagedServersServerNotReachable < VagrantManagedServersError
error_key(:serv... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/plugin.rb | Ruby | mit | 184 | master | 2,237 | begin
require "vagrant"
rescue LoadError
raise "The Vagrant ManagedServers plugin must be run within Vagrant."
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < "1.6.0"
raise "The Vagrant ManagedServers plugin is only compatible ... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/util/timer.rb | Ruby | mit | 184 | master | 366 | module VagrantPlugins
module ManagedServers
module Util
class Timer
# A basic utility method that times the execution of the given
# block and returns it.
def self.time
start_time = Time.now.to_f
yield
end_time = Time.now.to_f
end_time - start... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/warn_winrm_syncedfolders.rb | Ruby | mit | 184 | master | 469 | module VagrantPlugins
module ManagedServers
module Action
class WarnWinRMSyncedFolders
def initialize(app, env)
@app = app
end
def call(env)
if env[:machine].config.vm.communicator == :winrm && !Vagrant.has_plugin?("vagrant-winrm-syncedfolders")
env[:... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/warn_networks.rb | Ruby | mit | 184 | master | 1,737 | module VagrantPlugins
module ManagedServers
module Action
class WarnNetworks
def initialize(app, env)
@app = app
end
def call(env)
if custom_networking_defined?(env)
env[:ui].warn(I18n.t("vagrant_managed_servers.warn_networks"))
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/is_reachable.rb | Ruby | mit | 184 | master | 419 | module VagrantPlugins
module ManagedServers
module Action
# This can be used with "Call" built-in to check if the machine
# is created and branch in the middleware.
class IsReachable
def initialize(app, env)
@app = app
end
def call(env)
env[:result] =... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/reboot_server.rb | Ruby | mit | 184 | master | 2,813 | require "log4r"
require "timeout"
module VagrantPlugins
module ManagedServers
module Action
# reboot the managed server
class RebootServer
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_managed_servers::action::reboot_server")
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/unlink_server.rb | Ruby | mit | 184 | master | 671 | require "log4r"
module VagrantPlugins
module ManagedServers
module Action
# "unlink" vagrant and the managed server
class UnlinkServer
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_managed_servers::action::unlink_server")
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/link_server.rb | Ruby | mit | 184 | master | 802 | require "log4r"
module VagrantPlugins
module ManagedServers
module Action
# "Link" vagrant and the managed server
class LinkServer
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_managed_servers::action::link_server")
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/message_already_linked.rb | Ruby | mit | 184 | master | 337 | module VagrantPlugins
module ManagedServers
module Action
class MessageAlreadyLinked
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_managed_servers.states.long_already_linked"))
@app.call(env)
end
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/is_linked.rb | Ruby | mit | 184 | master | 420 | module VagrantPlugins
module ManagedServers
module Action
# This can be used with "Call" built-in to check if the machine
# is linked and branch in the middleware.
class IsLinked
def initialize(app, env)
@app = app
end
def call(env)
env[:result] = env... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/message_not_linked.rb | Ruby | mit | 184 | master | 329 | module VagrantPlugins
module ManagedServers
module Action
class MessageNotLinked
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_managed_servers.states.long_not_linked"))
@app.call(env)
end
end
end
... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/read_state.rb | Ruby | mit | 184 | master | 2,313 | require "log4r"
module VagrantPlugins
module ManagedServers
module Action
# This action reads the state of the machine and puts it in the
# `:machine_state_id` key in the environment.
class ReadState
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new(... |
github | tknerr/vagrant-managed-servers | https://github.com/tknerr/vagrant-managed-servers | lib/vagrant-managed-servers/action/message_not_reachable.rb | Ruby | mit | 184 | master | 335 | module VagrantPlugins
module ManagedServers
module Action
class MessageNotReachable
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_managed_servers.states.long_not_reachable"))
@app.call(env)
end
end
... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | acme_plugin.gemspec | Ruby | mit | 184 | master | 1,588 | require 'English'
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
# Maintain your gem's version:
require 'acme_plugin/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'acme_plugin'
s.version = AcmePlugin::VERSION
s.authors = ['Lukasz Gromanows... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | Gemfile | Ruby | mit | 184 | master | 566 | source 'https://rubygems.org'
# Declare your gem's dependencies in acme_plugin.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
# Declare any dependencies that are still in development here instead of ... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | Rakefile | Ruby | mit | 184 | master | 708 | begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'AcmePlugin'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/test_helper.rb | Ruby | mit | 184 | master | 756 | # Configure Rails Environment
ENV['RAILS_ENV'] = 'test'
require 'simplecov'
require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
require 'rails/test_help'
require 'minitest/rails'
require 'minitest/reporters'
require 'webmock/minitest'
SimpleCov.start
# Filter out Minitest backtrace while all... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/acme_plugin_test.rb | Ruby | mit | 184 | master | 20,786 | require 'test_helper'
class AcmePluginTest < ActiveSupport::TestCase
ACME_VERSION = 'v0.6.2'.freeze
ACME_USER_AGENT = "Acme::Client #{ACME_VERSION} (https://github.com/unixcharles/acme-client)".freeze
ENDPOINT_URL = 'https://acme-staging.api.letsencrypt.org'.freeze
API_URL = "#{ENDPOINT_URL}/acme".freeze
PRI... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/dummy/db/schema.rb | Ruby | mit | 184 | master | 1,135 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/dummy/config/application.rb | Ruby | mit | 184 | master | 999 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# --... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/dummy/config/environments/test.rb | Ruby | mit | 184 | master | 1,911 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/controllers/application_controller_test.rb | Ruby | mit | 184 | master | 847 | require 'test_helper'
module AcmePlugin
class ApplicationControllerTest < ActionController::TestCase
setup do
@routes = AcmePlugin::Engine.routes
end
test 'if challenge request is invalid when is smaller than 128 bits' do
get :index, params: { challenge: 'dG9rZW4=' }
assert_response :b... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/lib/acme_plugin/configuration_test.rb | Ruby | mit | 184 | master | 425 | require 'test_helper'
module AcmePlugin
class ConfigurationTest < ActiveSupport::TestCase
test 'reads multiple domains from test config' do
config_file_path = Rails.root.join('config', 'acme_plugin.yml')
config = AcmePlugin::Configuration.load_file(config_file_path)
domains = config.domain.spli... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | test/lib/acme_plugin/private_key_store_test.rb | Ruby | mit | 184 | master | 928 | require 'test_helper'
class PrivateKeyStoreTest < ActiveSupport::TestCase
# Note we should probably stub the implementation of OpenSSL key generation
test 'if_keysize_smaller_than_2048_is_invalid' do
exception = assert_raises RuntimeError do
PrivateKeyStore.new(1024).retrieve
end
assert_equal 'In... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | app/models/acme_plugin/challenge.rb | Ruby | mit | 184 | master | 562 | module AcmePlugin
# if the project doesn't use ActiveRecord, we assume the challenge will
# be stored in the filesystem
if AcmePlugin.config.challenge_dir_name.blank? && defined?(ActiveRecord::Base) == 'constant' && ActiveRecord::Base.class == Class
class Challenge < ActiveRecord::Base
end
else
clas... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | app/models/acme_plugin/setting.rb | Ruby | mit | 184 | master | 273 | module AcmePlugin
if AcmePlugin.config.challenge_dir_name.blank? && defined?(ActiveRecord::Base) == 'constant' && ActiveRecord::Base.class == Class
class Setting < ActiveRecord::Base
end
else
class Setting
attr_accessor :private_key
end
end
end |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | app/controllers/acme_plugin/application_controller.rb | Ruby | mit | 184 | master | 1,103 | module AcmePlugin
class ApplicationController < ActionController::Base
before_action :challenge_response, only: [:index]
before_action :validate_length, only: [:index]
protect_from_forgery with: :exception
def index
# There is only one item in DB with challenge response from our task
# we... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin.rb | Ruby | mit | 184 | master | 4,518 | require 'acme_plugin/engine'
require 'acme_plugin/file_output'
require 'acme_plugin/heroku_output'
require 'acme_plugin/file_store'
require 'acme_plugin/database_store'
require 'acme_plugin/configuration'
require 'acme_plugin/private_key_store'
require 'acme-client'
module AcmePlugin
def self.config
# load files... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/challenge_store.rb | Ruby | mit | 184 | master | 299 | module AcmePlugin
class ChallengeStore
def initialize(challenge_content)
@content = challenge_content
end
def store
display_info
store_content
end
protected
def display_info
Rails.logger.info('Storing challenge information...')
end
end
end |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/configuration.rb | Ruby | mit | 184 | master | 710 | module AcmePlugin
Config = Class.new(OpenStruct)
# This is a class whose responsibility is to load the lets_encrypt configuration file
module Configuration
def self.load_file(filename = Rails.root.join('config', 'acme_plugin.yml'))
config_data = parse_yaml_file(filename)
create_config(config_data... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/heroku_output.rb | Ruby | mit | 184 | master | 571 | require 'acme_plugin/certificate_output'
module AcmePlugin
class HerokuOutput < CertificateOutput
def initialize(domain, cert)
super(domain, cert)
end
def output_cert(cert_type, cert_content)
Rails.logger.info("====== #{@domain}-#{cert_type} ======")
puts cert_content
end
def ... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/file_output.rb | Ruby | mit | 184 | master | 437 | require 'acme_plugin/certificate_output'
module AcmePlugin
class FileOutput < CertificateOutput
def initialize(domain, cert, out_dir)
super(domain, cert)
@output_dir = out_dir
end
def output_cert(cert_type, cert_content)
File.write(File.join(@output_dir, "#{@domain}-#{cert_type}"), cer... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/database_store.rb | Ruby | mit | 184 | master | 259 | require 'acme_plugin/challenge_store'
module AcmePlugin
class DatabaseStore < ChallengeStore
def store_content
ch = AcmePlugin::Challenge.first
ch = AcmePlugin::Challenge.new if ch.nil?
ch.update(response: @content)
end
end
end |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/private_key_store.rb | Ruby | mit | 184 | master | 703 | require 'openssl'
class PrivateKeyStore
def initialize(private_key)
# this should eventually be any one of many backends?
# these could then encapsulate the method of retrieving the
# RSA key string. see: http://hawkins.io/2013/10/implementing_the_repository_pattern/
@private_key = private_key
end
... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/certificate_output.rb | Ruby | mit | 184 | master | 433 | module AcmePlugin
class CertificateOutput
def initialize(domain, cert)
@certificate = cert
@domain = domain
end
def output
display_info
output_cert('cert.pem', @certificate.to_pem)
output_cert('key.pem', @certificate.request.private_key.to_pem)
output_cert('chain.pem'... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/acme_plugin/file_store.rb | Ruby | mit | 184 | master | 523 | require 'acme_plugin/challenge_store'
module AcmePlugin
class FileStore < ChallengeStore
def initialize(challenge_content, challenge_dir_name)
super(challenge_content)
@challenge_dir_name = challenge_dir_name
end
def store_content
full_challenge_dir = File.join(Rails.root, @challenge_d... |
github | lgromanowski/acme-plugin | https://github.com/lgromanowski/acme-plugin | lib/tasks/acme_plugin_tasks.rake | Ruby | mit | 184 | master | 458 | require 'openssl'
require 'acme/client'
# Sets up logging - should only be called from other rake tasks
task setup_logger: :environment do
logger = Logger.new(STDOUT)
logger.level = Logger::INFO
Rails.logger = logger
end
desc "Generates SSL certificate using Let's Encrypt service"
task acme_pl... |
github | airblade/chartjs-ror | https://github.com/airblade/chartjs-ror | chartjs-ror.gemspec | Ruby | mit | 184 | master | 863 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'chartjs/version'
Gem::Specification.new do |gem|
gem.name = "chartjs-ror"
gem.version = Chartjs::VERSION
gem.authors = ["Andy Stewart"]
gem.email = ... |
github | airblade/chartjs-ror | https://github.com/airblade/chartjs-ror | lib/chartjs/engine.rb | Ruby | mit | 184 | master | 336 | require 'chartjs/chart_helpers'
module Chartjs
class Engine < Rails::Engine
initializer 'chartjs.chart_helpers' do
if ::Chartjs.no_conflict
ActionView::Base.send :include, Chartjs::ChartHelpers::Explicit
else
ActionView::Base.send :include, Chartjs::ChartHelpers::Implicit
end
... |
github | airblade/chartjs-ror | https://github.com/airblade/chartjs-ror | lib/chartjs/chart_helpers.rb | Ruby | mit | 184 | master | 3,447 | require 'json'
require 'bigdecimal'
module Chartjs
module ChartHelpers
CHART_TYPES = %w[ bar bubble doughnut horizontal_bar line pie polar_area radar scatter ]
module Explicit
CHART_TYPES.each do |type|
define_method "chartjs_#{type}_chart" do |data, options = {}, plugins = {}| # def chart... |
github | airblade/chartjs-ror | https://github.com/airblade/chartjs-ror | test/chart_helpers_test.rb | Ruby | mit | 184 | master | 784 | require 'test_helper'
require 'chartjs/chart_helpers'
class ChartHelpersTest < Minitest::Test
class Foo
include Chartjs::ChartHelpers
def to_js(element)
to_javascript_string element
end
end
def setup
@subject = Foo.new
end
def test_to_javascript_string
assert_equal '"foo"', @su... |
github | plessl/wkpdf | https://github.com/plessl/wkpdf | Rakefile | Ruby | mit | 184 | master | 1,137 | require 'rubygems'
require 'rake'
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "wkpdf"
gemspec.executable = "wkpdf"
gemspec.summary = "Render HTML to PDF using WebKit"
gemspec.description = "wkpdf re... |
github | plessl/wkpdf | https://github.com/plessl/wkpdf | wkpdf.gemspec | Ruby | mit | 184 | master | 2,149 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{wkpdf}
s.version = "0.6.11"
s.platform = %q{universal-darwin}
s.required_rubygems_version = Gem::Requirement.new(">= 0"... |
github | plessl/wkpdf | https://github.com/plessl/wkpdf | lib/trollop.rb | Ruby | mit | 184 | master | 25,500 | ## lib/trollop.rb -- trollop command-line processing library
## Author:: William Morgan (mailto: wmorgan-trollop@masanjin.net)
## Copyright:: Copyright 2007 William Morgan
## License:: GNU GPL version 2
require 'date'
module Trollop
VERSION = "1.15"
## Thrown by Parser in the event of a commandline error. Not ... |
github | plessl/wkpdf | https://github.com/plessl/wkpdf | lib/commandline_parser.rb | Ruby | mit | 184 | master | 7,477 | require 'rdoc/usage'
require 'osx/cocoa'
require 'yaml'
require 'rubygems'
require 'trollop'
class CommandlineParser
include OSX
include Singleton
attr_accessor :source # NSURL
attr_accessor :output # NSURL
attr_accessor :paperSize # NSSize
attr_accessor... |
github | plessl/wkpdf | https://github.com/plessl/wkpdf | lib/wkpdf.rb | Ruby | mit | 184 | master | 3,198 | $:.unshift File.dirname(__FILE__)
begin
require 'osx/cocoa'
rescue LoadError
puts "Cannot load RubyCocoa library"
puts "wkpdf requires that RubyCocoa is installed, which is shipped by default since"
puts "Mac OS X 10.5. If you use Mac OS X 10.4, you have to install RubyCocoa"
puts "yourself from http://rubyc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.