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
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/rake_compat.rb
lib/vendor/thor/lib/thor/rake_compat.rb
require 'rake' require 'rake/dsl_definition' class Thor # Adds a compatibility layer to your Thor classes which allows you to use # rake package tasks. For example, to use rspec rake tasks, one can do: # # require 'thor/rake_compat' # require 'rspec/core/rake_task' # # class Default < Thor # ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/group.rb
lib/vendor/thor/lib/thor/group.rb
require 'thor/base' # Thor has a special class called Thor::Group. The main difference to Thor class # is that it invokes all commands at once. It also include some methods that allows # invocations to be done at the class method, which are not available to Thor # commands. class Thor::Group class << self # The ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/parser.rb
lib/vendor/thor/lib/thor/parser.rb
require 'thor/parser/argument' require 'thor/parser/arguments' require 'thor/parser/option' require 'thor/parser/options'
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/base.rb
lib/vendor/thor/lib/thor/base.rb
require 'thor/command' require 'thor/core_ext/hash_with_indifferent_access' require 'thor/core_ext/ordered_hash' require 'thor/error' require 'thor/invocation' require 'thor/parser' require 'thor/shell' require 'thor/util' class Thor autoload :Actions, 'thor/actions' autoload :RakeCompat, 'thor/rake_compat' a...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/runner.rb
lib/vendor/thor/lib/thor/runner.rb
require 'thor' require 'thor/group' require 'thor/core_ext/io_binary_read' require 'fileutils' require 'open-uri' require 'yaml' require 'digest/md5' require 'pathname' class Thor::Runner < Thor #:nodoc: map "-T" => :list, "-i" => :install, "-u" => :update, "-v" => :version # Override Thor#help so it can give in...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/shell.rb
lib/vendor/thor/lib/thor/shell.rb
require 'rbconfig' class Thor module Base # Returns the shell used in all Thor classes. If you are in a Unix platform # it will use a colored log, otherwise it will use a basic one without color. # def self.shell @shell ||= if ENV['THOR_SHELL'] && ENV['THOR_SHELL'].size > 0 Thor::Shell....
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/invocation.rb
lib/vendor/thor/lib/thor/invocation.rb
class Thor module Invocation def self.included(base) #:nodoc: base.extend ClassMethods end module ClassMethods # This method is responsible for receiving a name and find the proper # class and command for it. The key is an optional parameter which is # available only in class meth...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/error.rb
lib/vendor/thor/lib/thor/error.rb
class Thor # Thor::Error is raised when it's caused by wrong usage of thor classes. Those # errors have their backtrace suppressed and are nicely shown to the user. # # Errors that are caused by the developer, like declaring a method which # overwrites a thor keyword, it SHOULD NOT raise a Thor::Error. This w...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/util.rb
lib/vendor/thor/lib/thor/util.rb
require 'rbconfig' class Thor module Sandbox #:nodoc: end # This module holds several utilities: # # 1) Methods to convert thor namespaces to constants and vice-versa. # # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz" # # 2) Loading thor files and sandboxing: # # Thor...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/directory.rb
lib/vendor/thor/lib/thor/actions/directory.rb
require 'thor/actions/empty_directory' class Thor module Actions # Copies recursively the files from source directory to root directory. # If any of the files finishes with .tt, it's considered to be a template # and is placed in the destination without the extension .tt. If any # empty directory is ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/create_link.rb
lib/vendor/thor/lib/thor/actions/create_link.rb
require 'thor/actions/create_file' class Thor module Actions # Create a new file relative to the destination root from the given source. # # ==== Parameters # destination<String>:: the relative path to the destination root. # source<String|NilClass>:: the relative path to the source root. # ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/create_file.rb
lib/vendor/thor/lib/thor/actions/create_file.rb
require 'thor/actions/empty_directory' class Thor module Actions # Create a new file relative to the destination root with the given data, # which is the return value of a block or a data string. # # ==== Parameters # destination<String>:: the relative path to the destination root. # data<St...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/file_manipulation.rb
lib/vendor/thor/lib/thor/actions/file_manipulation.rb
require 'erb' require 'open-uri' class Thor module Actions # Copies the file from the relative source to the relative destination. If # the destination is not given it's assumed to be equal to the source. # # ==== Parameters # source<String>:: the relative path to the source root. # destinat...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/inject_into_file.rb
lib/vendor/thor/lib/thor/actions/inject_into_file.rb
require 'thor/actions/empty_directory' class Thor module Actions # Injects the given content into a file. Different from gsub_file, this # method is reversible. # # ==== Parameters # destination<String>:: Relative path to the destination root # data<String>:: Data to add to the file. Can be ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions/empty_directory.rb
lib/vendor/thor/lib/thor/actions/empty_directory.rb
class Thor module Actions # Creates an empty directory. # # ==== Parameters # destination<String>:: the relative path to the destination root. # config<Hash>:: give :verbose => false to not log the status. # # ==== Examples # # empty_directory "doc" # def empty_directory...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/core_ext/ordered_hash.rb
lib/vendor/thor/lib/thor/core_ext/ordered_hash.rb
class Thor module CoreExt #:nodoc: if RUBY_VERSION >= '1.9' class OrderedHash < ::Hash end else # This class is based on the Ruby 1.9 ordered hashes. # # It keeps the semantics and most of the efficiency of normal hashes # while also keeping track of the order in which ele...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
lib/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
class Thor module CoreExt #:nodoc: # A hash with indifferent access and magic predicates. # # hash = Thor::CoreExt::HashWithIndifferentAccess.new 'foo' => 'bar', 'baz' => 'bee', 'force' => true # # hash[:foo] #=> 'bar' # hash['foo'] #=> 'bar' # hash.foo? #=> true # clas...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/core_ext/io_binary_read.rb
lib/vendor/thor/lib/thor/core_ext/io_binary_read.rb
class IO #:nodoc: class << self def binread(file, *args) raise ArgumentError, "wrong number of arguments (#{1 + args.size} for 1..3)" unless args.size < 3 File.open(file, 'rb') do |f| f.read(*args) end end unless method_defined? :binread end end
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/shell/color.rb
lib/vendor/thor/lib/thor/shell/color.rb
require 'thor/shell/basic' class Thor module Shell # Inherit from Thor::Shell::Basic and add set_color behavior. Check # Thor::Shell::Basic to see all available methods. # class Color < Basic # Embed in a String to clear all previous ANSI sequences. CLEAR = "\e[0m" # The start ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/shell/basic.rb
lib/vendor/thor/lib/thor/shell/basic.rb
require 'tempfile' class Thor module Shell class Basic attr_accessor :base attr_reader :padding # Initialize base, mute and padding to nil. # def initialize #:nodoc: @base, @mute, @padding = nil, false, 0 end # Mute everything that's inside given block ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/shell/html.rb
lib/vendor/thor/lib/thor/shell/html.rb
require 'thor/shell/basic' class Thor module Shell # Inherit from Thor::Shell::Basic and add set_color behavior. Check # Thor::Shell::Basic to see all available methods. # class HTML < Basic # The start of an HTML bold sequence. BOLD = "font-weight: bold" # Set the terminal's...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/parser/options.rb
lib/vendor/thor/lib/thor/parser/options.rb
class Thor class Options < Arguments #:nodoc: LONG_RE = /^(--\w+(?:-\w+)*)$/ SHORT_RE = /^(-[a-z])$/i EQ_RE = /^(--\w+(?:-\w+)*|-[a-z])=(.*)$/i SHORT_SQ_RE = /^-([a-z]{2,})$/i # Allow either -x -v or -xv style for single char args SHORT_NUM = /^(-[a-z])#{NUMERIC}$/i OPTS_END ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/parser/arguments.rb
lib/vendor/thor/lib/thor/parser/arguments.rb
class Thor class Arguments #:nodoc: NUMERIC = /(\d*\.\d+|\d+)/ # Receives an array of args and returns two arrays, one with arguments # and one with switches. # def self.split(args) arguments = [] args.each do |item| break if item =~ /^-/ arguments << item end ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/parser/option.rb
lib/vendor/thor/lib/thor/parser/option.rb
class Thor class Option < Argument #:nodoc: attr_reader :aliases, :group, :lazy_default, :hide VALID_TYPES = [:boolean, :numeric, :hash, :array, :string] def initialize(name, options={}) options[:required] = false unless options.key?(:required) super @lazy_default = options[:lazy_defau...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/parser/argument.rb
lib/vendor/thor/lib/thor/parser/argument.rb
class Thor class Argument #:nodoc: VALID_TYPES = [ :numeric, :hash, :array, :string ] attr_reader :name, :description, :enum, :required, :type, :default, :banner alias :human_name :name def initialize(name, options={}) class_name = self.class.name.split("::").last type = options[:type] ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/deploy_config.rb
lib/engineyard/deploy_config.rb
module EY class DeployConfig MIGRATE = 'rake db:migrate --trace' def initialize(cli_opts, env_config, repo, ui) @cli_opts = cli_opts @env_config = env_config @repo = repo @ui = ui end def ref @ref ||= decide_ref end def migrate @migrate ||= @cli_opts.fetc...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/serverside_runner.rb
lib/engineyard/serverside_runner.rb
require 'escape' require 'net/ssh' require 'engineyard-serverside-adapter' module EY class ServersideRunner def initialize(options) @verbose = options[:verbose] || !!ENV['DEBUG'] @hostname = options[:bridge] env = options[:environment] @adapter = load_adapt...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/version.rb
lib/engineyard/version.rb
module EY VERSION = '4.0.0.pre1' ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.6.10' end
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/templates.rb
lib/engineyard/templates.rb
module EY module Templates end end require 'engineyard/templates/ey_yml'
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/cli.rb
lib/engineyard/cli.rb
require 'engineyard' require 'engineyard/error' require 'engineyard/thor' require 'engineyard/deploy_config' require 'engineyard/serverside_runner' require 'launchy' require 'fileutils' module EY class CLI < EY::Thor require 'engineyard/cli/recipes' require 'engineyard/cli/web' require 'engineyard/cli/ap...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/thor.rb
lib/engineyard/thor.rb
$:.unshift(File.expand_path('../vendor/thor/lib/', File.dirname(__FILE__))) require 'thor' module EY module UtilityMethods protected def api @api ||= EY::CLI::API.new(config.endpoint, ui, options[:api_token]) end def config @config ||= EY::Config.new end # engineyard gem uses ui...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/config.rb
lib/engineyard/config.rb
require 'uri' require 'yaml' require 'pathname' require 'engineyard/error' module EY class Config # This order is important. CONFIG_FILES = ["config/ey.yml", "ey.yml"].map {|path| Pathname.new(path)}.freeze TEMPLATE_PATHNAME = Pathname.new(__FILE__).dirname.join('templates','ey.yml').freeze def self...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/repo.rb
lib/engineyard/repo.rb
require 'engineyard/error' require 'pathname' module EY class Repo class NotAGitRepository < EY::Error attr_reader :dir def initialize(output) @dir = File.expand_path(ENV['GIT_DIR'] || ENV['GIT_WORK_TREE'] || '.') super("#{output} (#{@dir})") end end class NoRemotesErro...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/eyrc.rb
lib/engineyard/eyrc.rb
module EY class EYRC attr_reader :path DEFAULT_PATH = "~/.eyrc" def self.load new(ENV['EYRC'] || DEFAULT_PATH) end def initialize(path) @path = Pathname.new(path).expand_path end def exist? path.exist? end def delete_api_token delete('api_token') en...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/error.rb
lib/engineyard/error.rb
module EY class Error < RuntimeError end class NoCommandError < EY::Error def initialize super "Specify a command to run via ssh or use --each to cycle through each server one at a time." end end class NoInstancesError < EY::Error def initialize(env_name) super "The environment '#{en...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/deploy_config/ref.rb
lib/engineyard/deploy_config/ref.rb
require 'engineyard/error' module EY class DeployConfig class Ref def initialize(cli_opts, env_config, repo, ui) @cli_opts = cli_opts @default = env_config.branch @repo = repo @force_ref = @cli_opts.fetch('force_ref', false) @ui = ui if @forc...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/templates/ey_yml.rb
lib/engineyard/templates/ey_yml.rb
require 'erb' module EY module Templates class EyYml PATH = Pathname.new(__FILE__).dirname.join('ey.yml.erb').freeze attr_reader :existing_config, :existing, :config, :template def initialize(existing, template=PATH) @template = template @existing = existing.dup ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/cli/ui.rb
lib/engineyard/cli/ui.rb
require 'highline' module EY class CLI class UI < Thor::Base.shell class Tee def initialize(*ios) @ios = ios end def <<(str) @ios.each { |io| io << str } self end end class Prompter def self.add_answer(arg) @answ...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/cli/recipes.rb
lib/engineyard/cli/recipes.rb
require 'tempfile' module EY class CLI class Recipes < EY::Thor desc "apply [--environment ENVIRONMENT]", "Run chef recipes uploaded by '#{banner_base} recipes upload' on the specified environment." long_desc <<-DESC This is similar to '#{banner_base} rebuild' except Engine Yard's mai...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/cli/api.rb
lib/engineyard/cli/api.rb
require 'highline' require 'engineyard-cloud-client' require 'engineyard/eyrc' module EY class CLI class API USER_AGENT = "EngineYard/#{EY::VERSION}" attr_reader :token def initialize(endpoint, ui, token = nil) @client = EY::CloudClient.new(endpoint: endpoint, output: ui.out, user_age...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
engineyard/engineyard
https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard/cli/web.rb
lib/engineyard/cli/web.rb
module EY class CLI class Web < EY::Thor desc "enable [--environment/-e ENVIRONMENT]", "Remove the maintenance page for this application in the given environment." method_option :environment, type: :string, aliases: %w(-e), required: true, default: '', desc: "Environment on whi...
ruby
MIT
14a6698100e5210692841dacae4457a0127d8a86
2026-01-04T17:50:07.755432Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/markdown_lint.rb
markdown_lint.rb
# enable all linting rules by default, then override below all # Some files hard-wrap lines to around 80 characters, others do not. We don't # have a definitive guide in the GDS Way, so we shouldn't enforce either way here. exclude_rule "line-length" # Middleman starts .md files with Frontmatter (https://middlemanapp...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/config.rb
config.rb
require "govuk_tech_docs" require_relative "./app/requires" GovukTechDocs.configure(self) set :markdown, renderer: DeveloperDocsRenderer.new( with_toc_data: true, api: true, context: self, ), fenced_code_blocks: true, tables: true, no_intra_emphasis: true, hard_wrap: false c...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/repos_csv.rb
app/repos_csv.rb
require "csv" class ReposCSV attr_reader :hash def initialize(repos) @repos = repos end def to_csv CSV.generate do |csv| csv << ["Name", "Team", "Dependencies Team", "Docs URL", "Repo URL", "Hosted On"] @repos.each do |repo| csv << [ repo.repo_name, repo.team,...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/snippet.rb
app/snippet.rb
require "sanitize" class Snippet HEADINGS = %i[h1 h2 h3 h4 h5 h6].freeze def self.generate(html) # Discard first heading and everything before it. fragment = html.partition("</h1>")[2] remove_headings = Sanitize::Config.merge( Sanitize::Config::DEFAULT, remove_contents: Sanitize::Config::...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/repo_data.rb
app/repo_data.rb
class RepoData SEARCH_URL = "https://www.gov.uk/api/search.json?facet_publishing_app=100,examples:10,example_scope:global&facet_rendering_app=100,examples:10,example_scope:global&count=0".freeze def self.publishing_examples @publishing_examples ||= extract_examples_from_search_result("publishing_app") end ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/dashboard.rb
app/dashboard.rb
# View model for the dashboard. class Dashboard def chapters YAML.load_file("data/dashboard.yml", aliases: true).map do |chapter| Chapter.new(chapter) end end class Thing attr_reader :data def initialize(data) @data = data end def name data.fetch("name") end d...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/proxy_pages.rb
app/proxy_pages.rb
class ProxyPages def self.resources repo_docs + govuk_schema_names + repo_overviews + repo_overviews_json + document_types + supertypes end def self.repo_docs docs = Repos.with_docs.map do |repo| docs_for_repo = GitHubRepoFetcher.instance.docs(repo.repo_name) || [] ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/source_url.rb
app/source_url.rb
class SourceUrl attr_reader :locals, :current_page def initialize(locals, current_page) @locals = locals @current_page = current_page end def source_url override_from_page || source_from_yaml_file || source_from_file end private # If a `page` local exists, see if it has a `source_url`. This ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/supertypes.rb
app/supertypes.rb
class Supertypes def self.all data.map { |id, config| Supertype.new(id, config) } end def self.data @data ||= HTTP.get_yaml("https://raw.githubusercontent.com/alphagov/govuk_document_types/master/data/supertypes.yml") end class Supertype attr_reader :id, :name, :description, :default, :items ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/related_things.rb
app/related_things.rb
class RelatedThings attr_reader :manual, :current_page def initialize(manual, current_page) @manual = manual @current_page = current_page end def related_repos @related_repos ||= current_page.data.related_repos.to_a.map do |repo_name| [repo_name, "/repos/#{repo_name}.html"] end end ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/github_repo_fetcher.rb
app/github_repo_fetcher.rb
require "octokit" class GitHubRepoFetcher # The cache is only used locally, as GitHub Pages rebuilds the site # with an empty cache every hour and when new commits are merged. # # Setting a high cache duration below hastens local development, as # you don't have to keep pulling down lots of content from GitH...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/search_api_docs.rb
app/search_api_docs.rb
class SearchApiReference def self.fetch_field_definitions contents = HTTP.get( field_definitions_url, ) fields = JSON.parse(contents) fields.sort_by { |name, definition| [definition["type"], name] } end def self.field_definitions_url "https://raw.githubusercontent.com/alphagov/search-a...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/requires.rb
app/requires.rb
require "active_support/all" require "tilt" require "middleman-core" require "yaml" require "json" CACHE = ActiveSupport::Cache::FileStore.new(".cache") Dir["#{File.dirname(__FILE__)}/../lib/*.rb"].sort.each { |file| require file } Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |file| require file }
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/document_types.rb
app/document_types.rb
class DocumentTypes FACET_QUERY = "https://www.gov.uk/api/search.json?facet_content_store_document_type=500,examples:10,example_scope:global&count=0".freeze DOCUMENT_TYPES_URL = "https://raw.githubusercontent.com/alphagov/publishing-api/main/content_schemas/allowed_document_types.yml".freeze def self.pages k...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/string_to_id.rb
app/string_to_id.rb
require "sanitize" class StringToId def self.convert(string) Sanitize.fragment(string) .downcase .gsub(/&(amp|gt|lt);/, "") .tr(" .", "-") .tr("^a-z0-9_-", "") .gsub(/--+/, "-") end end
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/external_doc.rb
app/external_doc.rb
require "html/pipeline" require "uri" require_relative "./string_to_id" class ExternalDoc def self.parse(markdown, repository: "", path: "") context = { repository:, # Turn off hardbreaks as they behave different to github rendering gfm: false, base_url: URI.join( "https://github....
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/http.rb
app/http.rb
require "faraday-http-cache" require "faraday_middleware" module HTTP def self.get_yaml(url) YAML.load(get(url), aliases: true) end def self.get(url) CACHE.fetch url, expires_in: 1.hour do get_without_cache(url) end end def self.get_without_cache(url) uri = URI.parse(url) faraday...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/document_types_csv.rb
app/document_types_csv.rb
require "csv" class DocumentTypesCsv def initialize(pages) @pages = pages end def to_csv CSV.generate do |csv| row = [ "Name", "Docs URL", "Number of pages", "Example URL", "Rendering apps", ] Supertypes.all.each do |supertype| row << su...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/repos.rb
app/repos.rb
class Repos UNKNOWN = "unknown".freeze def self.all @all ||= YAML.load_file("data/repos.yml", aliases: true) .map { |repo_data| Repo.new(repo_data) } .sort_by(&:repo_name) end def self.public Repos.all.reject(&:private_repo?) end def self.active Repos.all.reject(&:retire...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/content_schema.rb
app/content_schema.rb
require "govuk_schemas" class ContentSchema attr_reader :schema_name, :seed def initialize(schema_name, seed = 777) @schema_name = schema_name @seed = seed end def frontend_schema FrontendSchema.new(schema_name, seed) rescue Errno::ENOENT nil end def publisher_content_schema Publis...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/developer_docs_renderer.rb
app/developer_docs_renderer.rb
require_relative "./string_to_id" class DeveloperDocsRenderer < GovukTechDocs::TechDocsHTMLRenderer def header(text, header_level) anchor = StringToId.convert(text) tag = "h#{header_level}" "<#{tag} id='#{anchor}'>#{text}</#{tag}>" end end
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/manual.rb
app/manual.rb
class Manual ICINGA_ALERTS = "Icinga alerts".freeze attr_reader :sitemap def initialize(sitemap) @sitemap = sitemap end def manual_pages_grouped_by_section grouped = manual_pages .group_by { |page| page.data.section || "Uncategorised" } .sort_by { |group| group.first.downcase } [["...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/run_rake_task.rb
app/run_rake_task.rb
require "padrino-helpers" class RunRakeTask def self.links(application, rake_task = "") app_name = if application.respond_to?(:repo_name) application.repo_name else application end rake_task_name = rake_task.presence || "<rake task>".freeze ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/repo.rb
app/repo.rb
class Repo attr_reader :repo_data def initialize(repo_data) @repo_data = repo_data end def api_payload { app_name:, # beware renaming the key - it's used here: https://github.com/alphagov/seal/blob/36a897b099943713ea14fa2cfe1abff8b25a83a7/lib/team_builder.rb#L97 team:, alerts_team:, ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/app/repo_sidebar.rb
app/repo_sidebar.rb
class RepoSidebar Item = Data.define(:path, :title, :children) def initialize(repo_name) @repo_name = repo_name end def items format_tree(tree) end private attr_reader :repo_name def format_tree(items) items.map do |_, value| Item.new( value[:path], value[:name], ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/helpers/analytics_helpers.rb
helpers/analytics_helpers.rb
module AnalyticsHelpers def urlize(string) string.downcase.gsub(" ", "_").gsub("-", "_") end def build_event(data, attributes = [], event_name = nil, output = {}) event_name ||= find_event_name(data) data.sort_by { |k, _v| k["name"] }.each do |item| name = item["name"] value = item["value...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/helpers/properties_table_helpers.rb
helpers/properties_table_helpers.rb
module PropertiesTableHelpers def table_of_properties(properties) return unless properties rows = properties.map do |name, attrs| "<tr><td><strong>#{name}</strong><br/>#{possible_types(attrs)}</td> <td>#{display_attribute_value(attrs)}</td></tr>" end "<table class='schema-table'>#{rows.join("\...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/helpers/navigation_helpers.rb
helpers/navigation_helpers.rb
module NavigationHelpers def active_page?(page_path) (current_page.path == "index.html" && page_path == "/") || "/#{current_page.path}" == page_path || current_page.data.parent == page_path end def sidebar_link(name, page_path) link_to(page_path, class: page_path == "/#{current_page.path}" ? ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/helpers/commit_helpers.rb
helpers/commit_helpers.rb
require "git" module CommitHelpers def commit_url(current_page) if current_page.data.latest_commit "https://github.com/alphagov/#{current_page.data.repo_name}/commit/#{current_page.data.latest_commit[:sha]}" elsif local_commit(current_page) "https://github.com/alphagov/govuk-developer-docs/commit...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/helpers/url_helpers.rb
helpers/url_helpers.rb
module UrlHelpers def document_type_url(document_type_name) "/document-types/#{document_type_name}.html" end def slack_url(channel_name) "https://gds.slack.com/channels/#{channel_name.sub('#', '')}" end end
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/spec_helper.rb
spec/spec_helper.rb
require "simplecov" SimpleCov.start require "webmock/rspec" require "govuk_tech_docs" require_relative "./../app/requires" RSpec.configure do |config| config.before do WebMock.reset! end config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = tru...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/source_url_spec.rb
spec/app/source_url_spec.rb
Dir.glob(::File.expand_path("../helpers/**/*.rb", __dir__)).sort.each { |f| require_relative f } RSpec.describe SourceUrl do describe "#source_url" do it "returns the URL from the page local" do locals = { page: double(source_url: "https://example.org/via-page") } source_url = SourceUrl.new(locals, ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/run_rake_task_spec.rb
spec/app/run_rake_task_spec.rb
require "capybara/rspec" RSpec.describe RunRakeTask do describe "#links" do subject(:html) do Capybara.string(described_class.links(application, rake_task)) end describe "given a Repo instance" do let(:application) do Repo.new( "repo_name" => "content-publisher", ) ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/document_types_spec.rb
spec/app/document_types_spec.rb
RSpec.describe DocumentTypes do describe ".pages" do it "returns document types" do stub_request(:get, "https://www.gov.uk/api/search.json?facet_content_store_document_type=500,examples:10,example_scope:global&count=0") .to_return( body: File.read("spec/fixtures/search-api-app-search-respo...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/github_repo_fetcher_spec.rb
spec/app/github_repo_fetcher_spec.rb
require "ostruct" RSpec.describe GitHubRepoFetcher do before :each do stub_request(:get, "https://api.github.com/users/alphagov/repos?per_page=100") .to_return( body: "[ { \"name\": \"some-repo\", \"default_branch\": \"main\" } ]", headers: { content_type: "application/json" }, ) en...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/snippet_spec.rb
spec/app/snippet_spec.rb
RSpec.describe Snippet do describe ".generate" do it "generates a proper snippet without the opsmanual warning" do html = <<~HTML <blockquote> <p><strong>This page was imported from <a href="https://github.com/alphagov/govuk-legacy-opsmanual">the opsmanual on GitHub Enterprise</a></strong>. ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/content_schema_spec.rb
spec/app/content_schema_spec.rb
RSpec.describe ContentSchema do describe "#frontend_schema" do it "it can link to GitHub" do schema = ContentSchema.new("generic").frontend_schema expect(schema.link_to_github).to eql("https://github.com/alphagov/publishing-api/blob/main/content_schemas/dist/formats/generic/frontend/schema.json") ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/repo_spec.rb
spec/app/repo_spec.rb
RSpec.describe Repo do describe "is_app?" do it "returns false if 'production_hosted_on' is omitted" do expect(Repo.new({}).is_app?).to be(false) end it "returns true if 'production_hosted_on' is supplied" do expect(Repo.new({ "production_hosted_on" => "aws" }).is_app?).to be(true) end ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/proxy_pages_spec.rb
spec/app/proxy_pages_spec.rb
RSpec.describe ProxyPages do before do allow(Repos).to receive(:all) .and_return([double("Repo", app_name: "", repo_name: "", page_title: "", description: "", skip_docs?: false, private_repo?: false, retired?: false)]) allow(DocumentTypes).to receive(:pages) .and_return([double("Page", name: "")])...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/manual_spec.rb
spec/app/manual_spec.rb
RSpec.describe Manual do describe "#manual_pages_grouped_by_section" do it "returns the correct groups" do sitemap = double(resources: [ double(path: "foo.html", data: double(title: "Won't be included", important: true, review_by: Date.today, section: "Foo", type: nil)), double(path: "manual...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/string_to_id_spec.rb
spec/app/string_to_id_spec.rb
RSpec.describe StringToId do describe "convert" do subject(:c) { StringToId } it "removes HTML tags" do expect(c.convert("<marquee loop=\"-1\" scrolldelay='50'><b>lol</b></marquee>")).to eq("lol") end it "removes script elements and their content" do expect(c.convert("<script>foo</script...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/document_types_csv_spec.rb
spec/app/document_types_csv_spec.rb
RSpec.describe DocumentTypesCsv do describe ".to_csv" do it "returns document types" do allow(DocumentTypes).to receive(:facet_query).and_return( JSON.parse(File.read("spec/fixtures/search-api-app-search-response.json")), ) allow(DocumentTypes).to receive(:all_document_types).and_return(...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/repo_data_spec.rb
spec/app/repo_data_spec.rb
RSpec.describe RepoData do before do stub_request(:get, RepoData::SEARCH_URL) .to_return(body: "{}") end describe "result" do it "cannot be queried from outside the class" do expect { RepoData.result }.to raise_error(NoMethodError) end end describe "extract_examples_from_search_resul...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/external_doc_spec.rb
spec/app/external_doc_spec.rb
require "capybara/rspec" RSpec.describe ExternalDoc do describe ".parse" do it "converts arbitrary markdown to HTML" do markdown = <<~MD # Title [link](#anchor) MD expected_html = "\n<p><a href=\"#anchor\">link</a></p>" expect(described_class.parse(markdown).to_s).to eq(ex...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/repo_sidebar_spec.rb
spec/app/repo_sidebar_spec.rb
RSpec.describe RepoSidebar do it "returns an ordered list of items" do docs_to_import = [ { path: "/repos/repo_name/base.html", title: "Base", }, { path: "/repos/repo_name/something/in_a_sub_dir.html", title: "Single level", }, { path: "/repos/...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/supertypes_spec.rb
spec/app/supertypes_spec.rb
RSpec.describe Supertypes do describe ".all" do it "works" do stub_request(:get, "https://raw.githubusercontent.com/alphagov/govuk_document_types/master/data/supertypes.yml") .to_return(body: File.read("spec/fixtures/supertypes.yml")) supertypes = Supertypes.all expect(supertypes.first...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/app/repos_spec.rb
spec/app/repos_spec.rb
RSpec.describe Repos do before :each do allow(Repos).to receive(:all) do repos.map(&:stringify_keys).map { |repo_data| Repo.new(repo_data) } end end describe "public" do let(:repos) do [ { repo_name: "whitehall", private_repo: true }, { repo_name: "asset-manager", private_...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/helpers/commit_helpers_spec.rb
spec/helpers/commit_helpers_spec.rb
require "ostruct" require "spec_helper" require_relative "../../helpers/commit_helpers" RSpec.describe CommitHelpers do let(:helper) { Class.new { extend CommitHelpers } } let(:uncommitted_file) do path_to_file = "tmp/tmp.md" File.write(path_to_file, "new uncommitted file") path_to_file end descri...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/helpers/analytics_helpers_spec.rb
spec/helpers/analytics_helpers_spec.rb
require "spec_helper" require_relative "../../helpers/analytics_helpers" RSpec.describe AnalyticsHelpers do let(:helper) { Class.new { extend AnalyticsHelpers } } describe "#urlize" do it "returns a url safe version of the given string" do expect(helper.urlize("An event-name")).to eq("an_event_name") ...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/helpers/url_helpers_spec.rb
spec/helpers/url_helpers_spec.rb
require "spec_helper" require_relative "../../helpers/url_helpers" RSpec.describe UrlHelpers do let(:helper) { Class.new { extend UrlHelpers } } describe "#document_type_url" do it "returns the path to a document type page" do document_type = "html_publication" expect(helper.document_type_url(docu...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/pages/manual_page_spec.rb
spec/pages/manual_page_spec.rb
Dir.glob("source/manual/**/*.md").each do |filename| RSpec.describe filename do raw = File.read(filename) frontmatter = YAML.load(raw.split("---")[1]) it "uses the correct spelling of GOV.UK" do expect(raw).not_to match "Gov.uk" end it "has an owner" do expect(frontmatter["owner_slack...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/spec/data/repos_spec.rb
spec/data/repos_spec.rb
RSpec.describe "repos.yml" do describe "repos.yml" do let!(:repos) { YAML.load_file("data/repos.yml", aliases: true) } it "lists each repository in alphabetical order" do expect(repos.pluck("repo_name")).to eq(repos.pluck("repo_name").sort) end end end
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
alphagov/govuk-developer-docs
https://github.com/alphagov/govuk-developer-docs/blob/9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b/mdl/rules.rb
mdl/rules.rb
rule "MY001", "No parentheses allowed after shortcut reference link (use collapsed reference link instead, e.g. `[foo]` => `[foo][]`)" do aliases "no-parentheses-after-shortcut-reference-link" check do |doc| # matches `[foo] (bar)`, doesn't match `[foo][baz] (bar)` doc.matching_lines(/ \[[^\]]+\] \(/) end...
ruby
MIT
9642e97c9bbb73e4827878ccfa3ac8e2ac282f6b
2026-01-04T17:48:06.150611Z
false
my-learn-project/nvim.comment-hide
https://github.com/my-learn-project/nvim.comment-hide/blob/33aa42530d1a0c41fd9f2e57d5fdb2d769e62c86/test/ruby.rb
test/ruby.rb
=begin MiniDynDNS v1.4.0 by Stephan Soller <stephan.soller@helionweb.de> # About the source code To keep the source code hackable and easier to understand it's organized in sections rather than classes. I've tried several class layouts but rejected them all because they added to much boiler plate and self organizati...
ruby
MIT
33aa42530d1a0c41fd9f2e57d5fdb2d769e62c86
2026-01-04T17:49:48.752453Z
false
manuelvanrijn/selectize-rails
https://github.com/manuelvanrijn/selectize-rails/blob/351e4b73054575707f406eae81d8d53eb64aac4e/lib/selectize-rails.rb
lib/selectize-rails.rb
require 'rails' require 'selectize-rails/version' module Selectize module Rails if ::Rails.version < '3.1' require 'selectize-rails/railtie' else require 'selectize-rails/engine' end end end
ruby
MIT
351e4b73054575707f406eae81d8d53eb64aac4e
2026-01-04T17:50:11.911481Z
false
manuelvanrijn/selectize-rails
https://github.com/manuelvanrijn/selectize-rails/blob/351e4b73054575707f406eae81d8d53eb64aac4e/lib/selectize-rails/version.rb
lib/selectize-rails/version.rb
module Selectize module Rails VERSION = '0.12.6'.freeze end end
ruby
MIT
351e4b73054575707f406eae81d8d53eb64aac4e
2026-01-04T17:50:11.911481Z
false
manuelvanrijn/selectize-rails
https://github.com/manuelvanrijn/selectize-rails/blob/351e4b73054575707f406eae81d8d53eb64aac4e/lib/selectize-rails/railtie.rb
lib/selectize-rails/railtie.rb
module Selectize module Rails class Railtie < ::Rails::Railtie; end end end
ruby
MIT
351e4b73054575707f406eae81d8d53eb64aac4e
2026-01-04T17:50:11.911481Z
false
manuelvanrijn/selectize-rails
https://github.com/manuelvanrijn/selectize-rails/blob/351e4b73054575707f406eae81d8d53eb64aac4e/lib/selectize-rails/engine.rb
lib/selectize-rails/engine.rb
module Selectize module Rails class Engine < ::Rails::Engine; end end end
ruby
MIT
351e4b73054575707f406eae81d8d53eb64aac4e
2026-01-04T17:50:11.911481Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/backgrounded_spec.rb
spec/backgrounded_spec.rb
RSpec.describe Backgrounded do describe '.configure' do it 'saves configuration' do handler = double Backgrounded.configure do |config| config.handler = handler end expect(Backgrounded.handler).to eq handler end end end
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false