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 | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop-capybara.rb | Ruby | mit | 49 | main | 620 | # frozen_string_literal: true
require 'pathname'
require 'yaml'
require 'rubocop'
require_relative 'rubocop/capybara/plugin'
require_relative 'rubocop/capybara/version'
require_relative 'rubocop/cop/capybara/mixin/capybara_help'
require_relative 'rubocop/cop/capybara/mixin/css_attributes_parser'
require_relative 'r... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/capybara/plugin.rb | Ruby | mit | 49 | main | 995 | # frozen_string_literal: true
require 'lint_roller'
module RuboCop
module Capybara
# A plugin that integrates RuboCop Capybara with RuboCop's plugin system.
class Plugin < LintRoller::Plugin
# :nocov:
def about
LintRoller::About.new(
name: 'rubocop-capybara',
version:... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/capybara/description_extractor.rb | Ruby | mit | 49 | main | 1,566 | # frozen_string_literal: true
module RuboCop
module Capybara
# Extracts cop descriptions from YARD docstrings
class DescriptionExtractor
def initialize(yardocs)
@code_objects = yardocs.map(&CodeObject.public_method(:new))
end
def to_h
code_objects
.select(&:cop?)
... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/capybara/config_formatter.rb | Ruby | mit | 49 | main | 1,415 | # frozen_string_literal: true
require 'yaml'
module RuboCop
module Capybara
# Builds a YAML config file from two config hashes
class ConfigFormatter
EXTENSION_ROOT_DEPARTMENT = %r{^(Capybara/)}.freeze
SUBDEPARTMENTS = %(Capybara/RSpec)
AMENDMENTS = [].freeze
COP_DOC_BASE_URL = 'https... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/capybara/cop/generator.rb | Ruby | mit | 49 | main | 753 | # frozen_string_literal: true
module RuboCop
module Capybara
module Cop
# Source and spec generator for new cops
#
# This generator will take a cop name and generate a source file
# and spec file when given a valid qualified cop name.
# @api private
class Generator < RuboCop::... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara_cops.rb | Ruby | mit | 49 | main | 825 | # frozen_string_literal: true
require_relative 'capybara/rspec/current_path_expectation'
require_relative 'capybara/rspec/have_content'
require_relative 'capybara/rspec/have_selector'
require_relative 'capybara/rspec/match_style'
require_relative 'capybara/rspec/negation_matcher'
require_relative 'capybara/rspec/negat... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/find_all_first.rb | Ruby | mit | 49 | main | 2,861 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Enforces use of `first` instead of `all` with `first` or `[0]`.
#
# @safety
# This cop's autocorrection is unsafe because `all` returns a
# `Capybara::Result` (an enumerable collection), while `first`
... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/click_link_or_button_style.rb | Ruby | mit | 49 | main | 2,747 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Checks for methods of button or link clicks.
#
# This cop is deprecated.
# We plan to remove this in the next major version update to 3.0.
#
# The migration target is `Capybara/AmbiguousClick`.
# I... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/specific_finders.rb | Ruby | mit | 49 | main | 4,034 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Checks if there is a more specific finder offered by Capybara.
#
# @example
# # bad
# find('#some-id')
# find('[id=some-id]')
# find(:css, '#some-id')
# find(:id, 'some-id')
#... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/ambiguous_click.rb | Ruby | mit | 49 | main | 791 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Specify the exact target to click on.
#
# In projects where accessibility needs to be considered,
# it is crucial to specify the click target precisely.
#
# @example
# # bad
# click_link_... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/specific_actions.rb | Ruby | mit | 49 | main | 2,691 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Checks for there is a more specific actions offered by Capybara.
#
# @example
#
# # bad
# find('a').click
# find('button.cls').click
# find('a', exact_text: 'foo').click
# fin... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/redundant_within_find.rb | Ruby | mit | 49 | main | 2,036 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Checks for redundant `within find(...)` calls.
#
# @example
# # bad
# within find('foo.bar') do
# # ...
# end
#
# # good
# within 'foo.bar' do
# # ...
... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/assert_style.rb | Ruby | mit | 49 | main | 793 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Checks for usage of deprecated assert style method.
#
# @example
# # bad
# page.find(:css, '#first').assert_style(display: 'block')
#
# # good
# page.find(:css, '#first').assert_match... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/predicate_matcher.rb | Ruby | mit | 49 | main | 9,211 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# A helper for `inflected` style
module InflectedHelper
extend NodePattern::Macros
EXPLICIT_MATCHER = %w[css selector style xpath].map do |suffix|
"matches_#{suffix}?".to_sy... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/negation_matcher.rb | Ruby | mit | 49 | main | 3,017 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Enforces use of `have_no_*` or `not_to` for negated expectations.
#
# @example EnforcedStyle: have_no (default)
# # bad
# expect(page).not_to have_selector 'a'
# expe... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/match_style.rb | Ruby | mit | 49 | main | 1,560 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Checks for usage of deprecated style methods in RSpec matchers.
#
# @example when using `has_style?`
# # bad
# expect(page.find(:css, 'first')
# .has_style?(display... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/have_content.rb | Ruby | mit | 49 | main | 1,521 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Checks for usage of `have_content` and `have_no_content`.
#
# Capybara provides `have_text` and `have_no_text` matchers that are
# more concise and preferred over their aliases `have_conte... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/current_path_expectation.rb | Ruby | mit | 49 | main | 5,692 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Checks that no expectations are set on Capybara's `current_path`.
#
# The
# https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_m... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/visibility_matcher.rb | Ruby | mit | 49 | main | 2,562 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Checks for boolean visibility in Capybara finders.
#
# Capybara lets you find elements that match a certain visibility using
# the `:visible` option. `:visible` accepts both boolean and sy... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/have_selector.rb | Ruby | mit | 49 | main | 2,617 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Use `have_css` or `have_xpath` instead of `have_selector`.
#
# @example
# # bad
# expect(foo).to have_selector(:css, 'bar')
#
# # good
# expect(foo)... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/specific_matcher.rb | Ruby | mit | 49 | main | 3,162 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Checks for there is a more specific matcher offered by Capybara.
#
# @example
#
# # bad
# expect(page).to have_selector('button')
# expect(page).to have_no_se... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/rspec/negation_matcher_after_visit.rb | Ruby | mit | 49 | main | 1,518 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
module RSpec
# Do not allow negative matchers to be used immediately after `visit`.
#
# @example
# # bad
# visit foo_path
# expect(page).to have_no_link('bar')
# expect(pa... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/mixin/css_attributes_parser.rb | Ruby | mit | 49 | main | 1,752 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Css selector parser.
# @api private
class CssAttributesParser
def initialize(selector)
@selector = selector
@state = :initial
@temp = ''
@results = {}
@bracket_cou... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/mixin/capybara_help.rb | Ruby | mit | 49 | main | 4,506 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Help methods for capybara.
# @api private
module CapybaraHelp
CAPYBARA_MATCHERS = %w[
selector css xpath text title current_path link button
field checked_field unchecked_field select table
... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | lib/rubocop/cop/capybara/mixin/css_selector.rb | Ruby | mit | 49 | main | 3,386 | # frozen_string_literal: true
module RuboCop
module Cop
module Capybara
# Helps parsing css selector.
# @api private
module CssSelector
module_function
# @param selector [String]
# @return [String]
# @example
# id('#some-id') # => some-id
# i... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | tasks/cops_documentation.rake | Ruby | mit | 49 | main | 1,433 | # frozen_string_literal: true
require 'rubocop'
require 'rubocop-capybara'
require 'rubocop/cops_documentation_generator'
require 'yard'
YARD::Rake::YardocTask.new(:yard_for_generate_documentation) do |task|
task.files = ['lib/rubocop/cop/**/*.rb']
task.options = ['--no-output']
end
desc 'Generate docs of all co... |
github | rubocop/rubocop-capybara | https://github.com/rubocop/rubocop-capybara | tasks/cut_release.rake | Ruby | mit | 49 | main | 1,664 | # frozen_string_literal: true
require 'bump'
namespace :cut_release do
def update_file(path)
content = File.read(path)
File.write(path, yield(content))
end
%w[major minor patch pre].each do |release_type|
desc "Cut a new #{release_type} release and update documents."
task release_type do
... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | metadata.rb | Ruby | apache-2.0 | 49 | main | 462 | name 'mariadb'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Installs/Configures MariaDB'
source_url 'https://github.com/sous-chefs/mariadb'
issues_url 'https://github.com/sous-chefs/mariadb/issues'
chef_version '>= 15.3'... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | libraries/helpers.rb | Ruby | apache-2.0 | 49 | main | 11,511 | #
# Cookbook:: mariadb
# Library:: helpers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | libraries/hashed_password.rb | Ruby | apache-2.0 | 49 | main | 1,460 | #
# Author:: Maksim Horbul (<max@gorbul.net>)
# Cookbook:: mariadb
# Library:: hashed_password
#
# Copyright:: 2016-2020, Eligible, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | spec/libraries/helper_spec.rb | Ruby | apache-2.0 | 49 | main | 2,276 | require 'spec_helper'
require_relative '../../libraries/helpers'
RSpec.describe MariaDBCookbook::Helpers do
class DummyClass < Chef::Node
include MariaDBCookbook::Helpers
end
subject { DummyClass.new }
describe 'helpers' do
before do
allow(subject).to receive(:[]).with(:platform_family).and_retu... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/galera_configuration.rb | Ruby | apache-2.0 | 49 | main | 7,938 | #
# Cookbook:: mariadb
# Resource:: galera_configuration
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/configuration.rb | Ruby | apache-2.0 | 49 | main | 1,950 | # frozen_string_literal: true
#
# Cookbook:: mariadb
# Resource:: configuration
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/replication.rb | Ruby | apache-2.0 | 49 | main | 7,734 | #
# Cookbook:: mariadb
# Resource:: replication
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/server_install.rb | Ruby | apache-2.0 | 49 | main | 4,920 | # frozen_string_literal: true
#
# Cookbook:: mariadb
# Resource:: server_install
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/client_install.rb | Ruby | apache-2.0 | 49 | main | 1,139 | # frozen_string_literal: true
#
# Cookbook:: mariadb
# Resource:: client_install
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/repository.rb | Ruby | apache-2.0 | 49 | main | 3,169 | # frozen_string_literal: true
#
# Cookbook:: mariadb
# Resource:: repository
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/user.rb | Ruby | apache-2.0 | 49 | main | 11,049 | #
# Cookbook:: mariadb
# Resource:: user
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/database.rb | Ruby | apache-2.0 | 49 | main | 3,222 | #
# Cookbook:: mariadb
# Resource:: database
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | resources/server_configuration.rb | Ruby | apache-2.0 | 49 | main | 16,042 | # frozen_string_literal: true
#
# Cookbook:: mariadb
# Resource:: server_configuration
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/datadir/controls/datadir_changed_spec.rb | Ruby | apache-2.0 | 49 | main | 1,730 | control 'mariadb_replication' do
impact 1.0
title 'test change of data directory'
describe service('mysql') do
it { should be_enabled }
it { should be_running }
end
describe port('3306') do
it { should be_listening }
end
if os.debian?
includedir = '/etc/mysql/conf.d'
mysql_confi... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/server_distro_install/controls/server_install_spec.rb | Ruby | apache-2.0 | 49 | main | 290 | # frozen_string_literal: true
describe service('mariadb') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
describe mysql_session('root', 'gsql').query('SELECT 1') do
its('output') { should match(/1/) }
its('exit_status') { should eq(0) }
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/client_distro_install/controls/client_distro_install_spec.rb | Ruby | apache-2.0 | 49 | main | 393 | describe command('/usr/bin/mysql --help') do
its('exit_status') { should eq 0 }
end
describe command('/usr/bin/mysql -V') do
# Each stock distro package has a different version
its('exit_status') { should eq 0 }
end
# Ensure it does not install the server
describe service('mysqld') do
it { should_not be_insta... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/server_install/controls/server_install_spec.rb | Ruby | apache-2.0 | 49 | main | 377 | # frozen_string_literal: true
version = file('/tmp/mariadb_version').content
describe command('mysqld -V') do
its('stdout') { should match(/mysqld Ver #{version}\.\d+-MariaDB/) }
its('exit_status') { should eq 0 }
end
describe service('mysql') do
it { should be_installed }
it { should be_enabled }
it { sh... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/galera_configuration/controls/galera_spec.rb | Ruby | apache-2.0 | 49 | main | 2,051 | if os.debian?
include_dir = '/etc/mysql/conf.d'
libgalera_smm_path = '/usr/lib/galera/libgalera_smm.so'
else
include_dir = '/etc/my.cnf.d'
mariadb_version = Gem::Version.new(file('/tmp/mariadb_version').content)
libgalera_smm_path = if mariadb_version >= Gem::Version.new('10.4')
'/usr... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/configuration/controls/configuration_spec.rb | Ruby | apache-2.0 | 49 | main | 568 | # frozen_string_literal: true
# includedir = '/etc/mysql/conf.d'
extra_config_file = '/etc/mysql/conf.d/extra_innodb.cnf'
case os[:family]
when 'centos', 'redhat', 'fedora'
# includedir = '/etc/my.cnf.d'
extra_config_file = '/etc/my.cnf.d/extra_innodb.cnf'
end
{
innodb_thread_concurrency: '8',
innodb_commit_c... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/replication/controls/replication_spec.rb | Ruby | apache-2.0 | 49 | main | 512 | control 'mariadb_replication' do
impact 1.0
title 'test creation and removal of replication'
describe service('mysql') do
it { should be_enabled }
it { should be_running }
end
describe port('3306') do
it { should be_listening }
end
%w(1 2 3).each do |index|
describe command('/usr/bi... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/repository/controls/repository_spec.rb | Ruby | apache-2.0 | 49 | main | 339 | # frozen_string_literal: true
version = file('/tmp/mariadb_version').content
if os.debian?
describe apt("https://mirror.mariadb.org/repo/#{version}/#{os.name}") do
it { should exist }
it { should be_enabled }
end
else
describe yum.repo("mariadb#{version}") do
it { should exist }
it { should be_e... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/server_configuration/controls/server_configuration_spec.rb | Ruby | apache-2.0 | 49 | main | 736 | # frozen_string_literal: true
if os.debian? # rubocop:disable Style/ConditionalAssignment
# includedir = '/etc/mysql/conf.d'
mysql_config_file = '/etc/mysql/my.cnf'
else
# includedir = '/etc/my.cnf.d'
mysql_config_file = '/etc/my.cnf'
end
{
query_cache_size: '64M',
thread_cache_size: 128,
max_connection... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/resources/controls/database_spec.rb | Ruby | apache-2.0 | 49 | main | 283 | control 'mariadb_database' do
impact 1.0
title 'test creation and removal of databases'
sql = mysql_session('root', 'gsql')
describe sql.query('show databases') do
its('output') { should match(/databass/) }
its('output') { should_not match(/datatrout/) }
end
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/resources/controls/user_spec.rb | Ruby | apache-2.0 | 49 | main | 1,883 | control 'mariadb_user' do
impact 1.0
title 'test creation, granting and removal of users'
sql = mysql_session('root', 'gsql')
describe sql.query('select User,Host from mysql.user') do
its('output') { should match(/fozzie/) }
its('output') { should_not match(/kermit/) }
end
describe sql.query("sho... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/port/controls/port_changed_spec.rb | Ruby | apache-2.0 | 49 | main | 1,723 | control 'port_changed' do
impact 1.0
title 'test everyhting when port changed'
describe service('mysql') do
it { should be_enabled }
it { should be_running }
end
describe port('3307') do
it { should be_listening }
end
if os.debian?
includedir = '/etc/mysql/conf.d'
mysql_config_fi... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/integration/client_install/controls/client_install_spec.rb | Ruby | apache-2.0 | 49 | main | 447 | describe command('/usr/bin/mysql --help') do
its('exit_status') { should eq 0 }
end
version = file('/tmp/mariadb_version').content
describe command('/usr/bin/mysql -V') do
case version.to_i
when 11
its('stdout') { should match(/mysql from #{version}\.\d+-MariaDB, client 15.2/) }
else
its('stdout') { s... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/metadata.rb | Ruby | apache-2.0 | 49 | main | 237 | # frozen_string_literal: true
name 'test'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Installs/Configures test'
version '0.1.0'
depends 'mariadb'
depends 'selinux'
depends 'yum-epel' |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/user_database.rb | Ruby | apache-2.0 | 49 | main | 3,882 | ::Chef::DSL::Recipe.include HashedPassword::Helper
include_recipe 'test::server_configuration'
directory '/tmp' do
owner 'root'
group 'root'
mode '1777'
end
# Create a schema to test mysql_database :drop against
bash 'create datatrout' do
code <<-EOF
echo 'CREATE SCHEMA datatrout;' | /usr/bin/mysql -u root... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/server_distro_install.rb | Ruby | apache-2.0 | 49 | main | 453 | if platform_family?('rhel')
selinux_install 'default'
selinux_state 'enforcing'
end
mariadb_server_install 'package' do
action [:install, :create]
setup_repo false
password 'gsql'
end
# Using this to generate a service resource to control
find_resource(:service, 'mariadb') do
extend MariaDBCookbook::Helpe... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/datadir.rb | Ruby | apache-2.0 | 49 | main | 215 | include_recipe 'test::server_install'
mariadb_server_configuration 'MariaDB Server Configuration' do
version node['mariadb_server_test_version']
mysqld_datadir '/opt/mysql'
innodb_buffer_pool_size '256M'
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/galera_configuration.rb | Ruby | apache-2.0 | 49 | main | 499 | include_recipe 'test::server_configuration'
mariadb_server_configuration 'MariaDB Server Configuration' do
version node['mariadb_server_test_version']
end
include_recipe 'yum-epel'
mariadb_galera_configuration 'MariaDB Galera Configuration' do
version node['mariadb_server_test_version']
wsrep_sst_method 'maria... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/repository.rb | Ruby | apache-2.0 | 49 | main | 244 | mariadb_repository 'mariadb repo' do
version node['mariadb_server_test_version']
end
# Save the intended mariadb version to a file for easy reference in inspec
file '/tmp/mariadb_version' do
content node['mariadb_server_test_version']
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/client_install.rb | Ruby | apache-2.0 | 49 | main | 300 | # This resource should install the mariadb client
mariadb_client_install 'mariadb client' do
version node['mariadb_server_test_version']
end
# Save the intended mariadb version to a file for easy reference in inspec
file '/tmp/mariadb_version' do
content node['mariadb_server_test_version']
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/configuration.rb | Ruby | apache-2.0 | 49 | main | 259 | include_recipe 'test::server_install'
mariadb_configuration 'extra_innodb' do
section 'mysqld'
option innodb_thread_concurrency: 8,
innodb_commit_concurrency: 8,
innodb_read_io_threads: 8,
innodb_flush_log_at_trx_commit: 1
end |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/replication.rb | Ruby | apache-2.0 | 49 | main | 508 | include_recipe 'test::server_configuration'
mariadb_replication 'default' do
action :add
password 'gsql'
master_user 'slave_replication'
master_password '@lph0ns3'
master_host '1.1.1.100'
master_use_gtid 'Current_Pos'
end
%w(1 2 3).each do |server_number|
mariadb_replication "server#{server_number}" do
... |
github | sous-chefs/mariadb | https://github.com/sous-chefs/mariadb | test/cookbooks/test/recipes/server_install.rb | Ruby | apache-2.0 | 49 | main | 720 | if platform_family?('rhel')
selinux_install 'default'
selinux_state 'enforcing'
end
mariadb_repository 'install' do
version node['mariadb_server_test_version']
end
mariadb_server_install 'package' do
action [:install, :create]
version node['mariadb_server_test_version']
password 'gsql'
end
# Using this t... |
github | jackowayed/mirahndroid | https://github.com/jackowayed/mirahndroid | Rakefile | Ruby | mit | 49 | master | 486 | require 'rake/clean'
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
rd.title = 'Your application title'
end
spec = eval(File.read('mirahndroid.gemspec'))
Rake::GemPackageTa... |
github | jackowayed/mirahndroid | https://github.com/jackowayed/mirahndroid | mirahndroid.gemspec | Ruby | mit | 49 | master | 733 | require 'rake'
spec = Gem::Specification.new do |s|
s.name = 'mirahndroid'
s.version = '0.0.01'
s.author = 'Daniel Jackoway'
s.email = 'mirahndroid@danieljackoway.com'
s.homepage = 'http://github.com/jackowayed/mirahndroid'
s.platform = Gem::Platform::RUBY
s.summary = 'Easily generate a Mirah Android ap... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | Rakefile | Ruby | mit | 49 | master | 220 | require 'rubygems'
require 'rake'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test' << '.'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
task :default => :test |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | example_config.rb | Ruby | mit | 49 | master | 1,475 | DiviningRod::Mappings.define(:format => :html) do |map|
# Android based phones
map.ua /Android/, :format => :webkit, :name => 'Android', :tags => [:android, :youtube_capable, :google_gears]
# Apple iPhone OS
map.ua /Apple.*Mobile.*Safari/, :format => :webkit, :tags => [:apple, :iphone_os, :youtube_capa... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | divining_rod.gemspec | Ruby | mit | 49 | master | 762 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "divining_rod/version"
Gem::Specification.new do |s|
s.name = "divining_rod"
s.version = DiviningRod::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Mark Percival"]
s.email = ["mark@markpercival.us"... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod.rb | Ruby | mit | 49 | master | 215 | module DiviningRod; end
require 'divining_rod/profile'
require 'divining_rod/utilities'
require 'divining_rod/mash'
require 'divining_rod/definition'
require 'divining_rod/mappings'
require 'divining_rod/matchers' |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/utilities.rb | Ruby | mit | 49 | master | 397 | module DiviningRod
class Utilities
def self.parse_subdomain(request)
env = request.env
if forwarded = env["HTTP_X_FORWARDED_HOST"]
host = forwarded.split(/,\s?/).last
else
host = env['HTTP_HOST'] || env['SERVER_NAME'] || env['SERVER_ADDR']
end
if host
host.su... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/profile.rb | Ruby | mit | 49 | master | 783 | module DiviningRod
module Profiler
def initialize(request)
@request = request
end
def match
@match ||= DiviningRod::Mappings.evaluate(@request)
end
def format
if match && match.format
match.format
else
@request.format
end
end
def recognized... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/matchers.rb | Ruby | mit | 49 | master | 659 | module DiviningRod
class Matchers
class << self
def ua(pattern, opts = {})
Definition.new(opts) { |request|
if pattern.match(request.env['HTTP_USER_AGENT'])
true
end
}
end
def subdomain(pattern, opts={})
Definition.new(opts) { |request|
... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/mash.rb | Ruby | mit | 49 | master | 315 | module DiviningRod
class Mash < Hash
def initialize(hsh = {})
self.replace(hsh || {})
end
def merge(opts)
opts = opts.dup
if self[:tags] || opts[:tags]
tags = Array(self[:tags]) | Array(opts[:tags])
opts[:tags] = tags
end
super(opts)
end
end
end |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/definition.rb | Ruby | mit | 49 | master | 690 | module DiviningRod
class Definition
attr_accessor :prc, :group, :opts, :parent
def initialize(opts={}, &blk)
@prc = blk
@opts = Mash.new(opts)
end
def evaluate(request)
result = nil
child_result = nil
if @prc.call(request)
result = self
unless self.chil... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/mappings.rb | Ruby | mit | 49 | master | 1,487 | module DiviningRod
class Mappings
class << self
attr_accessor :root_definition
def define(opts = {})
@root_definition = Definition.new(opts) { true }
yield Mappings.new(@root_definition)
@root_definition
end
def evaluate(obj)
@root_definition.evaluate(ob... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/murge.rb | Ruby | mit | 49 | master | 404 | module DiviningRod
module Murge
# This is tacky, but I'm preserving tags in the option hash
# and only want to have to write this once
#
def murge(old_opts, new_opts)
old_opts = old_opts || {}
new_opts = new_opts || {}
tags = Array(old_opts[:tags]) | Array(new_opts[:tags])
opt... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | lib/divining_rod/rack/divining_rack.rb | Ruby | mit | 49 | master | 276 | module DiviningRod
class Rack
def initialize(app)
@app = app
end
def call(env)
request = ::Rack::Request.new(env)
profile = DiviningRod::Profile.new(request)
env['divining_rod.profile'] = profile
@app.call(env)
end
end
end |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | test/test_helper.rb | Ruby | mit | 49 | master | 441 | require 'rubygems'
require 'rack'
require 'test/unit'
require 'shoulda'
require 'mocha'
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'divining_rod'
include Mocha::API
def request_mock(opts)
opts = {
:host => 'example.com'
}.merge(opts)
env = {'HTTP_USER_AGENT' => opts[:ua]... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | test/test_mash.rb | Ruby | mit | 49 | master | 703 | require 'test_helper'
module DiviningRod
class MashTest < Test::Unit::TestCase
context 'Mash is like Hash' do
should "work that way" do
mash = Mash.new({:a_key => "and a value"})
and_mash = Mash.new({:my_key => "and my value"})
assert_equal ({:a_key => "and a value", :my_key => "and... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | test/test_example_config.rb | Ruby | mit | 49 | master | 2,486 | require 'test_helper'
DiviningRod::Mappings.define(:format => :html, :tags => [:foo]) do |map|
map.ua /First/, :name => 'First', :tags => [:first]
map.ua /SecondMatch/, :name => 'Second', :tags => [:second]
map.with_options :tags => :grouping1 do |with_options|
with_options.ua /ThirdMatch/, :name => ... |
github | mdp/divining_rod | https://github.com/mdp/divining_rod | test/test_definition.rb | Ruby | mit | 49 | master | 1,385 | require 'test_helper'
class DefinitionTest < Test::Unit::TestCase
context DiviningRod::Definition do
should "work with no children not match" do
definition = DiviningRod::Definition.new(:format => :iphone, :tags => [:overpriced, :easy_to_break]) { |request|
request == 'iphone'
}
assert... |
github | soveran/totp | https://github.com/soveran/totp | totp.gemspec | Ruby | mit | 49 | master | 465 | Gem::Specification.new do |s|
s.name = "totp"
s.version = "2.0.0"
s.summary = "Time-based One-Time Passwords"
s.description = "Time-based One-Time Passwords"
s.authors = ["Michel Martens"]
s.email = ["michel@soveran.com"]
s.homepage = "... |
github | soveran/totp | https://github.com/soveran/totp | test/totp_test.rb | Ruby | mit | 49 | master | 816 | require_relative "../lib/totp"
test "normal usage" do
secret = TOTP.secret
# Secret is a string of size 16
assert_equal 16, secret.size
assert_equal String, secret.class
# Secret should be different on each call
assert secret != TOTP.secret
passwords = TOTP.passwords(secret)
# Passwords should be u... |
github | soveran/totp | https://github.com/soveran/totp | lib/totp.rb | Ruby | mit | 49 | master | 1,049 | require 'openssl'
require 'base32'
require 'securerandom'
module TOTP
# Generate a random secret
def self.secret
return Base32.encode(SecureRandom.bytes(10))
end
# Return whether or not the key is valid for the given secret
def self.valid?(secret, pass, time = Time.now)
return self.passwords(secret... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | Gemfile | Ruby | mit | 49 | master | 226 | source 'https://rubygems.org'
gem 'rake'
gem 'rspec'
gem 'capybara'
gem 'poltergeist'
gem 'poltergeist-suppressor'
gem 'docker-api', require: 'docker'
gem 'minitar'
gem 'rspec_junit_formatter'
gem 'rb-readline'
gem 'pry' |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/spec_helper.rb | Ruby | mit | 49 | master | 3,126 | require 'docker'
require 'capybara'
require 'capybara/dsl'
require 'capybara/poltergeist'
require 'poltergeist/suppressor'
REGEX_WARN = /WARNING|WARN/
REGEX_ERROR = /ERROR|ERR/
REGEX_SEVERE = /SEVERE|FATAL/
REGEX_STARTUP = /Server startup in (\d+ ms)/
REGEX_FILTER = Regexp.compile Regexp.union [
/org\.apache\... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/acceptance/120_integration_postgres93_spec.rb | Ruby | mit | 49 | master | 1,315 | describe 'Atlassian Bamboo with PostgreSQL 9.3 Database' do
include_examples 'a buildable Docker image', '.', env: ["CATALINA_OPTS=-Xms1024m -Xmx2048m -Djava.security.egd=file:/dev/./urandom -Datlassian.plugins.enable.wait=#{Docker::DSL.timeout}"]
include_examples 'an acceptable Atlassian Bamboo instance', 'using ... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/acceptance/000_docker_spec.rb | Ruby | mit | 49 | master | 640 | describe 'Docker image building' do
context 'when validating host software' do
it 'should supported version' do
expect { Docker.validate_version! }.to_not raise_error
end
end
context 'when building image' do
subject { Docker::Image.build_from_dir '.' }
it { is_expected.to_not be_nil }
... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/acceptance/130_integration_reverse_proxy_spec.rb | Ruby | mit | 49 | master | 1,219 | describe 'Atlassian Bamboo behind reverse proxy' do
include_examples 'a buildable Docker image', '.',
env: [
"CATALINA_OPTS=-Xms1024m -Xmx2048m -Djava.security.egd=file:/dev/./urandom -Datlassian.plugins.enable.wait=#{Docker::DSL.timeout}",
"X_PROXY_NAME=localhost",
'X_PROXY_PORT=1234',
'X... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/acceptance/110_integration_mysql57_spec.rb | Ruby | mit | 49 | master | 1,515 | describe 'Atlassian Bamboo with MySQL 5.7 Database' do
include_examples 'a buildable Docker image', '.', env: ["CATALINA_OPTS=-Xms1024m -Xmx2048m -Djava.security.egd=file:/dev/./urandom -Datlassian.plugins.enable.wait=#{Docker::DSL.timeout}"]
include_examples 'an acceptable Atlassian Bamboo instance', 'using a MyS... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/acceptance/100_integration_spec.rb | Ruby | mit | 49 | master | 340 | describe 'Atlassian Bamboo with Embedded Database' do
include_examples 'a buildable Docker image', '.', env: ["CATALINA_OPTS=-Xms1024m -Xmx2048m -Djava.security.egd=file:/dev/./urandom -Datlassian.plugins.enable.wait=#{Docker::DSL.timeout}"]
include_examples 'an acceptable Atlassian Bamboo instance', 'using an emb... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/helpers/docker_helper.rb | Ruby | mit | 49 | master | 1,314 | require 'docker'
require 'uri'
require 'rspec'
require 'rspec/expectations'
module Docker
class Container
def mapped_port(port)
port_string = port.first.reverse.join '/'
json['NetworkSettings']['Ports'][port_string].first['HostPort']
end
def host
json['NetworkSettings']['IPAddress']
... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/shared_examples/bamboo_shared_example.rb | Ruby | mit | 49 | master | 5,053 | shared_examples 'an acceptable Atlassian Bamboo instance' do |database_examples|
describe 'Going through the setup process' do
before :all do
until current_path =~ %r{/setup/setupLicense.action}
visit '/'
sleep 1
end
end
subject { page }
context 'when visiting the root pa... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/shared_examples/using_a_mysql_database_shared_example.rb | Ruby | mit | 49 | master | 1,602 | shared_examples 'using a MySQL database' do
describe 'choosing MySQL as external database' do
before :all do
choose 'chooseDatabaseType_dbChoicestandardDb'
select 'MySQL', from: 'selectedDatabase'
find('input#chooseDatabaseType_save').trigger('click')
end
it { is_expected.to have_curren... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/shared_examples/a_buildable_docker_image_shared_context.rb | Ruby | mit | 49 | master | 1,022 | shared_examples 'a buildable Docker image' do |path, options = {}|
before :all do
image = Docker::Image.build_from_dir(path)
container_options = { Image: image.id }.merge options
@container = Docker::Container.create container_options
@container.start! PublishAllPorts: true
@container.setup_capyba... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/shared_examples/using_a_postgresql_database_shared_example.rb | Ruby | mit | 49 | master | 1,717 | shared_examples 'using a PostgreSQL database' do
describe 'choosing PostgreSQL as external database' do
before :all do
choose 'chooseDatabaseType_dbChoicestandardDb'
select 'PostgreSQL', from: 'selectedDatabase'
find('input#chooseDatabaseType_save').trigger('click')
end
it { is_expected... |
github | cptactionhank/docker-atlassian-bamboo | https://github.com/cptactionhank/docker-atlassian-bamboo | spec/support/shared_examples/using_an_embedded_database_shared_example.rb | Ruby | mit | 49 | master | 605 | shared_examples 'using an embedded database' do
before :all do
choose 'chooseDatabaseType_dbChoiceembeddedDb'
find('input#chooseDatabaseType_save').trigger('click')
end
it { is_expected.to have_current_path %r{/setup/setupEmbeddedDatabase.action} }
it { is_expected.to have_current_path %r{/setup/setup... |
github | baweaver/pry-macro | https://github.com/baweaver/pry-macro | pry-macro.gemspec | Ruby | mit | 49 | master | 1,094 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'pry-macro/version'
Gem::Specification.new do |spec|
spec.name = "pry-macro"
spec.version = PryMacro::VERSION
spec.authors = ["Brandon Weaver"]
spec.email = ["... |
github | baweaver/pry-macro | https://github.com/baweaver/pry-macro | lib/pry-macro.rb | Ruby | mit | 49 | master | 4,337 | require "pry-macro/version"
require 'highline/import'
require 'pry'
module PryMacro
MacroString = Struct.new(:name, :command)
Commands = Pry::CommandSet.new do
create_command 'record-macro', 'Starts a recording session' do
banner <<-BANNER
Usage: record-macro
Starts recording a macro.
... |
github | baweaver/pry-macro | https://github.com/baweaver/pry-macro | spec/pry-macro_spec.rb | Ruby | mit | 49 | master | 2,105 | # require 'spec_helper'
# Need to find a more effective way to spec this all out. There are some nuances I haven't quite
# grasped in mocking out pry commands. As soon as I can figure out the last few bits this will
# get built on Travis and put under a bit more process.
# describe 'PryMacro' do
# before :all do
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.