repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/formatter.rb | lib/simplecov/formatter.rb | # frozen_string_literal: true
module SimpleCov
# TODO: Documentation on how to build your own formatters
module Formatter
end
end
require_relative "formatter/simple_formatter"
require_relative "formatter/multi_formatter"
| ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/defaults.rb | lib/simplecov/defaults.rb | # frozen_string_literal: true
# Load default formatter gem
require "pathname"
require_relative "default_formatter"
require_relative "profiles/root_filter"
require_relative "profiles/test_frameworks"
require_relative "profiles/bundler_filter"
require_relative "profiles/hidden_filter"
require_relative "profiles/rails"
... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/load_global_config.rb | lib/simplecov/load_global_config.rb | # frozen_string_literal: true
require "etc"
home_dir = (ENV.fetch("HOME", nil) && File.expand_path("~")) || Etc.getpwuid.dir || (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch('USER', nil)}"))
if home_dir
global_config_path = File.join(home_dir, ".simplecov")
load global_config_path if File.exist?(global... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/coverage_statistics.rb | lib/simplecov/coverage_statistics.rb | # frozen_string_literal: true
module SimpleCov
# Holds the individual data of a coverage result.
#
# This is uniform across coverage criteria as they all have:
#
# * total - how many things to cover there are (total relevant loc/branches)
# * covered - how many of the coverables are hit
# * missed - how ... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/lines_classifier.rb | lib/simplecov/lines_classifier.rb | # frozen_string_literal: true
module SimpleCov
# Classifies whether lines are relevant for code coverage analysis.
# Comments & whitespace lines, and :nocov: token blocks, are considered not relevant.
class LinesClassifier
RELEVANT = 0
NOT_RELEVANT = nil
WHITESPACE_LINE = /^\s*$/.freeze
COMMENT... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb | lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb | # frozen_string_literal: true
module SimpleCov
module ExitCodes
class MinimumCoverageByFileCheck
def initialize(result, minimum_coverage_by_file)
@result = result
@minimum_coverage_by_file = minimum_coverage_by_file
end
def failing?
minimum_violations.any?
end
... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/exit_codes/exit_code_handling.rb | lib/simplecov/exit_codes/exit_code_handling.rb | # frozen_string_literal: true
module SimpleCov
module ExitCodes
module ExitCodeHandling
module_function
def call(result, coverage_limits:)
checks = coverage_checks(result, coverage_limits)
failing_check = checks.find(&:failing?)
if failing_check
failing_check.report
... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/exit_codes/minimum_overall_coverage_check.rb | lib/simplecov/exit_codes/minimum_overall_coverage_check.rb | # frozen_string_literal: true
module SimpleCov
module ExitCodes
class MinimumOverallCoverageCheck
def initialize(result, minimum_coverage)
@result = result
@minimum_coverage = minimum_coverage
end
def failing?
minimum_violations.any?
end
def report
... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/exit_codes/maximum_coverage_drop_check.rb | lib/simplecov/exit_codes/maximum_coverage_drop_check.rb | # frozen_string_literal: true
module SimpleCov
module ExitCodes
class MaximumCoverageDropCheck
def initialize(result, maximum_coverage_drop)
@result = result
@maximum_coverage_drop = maximum_coverage_drop
end
def failing?
return false unless maximum_coverage_drop && las... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/combine/lines_combiner.rb | lib/simplecov/combine/lines_combiner.rb | # frozen_string_literal: true
module SimpleCov
module Combine
#
# Combine two different lines coverage results on same file
#
# Should be called through `SimpleCov.combine`.
module LinesCombiner
module_function
def combine(coverage_a, coverage_b)
acc = coverage_a.size > coverag... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/combine/files_combiner.rb | lib/simplecov/combine/files_combiner.rb | # frozen_string_literal: true
module SimpleCov
module Combine
#
# Handle combining two coverage results for same file
#
# Should be called through `SimpleCov.combine`.
module FilesCombiner
module_function
#
# Combines the results for 2 coverages of a file.
#
# @return... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/combine/branches_combiner.rb | lib/simplecov/combine/branches_combiner.rb | # frozen_string_literal: true
module SimpleCov
module Combine
#
# Combine different branch coverage results on single file.
#
# Should be called through `SimpleCov.combine`.
module BranchesCombiner
module_function
#
# Return merged branches or the existed branch if other is missi... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/combine/results_combiner.rb | lib/simplecov/combine/results_combiner.rb | # frozen_string_literal: true
module SimpleCov
module Combine
# There might be reports from different kinds of tests,
# e.g. RSpec and Cucumber. We need to combine their results
# into unified one. This class does that.
# To unite the results on file basis, it leverages
# the combine of lines and... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/formatter/simple_formatter.rb | lib/simplecov/formatter/simple_formatter.rb | # frozen_string_literal: true
module SimpleCov
module Formatter
#
# A ridiculously simple formatter for SimpleCov results.
#
class SimpleFormatter
# Takes a SimpleCov::Result and generates a string out of it
def format(result)
output = +""
result.groups.each do |name, file... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/formatter/multi_formatter.rb | lib/simplecov/formatter/multi_formatter.rb | # frozen_string_literal: true
module SimpleCov
module Formatter
class MultiFormatter
module InstanceMethods
def format(result)
formatters.map do |formatter|
formatter.new.format(result)
rescue StandardError => e
warn("Formatter #{formatter} failed with #{... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/profiles/rails.rb | lib/simplecov/profiles/rails.rb | # frozen_string_literal: true
SimpleCov.profiles.define "rails" do
load_profile "test_frameworks"
add_filter %r{^/config/}
add_filter %r{^/db/}
add_group "Controllers", "app/controllers"
add_group "Channels", "app/channels"
add_group "Models", "app/models"
add_group "Mailers", "app/mailers"
add_group... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/profiles/hidden_filter.rb | lib/simplecov/profiles/hidden_filter.rb | # frozen_string_literal: true
SimpleCov.profiles.define "hidden_filter" do
add_filter %r{^/\..*}
end
| ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/profiles/bundler_filter.rb | lib/simplecov/profiles/bundler_filter.rb | # frozen_string_literal: true
SimpleCov.profiles.define "bundler_filter" do
add_filter "/vendor/bundle/"
end
| ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/profiles/root_filter.rb | lib/simplecov/profiles/root_filter.rb | # frozen_string_literal: true
SimpleCov.profiles.define "root_filter" do
# Exclude all files outside of simplecov root
root_filter = nil
add_filter do |src|
root_filter ||= /\A#{Regexp.escape(SimpleCov.root + File::SEPARATOR)}/io
src.filename !~ root_filter
end
end
| ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/profiles/test_frameworks.rb | lib/simplecov/profiles/test_frameworks.rb | # frozen_string_literal: true
SimpleCov.profiles.define "test_frameworks" do
add_filter "/test/"
add_filter "/features/"
add_filter "/spec/"
add_filter "/autotest/"
end
| ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/source_file/line.rb | lib/simplecov/source_file/line.rb | # frozen_string_literal: true
module SimpleCov
class SourceFile
# Representation of a single line in a source file including
# this specific line's source code, line_number and code coverage,
# with the coverage being either nil (coverage not applicable, e.g. comment
# line), 0 (line not covered) or ... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
simplecov-ruby/simplecov | https://github.com/simplecov-ruby/simplecov/blob/afcf15e42fde20abbdb6fe9591a3e5d98acc088e/lib/simplecov/source_file/branch.rb | lib/simplecov/source_file/branch.rb | # frozen_string_literal: true
module SimpleCov
class SourceFile
#
# Representing single branch that has been detected in coverage report.
# Give us support methods that handle needed calculations.
class Branch
attr_reader :start_line, :end_line, :coverage, :type
# rubocop:disable Metrics... | ruby | MIT | afcf15e42fde20abbdb6fe9591a3e5d98acc088e | 2026-01-04T15:45:13.013465Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/certs_manager.rb | fs_overlay/opt/certs_manager/certs_manager.rb | Dir[File.dirname(__FILE__) + '/lib/*.rb'].each { |file| require file }
require_relative 'models/domain'
require 'fileutils'
class CertsManager
include Commands
attr_accessor :lock
def setup
setup_config(true)
end
def reconfig
setup_config(false)
end
def setup_config(initial)
with_lock do
... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/models/domain.rb | fs_overlay/opt/certs_manager/models/domain.rb | require 'fileutils'
class Domain
STAGES = %w(production staging local).freeze
attr_reader :descriptor
def initialize(descriptor)
@descriptor = descriptor
create_dir
end
def csr_path
File.join(dir, 'domain.csr')
end
def signed_cert_path
File.join(dir, 'signed.crt')
end
# For back... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/logger.rb | fs_overlay/opt/certs_manager/lib/logger.rb | module Logger
def self.debug(str)
if NAConfig.debug_mode?
puts "[DEBUG] #{str}"
end
end
end
| ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/erb_binding.rb | fs_overlay/opt/certs_manager/lib/erb_binding.rb | require 'erb'
class ERBBinding
class CleanBinding
def initialize(hash)
hash.each do |key, value|
singleton_class.send(:define_method, key) { value }
end
end
def get
binding
end
end
def initialize(template_path, binding_hash)
@template = File.read(template_path)
... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/open_ssl.rb | fs_overlay/opt/certs_manager/lib/open_ssl.rb | require 'date'
module OpenSSL
def self.ensure_account_key
path = "#{NAConfig.portal_base_dir}/account.key"
unless File.exist?(path) && system("openssl rsa --in #{path} --noout --check")
system "openssl genrsa 4096 > #{path}"
end
end
def self.create_ongoing_domain_key(domain)
algo = NAConfi... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/commands.rb | fs_overlay/opt/certs_manager/lib/commands.rb | require 'open-uri'
require 'fileutils'
module Commands
def chain_certs(domain)
# Keeping it for backward compatibility
unless File.exist?(domain.chained_cert_path)
FileUtils.ln_s(domain.signed_cert_path, domain.chained_cert_path)
end
end
def mkdir(domain)
system "mkdir -p #{domain.dir}"
... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/acme.rb | fs_overlay/opt/certs_manager/lib/acme.rb | require 'timeout'
require 'fileutils'
module ACME
class FailedToSignException < RuntimeError; end
def self.sign(domain)
if domain.stage == 'local'
OpenSSL.self_sign(domain)
else
le_sign(domain)
end
rescue FailedToSignException, Timeout::Error => e
false
end
private
def self.l... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/na_config.rb | fs_overlay/opt/certs_manager/lib/na_config.rb | module NAConfig
def self.portal_base_dir
"/var/lib/https-portal"
end
def self.domains
(env_domains + auto_discovered_domains).uniq {|d| [d.name, d.port] }
end
def self.domains_w_unique_names
(env_domains + auto_discovered_domains).uniq(&:name)
end
def self.stage
if ENV['STAGE']
EN... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/fs_overlay/opt/certs_manager/lib/nginx.rb | fs_overlay/opt/certs_manager/lib/nginx.rb | require_relative './commands'
module Nginx
class NginxReloadException < RuntimeError; end
def self.setup
compiled_basic_config = ERBBinding.new('/var/lib/nginx-conf/nginx.conf.erb', {}).compile
File.open('/etc/nginx/nginx.conf', 'w') do |f|
f.write compiled_basic_config
end
end
def self.co... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/spec_helper.rb | spec/spec_helper.rb | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/support/portal_helpers.rb | spec/support/portal_helpers.rb | require 'open-uri'
require 'openssl'
module PortalHelpers
extend self
def docker_compose(command, env: {})
case command.to_sym
when :up
command = 'up -d'
end
system(env, "docker-compose --project-name portalspec #{command}")
end
def purge_existing_containers
system 'docker rm --for... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/models/domain_spec.rb | spec/models/domain_spec.rb | require 'spec_helper'
require_relative '../../fs_overlay/opt/certs_manager/certs_manager'
RSpec.describe Domain do
before do
allow(NAConfig).to receive(:stage).and_return('local')
allow(FileUtils).to receive(:mkdir_p)
end
it 'returns correct names, upstream. redirect_target_url, stage etc.' do
keys ... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/local_stage_spec.rb | spec/features/local_stage_spec.rb | require 'spec_helper'
RSpec.describe 'Local stage', composition: 'local', type: :feature do
context 'when no certificates are stored' do
it 'should serve a welcome page' do
docker_compose :up, env: { 'FORCE_RENEW' => 'true', 'STAGE' => 'local' }
page = read_https_content
expect(page).to includ... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/auto_discovery_spec.rb | spec/features/auto_discovery_spec.rb | require 'spec_helper'
RSpec.describe 'Auto discovery', composition: 'auto-discovery', type: :feature do
context 'when no certificates are stored' do
it 'should forward request to auto discovered WordPress container' do
docker_compose :up, env: { 'FORCE_RENEW' => 'true' }
page = read_https_content
... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/renewal_spec.rb | spec/features/renewal_spec.rb | require 'spec_helper'
# This spec intentionally reuse containers created by previous example group.
# Since we don't retry the docker command here, to ensure it success, an
# already initialized https-portal instance is required.
RSpec.describe 'Renewal', :reuse_container, composition: 'minimal-setup', type: :feature ... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/minimal_setup_spec.rb | spec/features/minimal_setup_spec.rb | require 'spec_helper'
RSpec.describe 'Minimal setup', composition: 'minimal-setup', type: :feature do
context 'when no certificates are stored' do
it 'should serve a welcome page' do
docker_compose :up, env: { 'FORCE_RENEW' => 'true' }
page = read_https_content
expect(page).to include 'Welcome... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/linked_containers_spec.rb | spec/features/linked_containers_spec.rb | require 'spec_helper'
RSpec.describe 'Linked containers', composition: 'linked-containers', type: :feature do
context 'when no certificates are stored' do
it 'should forward request to linked WordPress container' do
docker_compose :up, env: { 'FORCE_RENEW' => 'true' }
page = read_https_content
... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
SteveLTN/https-portal | https://github.com/SteveLTN/https-portal/blob/f666dc997dc62150df530f978c7b66cf0e0e516c/spec/features/static_site_spec.rb | spec/features/static_site_spec.rb | require 'spec_helper'
RSpec.describe 'Serving static site', composition: 'static-site', type: :feature do
before :all do
system 'docker-machine ssh $DOCKER_MACHINE_NAME rm -rf /data/https-portal'
end
it 'should serve a custom index page' do
docker_compose :up
system "docker-machine scp index.html $D... | ruby | MIT | f666dc997dc62150df530f978c7b66cf0e0e516c | 2026-01-04T15:45:51.233749Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen.rb | lib/shenzhen.rb | require 'shenzhen/version'
require 'shenzhen/agvtool'
require 'shenzhen/xcodebuild'
require 'shenzhen/plistbuddy'
| ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plistbuddy.rb | lib/shenzhen/plistbuddy.rb | module Shenzhen::PlistBuddy
class << self
def print(file, key)
output = `/usr/libexec/PlistBuddy -c "Print :#{key}" "#{file}" 2> /dev/null`
!output || output.empty? || /Does Not Exist/ === output ? nil : output.strip
end
end
end
| ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/version.rb | lib/shenzhen/version.rb | module Shenzhen
VERSION = '0.14.3'
end
| ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/xcodebuild.rb | lib/shenzhen/xcodebuild.rb | require 'ostruct'
module Shenzhen::XcodeBuild
class Info < OpenStruct; end
class Settings < OpenStruct
include Enumerable
def initialize(hash = {})
super
self.targets = hash.keys
end
def members
self.targets
end
def each
members.each do |target|
yield targ... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/agvtool.rb | lib/shenzhen/agvtool.rb | module Shenzhen::Agvtool
class << self
def what_version
output = `agvtool what-version -terse`
output.length > 0 ? output : nil
end
alias :vers :what_version
def what_marketing_version
output = `agvtool what-marketing-version -terse`
output.scan(/\=(.+)$/).flatten.fir... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/commands.rb | lib/shenzhen/commands.rb | $:.push File.expand_path('../', __FILE__)
require 'plugins/rivierabuild'
require 'plugins/hockeyapp'
require 'plugins/testfairy'
require 'plugins/deploygate'
require 'plugins/itunesconnect'
require 'plugins/ftp'
require 'plugins/s3'
require 'plugins/crashlytics'
require 'plugins/fir'
require 'plugins/pgyer'
require '... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/commands/build.rb | lib/shenzhen/commands/build.rb | require 'fileutils'
command :build do |c|
c.syntax = 'ipa build [options]'
c.summary = 'Create a new .ipa file for your app'
c.description = ''
c.option '-w', '--workspace WORKSPACE', 'Workspace (.xcworkspace) file to use to build app (automatically detected in current directory)'
c.option '-p', '--project ... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/commands/info.rb | lib/shenzhen/commands/info.rb | require 'plist'
require 'tempfile'
require 'zip'
require 'zip/filesystem'
command :info do |c|
c.syntax = 'ipa info [options]'
c.summary = 'Show mobile provisioning information about an .ipa file'
c.description = ''
c.action do |args, options|
say_error "`security` command not found in $PATH" and abort if... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/commands/distribute.rb | lib/shenzhen/commands/distribute.rb | private
def determine_file!
files = Dir['*.ipa']
@file ||= case files.length
when 0 then nil
when 1 then files.first
else
@file = choose "Select an .ipa File:", *files
end
end
def determine_dsym!
dsym_files = Dir['*.dSYM.zip']
@dsym ||= case dsym_f... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/crashlytics.rb | lib/shenzhen/plugins/crashlytics.rb | require 'pathname'
module Shenzhen::Plugins
module Crashlytics
class Client
def initialize(crashlytics_path, api_token, build_secret)
@api_token, @build_secret = api_token, build_secret
@crashlytics_path = Pathname.new("#{crashlytics_path}/submit").cleanpath.to_s
say_error "Path t... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/hockeyapp.rb | lib/shenzhen/plugins/hockeyapp.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module HockeyApp
class Client
HOSTNAME = 'upload.hockeyapp.net'
def initialize(api_token)
@api_token = api_token
@connection = Faraday.new(:url => "https://#{HOSTNAME}") do |build... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/itunesconnect.rb | lib/shenzhen/plugins/itunesconnect.rb | require 'security'
require 'fileutils'
require 'digest/md5'
require 'shellwords'
module Shenzhen::Plugins
module ITunesConnect
ITUNES_CONNECT_SERVER = 'Xcode:itunesconnect.apple.com'
class Client
attr_reader :ipa, :sdk, :params
def initialize(ipa, apple_id, sdk, account, password, params = [])
... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/fir.rb | lib/shenzhen/plugins/fir.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module Fir
class Client
HOSTNAME = 'api.fir.im'
def initialize(user_token)
@user_token = user_token
@connection = Faraday.new(:url => "http://#{HOSTNAME}") do |builder|
... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/pgyer.rb | lib/shenzhen/plugins/pgyer.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module Pgyer
class Client
HOSTNAME = 'www.pgyer.com'
def initialize(user_key, api_key)
@user_key, @api_key = user_key, api_key
@connection = Faraday.new(:url => "http://#{HOSTNAME... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/testfairy.rb | lib/shenzhen/plugins/testfairy.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module TestFairy
class Client
HOSTNAME = 'app.testfairy.com'
def initialize(api_key)
@api_key = api_key
@connection = Faraday.new(:url => "https://#{HOSTNAME}") do |builder|
... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/ftp.rb | lib/shenzhen/plugins/ftp.rb | require 'net/ftp'
require 'net/sftp'
module Shenzhen::Plugins
module FTP
class Client
def initialize(host, port, user, password)
@host, @port, @user, @password = host, port, user, password
end
def upload(ipa, options = {})
connection = Net::FTP.new
connection.passive =... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/s3.rb | lib/shenzhen/plugins/s3.rb | require 'aws-sdk'
require 'shellwords'
module Shenzhen::Plugins
module S3
class Client
def initialize(access_key_id, secret_access_key, region)
@s3 = AWS::S3.new(:access_key_id => access_key_id,
:secret_access_key => secret_access_key,
:region => region)
end
def upl... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/deploygate.rb | lib/shenzhen/plugins/deploygate.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module DeployGate
class Client
HOSTNAME = 'deploygate.com'
def initialize(api_token, user_name)
@api_token, @user_name = api_token, user_name
@connection = Faraday.new(:url => "ht... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
nomad-cli/shenzhen | https://github.com/nomad-cli/shenzhen/blob/b745dc21a234f2003d929c88d57fafd96bfe8f97/lib/shenzhen/plugins/rivierabuild.rb | lib/shenzhen/plugins/rivierabuild.rb | require 'json'
require 'openssl'
require 'faraday'
require 'faraday_middleware'
module Shenzhen::Plugins
module RivieraBuild
class Client
HOSTNAME = 'apps.rivierabuild.com'
def initialize(api_token)
@api_token = api_token
@connection = Faraday.new(:url => "https://#{HOSTNAME}", :requ... | ruby | MIT | b745dc21a234f2003d929c88d57fafd96bfe8f97 | 2026-01-04T15:45:52.367764Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/helper_spec.rb | spec/helper_spec.rb | require "_helpers"
describe "Wraith helpers classes and functions" do
describe "the convert_to_absolute function" do
it "should return false if no filepath provided" do
expect(convert_to_absolute(nil)).to eq 'false'
end
it "should convert a relative path to absolute" do
relative = 'my/filep... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/resize_reload_spec.rb | spec/resize_reload_spec.rb | require "_helpers"
describe "wraith config" do
let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" }
let(:saving) { Wraith::SaveImages.new(config_name) }
describe "saving images" do
it "should pass the width plainly to the CLI when running in inefficient mode" do
p... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/construct_command_spec.rb | spec/construct_command_spec.rb | require "_helpers"
describe "Wraith config to CLI argument mapping" do
describe "passing variables to construct_command" do
# set default variables we can override if necessary
let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" }
let(:saving) { Wraith::SaveImage... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/_helpers.rb | spec/_helpers.rb | require "rspec"
require "./lib/wraith/cli"
def create_diff_image
capture_image = saving.construct_command(320, test_url1, test_image1, selector, false, false)
`#{capture_image}`
capture_image = saving.construct_command(320, test_url2, test_image2, selector, false, false)
`#{capture_image}`
end
def crop_images... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/save_images_spec.rb | spec/save_images_spec.rb | require "_helpers"
require "image_size"
describe Wraith do
let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" }
let(:config_chrome) { get_path_relative_to __FILE__, "./configs/test_config--chrome.yaml" }
let(:test_url1) { "http://www.bbc.com/afrique" }
let(:test_url2) { "h... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/validate_spec.rb | spec/validate_spec.rb | require "_helpers"
describe "Wraith config validator" do
let(:config) do
YAML.load('
domains:
test: http://www.bbc.com
browser: "casperjs"
directory: some/dir
')
end
describe "universal, basic validation for all modes" do
it "should validate a basic config" do
Wrait... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/gallery_spec.rb | spec/gallery_spec.rb | require "_helpers"
describe Wraith do
let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" }
let(:gallery) { Wraith::GalleryGenerator.new(config_name, false) }
describe "When generating gallery" do
it "should not break when there is a `-` in the filename" do
dirs = ... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/config_spec.rb | spec/config_spec.rb | require "_helpers"
describe "wraith config" do
let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" }
let(:wraith) { Wraith::Wraith.new(config_name) }
describe "Config" do
it "returns a Wraith class" do
expect(wraith).is_a? Wraith::Wraith
end
it "when confi... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/spec/before_capture_spec.rb | spec/before_capture_spec.rb | require "_helpers"
def run_js_then_capture(config)
saving = Wraith::SaveImages.new(config_name)
generated_image = "shots/test/temporary_jsified_image.png"
capture_image = saving.construct_command(320, "http://www.bbc.com/afrique", generated_image, selector, config[:global_js], config[:path_js])
`#{captur... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith.rb | lib/wraith.rb | require "wraith/version"
module Wraith
autoload :CLI, "wraith/cli"
end
| ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/wraith.rb | lib/wraith/wraith.rb | require "yaml"
require "wraith/helpers/logger"
require "wraith/helpers/utilities"
class Wraith::Wraith
include Logging
attr_accessor :config
def initialize(config, options = {})
options = {
yaml_passed: false,
imports_must_resolve: true,
}.merge(options)
if options[:yaml_passed]
@... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/version.rb | lib/wraith/version.rb | module Wraith
VERSION = "4.2.4"
end
| ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/save_images.rb | lib/wraith/save_images.rb | require "parallel"
require "shellwords"
require "wraith"
require "wraith/helpers/capture_options"
require "wraith/helpers/logger"
require "wraith/helpers/save_metadata"
require "wraith/helpers/utilities"
require "selenium-webdriver"
require 'mini_magick'
class Wraith::SaveImages
include Logging
attr_reader :wraith... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/thumbnails.rb | lib/wraith/thumbnails.rb | require "wraith"
require "parallel"
require "fileutils"
require "shellwords"
class Wraith::Thumbnails
attr_reader :wraith
def initialize(config)
@wraith = Wraith::Wraith.new(config)
end
def generate_thumbnails
files = Dir.glob("#{wraith.directory}/*/*.png")
Parallel.each(files, :in_processes => ... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/validate.rb | lib/wraith/validate.rb | require "wraith/wraith"
require "wraith/helpers/logger"
require "wraith/helpers/utilities"
class Wraith::Validate
include Logging
attr_reader :wraith
def initialize(config, options = {})
@wraith = Wraith::Wraith.new(config, options)
end
def validate(mode = false)
list_debug_information if wraith.ve... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/gallery.rb | lib/wraith/gallery.rb | require "erb"
require "pp"
require "fileutils"
require "wraith/wraith"
require "wraith/helpers/logger"
class Wraith::GalleryGenerator
include Logging
attr_reader :wraith
MATCH_FILENAME = /(\S+)_(\S+)\.\S+/
def initialize(config, multi)
@wraith = Wraith::Wraith.new(config)
@location = wraith.directory... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/cli.rb | lib/wraith/cli.rb | require "thor"
require "wraith"
require "wraith/save_images"
require "wraith/crop"
require "wraith/spider"
require "wraith/folder"
require "wraith/thumbnails"
require "wraith/compare_images"
require "wraith/gallery"
require "wraith/validate"
require "wraith/version"
require "wraith/helpers/logger"
require "wraith/helpe... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/folder.rb | lib/wraith/folder.rb | require "wraith"
require "wraith/helpers/logger"
class Wraith::FolderManager
include Logging
attr_reader :wraith
def initialize(config)
@wraith = Wraith::Wraith.new(config)
end
def dir
wraith.directory
end
def history_dir
wraith.history_dir
end
def paths
wraith.paths
end
def ... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/compare_images.rb | lib/wraith/compare_images.rb | require "wraith"
require "wraith/helpers/logger"
require "image_size"
require "open3"
require "parallel"
require "shellwords"
class Wraith::CompareImages
include Logging
attr_reader :wraith
def initialize(config)
@wraith = Wraith::Wraith.new(config)
end
def compare_images
files = Dir.glob("#{wraith... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/crop.rb | lib/wraith/crop.rb | require "wraith"
require "wraith/helpers/logger"
require "image_size"
require "parallel"
require "shellwords"
class Wraith::CropImages
include Logging
attr_reader :wraith
def initialize(config)
@wraith = Wraith::Wraith.new(config)
end
def crop_images
files = Dir.glob("#{wraith.directory}/*/*.png").... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/spider.rb | lib/wraith/spider.rb | require "wraith"
require "wraith/helpers/logger"
require "yaml"
require "anemone"
require "uri"
class Wraith::Spider
include Logging
EXT = %w(flv swf png jpg gif asx zip rar tar 7z \
gz jar js css dtd xsd ico raw mp3 mp4 m4a \
wav wmv ape aac ac3 wma aiff mpg mpeg \
avi mov ogg mk... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/helpers/capture_options.rb | lib/wraith/helpers/capture_options.rb | require "wraith"
require "wraith/helpers/utilities"
class CaptureOptions
attr_reader :options, :wraith
def initialize(options, wraith)
@options = options
@wraith = wraith
end
def path
casper?(options)
end
def selector
options["selector"] || "body"
end
def resize
# path level, or... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/helpers/logger.rb | lib/wraith/helpers/logger.rb | # Logging Module, credit: http://stackoverflow.com/a/6768164
require "logger"
module Logging
# This is the magical bit that gets mixed into your classes
def logger
Logging.logger
end
# Global, memoized, lazy initialized instance of a logger
def self.logger
unless @logger
@logger = Logger.new(S... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/helpers/utilities.rb | lib/wraith/helpers/utilities.rb | require "wraith/helpers/custom_exceptions"
def within_acceptable_limits
yield
rescue CustomError => e
logger.error e.message
# other errors, such as SystemError, will not be caught nicely and will give a stack trace (which we'd need)
end
def absolute_path_of_dir(filepath)
path_parts = filepath.split('/')
pa... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/helpers/custom_exceptions.rb | lib/wraith/helpers/custom_exceptions.rb | class CustomError < StandardError
end
class InvalidDomainsError < CustomError
end
class MissingRequiredPropertyError < CustomError
end
class ConfigFileDoesNotExistError < CustomError
end
class PropertyOutOfContextError < CustomError
end
class InvalidYamlError < CustomError
end
class MissingImageError < CustomErro... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
bbc/wraith | https://github.com/bbc/wraith/blob/4f6eb0b7625d468bb9e3061fd2628f48df4c4e37/lib/wraith/helpers/save_metadata.rb | lib/wraith/helpers/save_metadata.rb | require "wraith"
require "fileutils"
class SaveMetadata
attr_reader :wraith, :history
def initialize(config, history)
@wraith = config
@history = history
end
def history_label
history ? "_latest" : ""
end
def file_names(width, label, domain_label)
width = "MULTI" if width.is_a? Array
... | ruby | Apache-2.0 | 4f6eb0b7625d468bb9e3061fd2628f48df4c4e37 | 2026-01-04T15:45:27.176979Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/helpers/blazer/base_helper.rb | app/helpers/blazer/base_helper.rb | module Blazer
module BaseHelper
def blazer_title(title = nil)
if title
content_for(:title) { title }
else
content_for?(:title) ? content_for(:title) : nil
end
end
BLAZER_URL_REGEX = /\Ahttps?:\/\/[\S]+\z/
BLAZER_IMAGE_EXT = %w[png jpg jpeg gif]
def blazer_format... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/controllers/blazer/queries_controller.rb | app/controllers/blazer/queries_controller.rb | module Blazer
class QueriesController < BaseController
before_action :set_query, only: [:show, :edit, :update, :destroy, :refresh]
before_action :set_data_source, only: [:tables, :docs, :schema, :cancel]
def home
set_queries(1000)
if params[:filter]
@dashboards = [] # TODO show my da... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/controllers/blazer/checks_controller.rb | app/controllers/blazer/checks_controller.rb | module Blazer
class ChecksController < BaseController
before_action :set_check, only: [:edit, :update, :destroy, :run]
def index
state_order = [nil, "disabled", "error", "timed out", "failing", "passing"]
@checks = Blazer::Check.joins(:query).includes(:query).order("blazer_queries.name, blazer_ch... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/controllers/blazer/dashboards_controller.rb | app/controllers/blazer/dashboards_controller.rb | module Blazer
class DashboardsController < BaseController
before_action :set_dashboard, only: [:show, :edit, :update, :destroy, :refresh]
def new
@dashboard = Blazer::Dashboard.new
end
def create
@dashboard = Blazer::Dashboard.new
# use creator_id instead of creator
# since w... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/controllers/blazer/base_controller.rb | app/controllers/blazer/base_controller.rb | module Blazer
class BaseController < ApplicationController
# skip filters
filters = _process_action_callbacks.map(&:filter) - [:activate_authlogic]
skip_before_action(*filters, raise: false)
skip_after_action(*filters, raise: false)
skip_around_action(*filters, raise: false)
clear_helpers
... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/controllers/blazer/uploads_controller.rb | app/controllers/blazer/uploads_controller.rb | module Blazer
class UploadsController < BaseController
before_action :ensure_uploads
before_action :set_upload, only: [:show, :edit, :update, :destroy]
def index
@uploads = Blazer::Upload.order(:table)
end
def new
@upload = Blazer::Upload.new
end
def create
@upload = B... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/record.rb | app/models/blazer/record.rb | module Blazer
class Record < ActiveRecord::Base
self.abstract_class = true
end
end
| ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/dashboard.rb | app/models/blazer/dashboard.rb | module Blazer
class Dashboard < Record
belongs_to :creator, optional: true, class_name: Blazer.user_class.to_s if Blazer.user_class
has_many :dashboard_queries, dependent: :destroy
has_many :queries, through: :dashboard_queries
validates :name, presence: true
def variables
queries.flat_map... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/query.rb | app/models/blazer/query.rb | module Blazer
class Query < Record
belongs_to :creator, optional: true, class_name: Blazer.user_class.to_s if Blazer.user_class
has_many :checks, dependent: :destroy
has_many :dashboard_queries, dependent: :destroy
has_many :dashboards, through: :dashboard_queries
has_many :audits
validates :... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/dashboard_query.rb | app/models/blazer/dashboard_query.rb | module Blazer
class DashboardQuery < Record
belongs_to :dashboard
belongs_to :query
validates :dashboard_id, presence: true
validates :query_id, presence: true
end
end
| ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/connection.rb | app/models/blazer/connection.rb | module Blazer
class Connection < ActiveRecord::Base
self.abstract_class = true
end
end
| ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/uploads_connection.rb | app/models/blazer/uploads_connection.rb | module Blazer
class UploadsConnection < ActiveRecord::Base
self.abstract_class = true
establish_connection Blazer.settings["uploads"]["url"] if Blazer.uploads?
end
end
| ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/audit.rb | app/models/blazer/audit.rb | module Blazer
class Audit < Record
belongs_to :user, optional: true, class_name: Blazer.user_class.to_s
belongs_to :query, optional: true
end
end
| ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/check.rb | app/models/blazer/check.rb | module Blazer
class Check < Record
belongs_to :creator, optional: true, class_name: Blazer.user_class.to_s if Blazer.user_class
belongs_to :query
validates :query_id, presence: true
validate :validate_emails
validate :validate_variables, if: -> { query_id_changed? }
before_validation :set_st... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
ankane/blazer | https://github.com/ankane/blazer/blob/e5515ecca17ed2f2d3f87347147549353983f24b/app/models/blazer/upload.rb | app/models/blazer/upload.rb | module Blazer
class Upload < Record
belongs_to :creator, optional: true, class_name: Blazer.user_class.to_s if Blazer.user_class
validates :table, presence: true, uniqueness: true, format: {with: /\A[a-z0-9_]+\z/, message: "can only contain lowercase letters, numbers, and underscores"}, length: {maximum: 63}... | ruby | MIT | e5515ecca17ed2f2d3f87347147549353983f24b | 2026-01-04T15:45:43.211083Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.