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 |
|---|---|---|---|---|---|---|---|---|
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/commands/scope_spec.rb | spec/lib/guard/commands/scope_spec.rb | # frozen_string_literal: true
require "guard/commands/scope"
RSpec.describe Guard::Commands::Scope, :stub_ui do
include_context "with engine"
include_context "with fake pry"
let!(:frontend_group) { engine.groups.add("frontend") }
let!(:dummy_plugin) { engine.plugins.add("dummy", group: frontend_group) }
b... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/commands/notification_spec.rb | spec/lib/guard/commands/notification_spec.rb | # frozen_string_literal: true
require "guard/commands/notification"
RSpec.describe Guard::Commands::Notification, :stub_ui do
include_context "with engine"
include_context "with fake pry"
let(:output) { instance_double(Pry::Output) }
before do
allow(Pry::Commands).to receive(:create_command)
.with... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/commands/change_spec.rb | spec/lib/guard/commands/change_spec.rb | # frozen_string_literal: true
require "guard/commands/change"
RSpec.describe Guard::Commands::Change, :stub_ui do
include_context "with engine"
include_context "with fake pry"
let(:output) { instance_double(Pry::Output) }
before do
allow(Pry::Commands).to receive(:create_command).with("change") do |&blo... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/groups_spec.rb | spec/lib/guard/internals/groups_spec.rb | # frozen_string_literal: true
require "guard/internals/groups"
RSpec.describe Guard::Internals::Groups do
describe "#all" do
let(:default) { instance_double("Guard::Group", name: :default) }
before do
allow(Guard::Group).to receive(:new).with(:default).and_return(default)
end
context "with o... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/session_spec.rb | spec/lib/guard/internals/session_spec.rb | # frozen_string_literal: true
require "guard/internals/session"
RSpec.describe Guard::Internals::Session, :stub_ui do
include_context "with engine"
let(:options) { {} }
subject { engine.session }
describe "#initialize" do
describe "#listener_args" do
subject { described_class.new(options).listener... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/tracing_spec.rb | spec/lib/guard/internals/tracing_spec.rb | # frozen_string_literal: true
require "guard/internals/tracing"
RSpec.describe Guard::Internals::Tracing do
let(:null) { IO::NULL }
# NOTE: Calling system() is different from calling Kernel.system()
#
# We can capture system() calls by stubbing Kernel.system, but to capture
# Kernel.system() calls, we need... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/traps_spec.rb | spec/lib/guard/internals/traps_spec.rb | # frozen_string_literal: true
require "guard/internals/traps"
RSpec.describe Guard::Internals::Traps do
describe ".handle" do
let(:signal_class) { class_double(Signal) }
before do
stub_const("Signal", signal_class)
end
context "with a supported signal name" do
let(:signal) { "USR1" }
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/debugging_spec.rb | spec/lib/guard/internals/debugging_spec.rb | # frozen_string_literal: true
require "guard/internals/debugging"
RSpec.describe Guard::Internals::Debugging do
let(:null) { IO::NULL }
let(:ui) { class_double(::Guard::UI) }
let(:tracing) { class_spy(::Guard::Internals::Tracing) }
before do
stub_const("::Guard::Internals::Tracing", tracing)
stub_con... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/internals/plugins_spec.rb | spec/lib/guard/internals/plugins_spec.rb | # frozen_string_literal: true
require "guard/internals/plugins"
RSpec.describe Guard::Internals::Plugins, :stub_ui do
include_context "with testing plugins"
let(:frontend_group) { Guard::Group.new(:frontend) }
let(:backend_group) { Guard::Group.new(:backend) }
let!(:dummy_plugin) { subject.add("dummy", group... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/cli/environments/read_only_spec.rb | spec/lib/guard/cli/environments/read_only_spec.rb | # frozen_string_literal: true
require "guard/cli/environments/read_only"
RSpec.describe Guard::Cli::Environments::ReadOnly, :stub_ui do
include_context "Guard options"
before do
allow(subject).to receive(:bundler_check)
end
subject { described_class.new(options) }
describe "#evaluate" do
let(:eva... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/cli/environments/write_spec.rb | spec/lib/guard/cli/environments/write_spec.rb | # frozen_string_literal: true
require "guard/cli/environments/write"
RSpec.describe Guard::Cli::Environments::Write, :stub_ui do
let(:options) { {} }
subject { described_class.new(options) }
before do
allow(subject).to receive(:bundler_check)
end
describe "#initialize_guardfile" do
let(:evaluator... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/cli/environments/base_spec.rb | spec/lib/guard/cli/environments/base_spec.rb | # frozen_string_literal: true
require "guard/cli/environments/base"
RSpec.describe Guard::Cli::Environments::Base, :stub_ui do
let(:no_bundler_warning) { false }
let(:options) { { no_bundler_warning: no_bundler_warning } }
shared_examples "avoids Bundler warning" do
it "does not show the Bundler warning" d... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/guardfile/result_spec.rb | spec/lib/guard/guardfile/result_spec.rb | # frozen_string_literal: true
require "guard/guardfile/result"
RSpec.describe Guard::Guardfile::Result, :stub_ui do
let(:options) { {} }
let(:valid_guardfile_string) { "group :foo; do guard :bar; end; end; " }
let(:dsl) { instance_double("Guard::Dsl") }
subject { described_class.new }
describe "#plugin_na... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/guardfile/evaluator_spec.rb | spec/lib/guard/guardfile/evaluator_spec.rb | # frozen_string_literal: true
require "guard/guardfile/evaluator"
RSpec.describe Guard::Guardfile::Evaluator, :stub_ui do
let(:options) { { inline: "guard :dummy" } }
let(:plugin_options) { { callbacks: [], group: :default, watchers: [] } }
let(:valid_guardfile_string) { "group :foo; do guard :bar; end; end; " ... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/guardfile/generator_spec.rb | spec/lib/guard/guardfile/generator_spec.rb | # frozen_string_literal: true
require "guard/guardfile/generator"
RSpec.describe Guard::Guardfile::Generator, :stub_ui do
let(:plugin_util) { instance_double("Guard::PluginUtil") }
it "has a valid Guardfile template" do
allow(File).to receive(:exist?)
.with(described_class::GUARDFILE_TEMPLATE).and_call... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/ui/logger_config_spec.rb | spec/lib/guard/ui/logger_config_spec.rb | # frozen_string_literal: true
require "guard/ui/logger_config"
RSpec.describe Guard::UI::LoggerConfig do
describe "defaults" do
it "flushes device by default" do
expect(subject[:flush_seconds]).to eq(0)
end
end
describe "#level=" do
context "with a valid value" do
before do
subj... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/spec/lib/guard/ui/config_spec.rb | spec/lib/guard/ui/config_spec.rb | # frozen_string_literal: true
require "guard/ui/config"
RSpec.describe Guard::UI::Config do
describe "#device" do
context "when not set" do
context "when accessed as a method" do
it "returns $stderr" do
expect(subject.device).to be($stderr)
end
end
context "when acce... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard.rb | lib/guard.rb | # frozen_string_literal: true
# Guard plugins should use this namespace.
module Guard
end
| ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/tasks/releaser.rb | lib/tasks/releaser.rb | # frozen_string_literal: true
# TODO: extract to gem?
# @private
class Releaser
def initialize(options = {})
@project_name = options.delete(:project_name) do
fail "project_name is needed!"
end
@gem_name = options.delete(:gem_name) do
fail "gem_name is needed!"
end
@github_repo = op... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/watcher.rb | lib/guard/watcher.rb | # frozen_string_literal: true
require "guard/ui"
require "guard/watcher/pattern"
require "guard/watcher/pattern/match_result"
module Guard
# The watcher defines a RegExp that will be matched against file system
# modifications.
# When a watcher matches a change, an optional action block is executed to
# enabl... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/version.rb | lib/guard/version.rb | # frozen_string_literal: true
module Guard
VERSION = "3.0.0-rc1"
end
| ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/ui.rb | lib/guard/ui.rb | # frozen_string_literal: true
require "guard/ui/colors"
require "guard/ui/config"
require "guard/ui/logger_config"
require "guard/terminal"
require "forwardable"
# TODO: rework this class from the bottom-up
# - remove dependency on Session
# - extract into a separate gem
# - change UI to class
module Guard
# Th... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/group.rb | lib/guard/group.rb | # frozen_string_literal: true
module Guard
# A group of Guard plugins. There are two reasons why you want to group your
# Guard plugins:
#
# * You can start only certain groups from the command line by passing the
# `--group` option to `guard start`.
# * Abort task execution chain on failure within a gro... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/options.rb | lib/guard/options.rb | # frozen_string_literal: true
require "thor/core_ext/hash_with_indifferent_access"
module Guard
# @private
# A class that holds options. Can be instantiated with default options.
#
class Options < Thor::CoreExt::HashWithIndifferentAccess
# Initializes an Guard::Options object. `default_opts` is merged int... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/dsl_describer.rb | lib/guard/dsl_describer.rb | # frozen_string_literal: true
require "formatador"
require "guard/ui"
require "guard/notifier"
require "guard/plugin_util"
require "set"
module Guard
# @private
# The DslDescriber evaluates the Guardfile and creates an internal structure
# of it that is used in some inspection utility methods like the CLI com... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/plugin.rb | lib/guard/plugin.rb | # frozen_string_literal: true
require "guard/internals/groups"
require "guard/ui"
module Guard
# Base class from which every Guard plugin implementation must inherit.
#
# Guard will trigger the {#start}, {#stop}, {#reload}, {#run_all} and
# {#run_on_changes} ({#run_on_additions}, {#run_on_modifications} and
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/plugin_util.rb | lib/guard/plugin_util.rb | # frozen_string_literal: true
require "guard/guardfile/evaluator"
require "guard/plugin"
require "guard/ui"
module Guard
# @private
# This class contains useful methods to:
#
# * Fetch all the Guard plugins names;
# * Initialize a plugin, get its location;
# * Return its class name;
# * Add its template... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/rake_task.rb | lib/guard/rake_task.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
require "rake"
require "rake/tasklib"
require "guard/cli"
module Guard
# Provides a method to define a Rake task that
# runs the Guard plugins.
#
class RakeTask < ::Rake::TaskLib
# Name of the main, top level task
attr_accessor :name
# CLI option... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/dsl.rb | lib/guard/dsl.rb | # frozen_string_literal: true
require "guard/guardfile/result"
require "guard/ui"
require "guard/watcher"
module Guard
# @private
# The Dsl class provides the methods that are used in each `Guardfile` to
# describe the behaviour of Guard.
#
# The main keywords of the DSL are {#guard} and {#watch}. These are... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/runner.rb | lib/guard/runner.rb | # frozen_string_literal: true
require "lumberjack"
require "guard/ui"
require "guard/watcher"
module Guard
# @private
# The runner is responsible for running all methods defined on each plugin.
#
class Runner
def initialize(session)
@session = session
@plugins = session.plugins
end
#... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/terminal.rb | lib/guard/terminal.rb | # frozen_string_literal: true
require "shellany/sheller"
module Guard
# @private
class Terminal
class << self
def clear
cmd = Gem.win_platform? ? "cls" : "printf '\33c\e[3J';"
stat, _, stderr = Shellany::Sheller.system(cmd)
fail Errno::ENOENT, stderr unless stat.success?
en... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/cli.rb | lib/guard/cli.rb | # frozen_string_literal: true
require "thor"
require "guard/cli/environments/read_only"
require "guard/cli/environments/write"
require "guard/dsl_describer"
require "guard/engine"
require "guard/version"
module Guard
# Facade for the Guard command line interface managed by
# [Thor](https://github.com/wycats/thor... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/notifier.rb | lib/guard/notifier.rb | # frozen_string_literal: true
require "notiffany/notifier"
require "guard/ui"
module Guard
module Notifier
# @private
def self.connect(options = {})
@notifier ||= nil
fail "Already connected!" if @notifier
begin
opts = options.merge(namespace: "guard", logger: UI)
@notifie... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/test_helpers.rb | lib/guard/test_helpers.rb | # frozen_string_literal: true
require "guard/engine"
module Guard
# @private
module TestHelpers
extend self
def self.plugin_options
{ engine: Engine.new }
end
class Template
class Session
class MultipleGuardNotImplemented < RuntimeError
def message
"mult... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/config.rb | lib/guard/config.rb | # frozen_string_literal: true
require "nenv"
module Guard
config_class = Nenv::Builder.build do
create_method(:strict?)
create_method(:gem_silence_deprecations?)
end
# @private
class Config < config_class
def initialize
super "guard"
end
def silence_deprecations?
gem_silence_... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/interactor.rb | lib/guard/interactor.rb | # frozen_string_literal: true
require "forwardable"
require "guard/jobs/pry_wrapper"
require "guard/jobs/sleep"
module Guard
# @private
class Interactor
attr_reader :interactive
# Initializes the interactor. This configures
# Pry and creates some custom commands and aliases
# for Guard.
#
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/engine.rb | lib/guard/engine.rb | # frozen_string_literal: true
require "forwardable"
require "listen"
require "guard/dsl_describer"
require "guard/guardfile/evaluator"
require "guard/interactor"
require "guard/internals/helpers"
require "guard/internals/queue"
require "guard/internals/session"
require "guard/internals/traps"
require "guard/notifier"... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/jobs/base.rb | lib/guard/jobs/base.rb | # frozen_string_literal: true
module Guard
module Jobs
class Base
def initialize(engine, _options = {})
@engine = engine
end
# @return [Symbol] :continue once job is finished
# @return [Symbol] :exit to tell Guard to terminate
def foreground; end
def background; end
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/jobs/pry_wrapper.rb | lib/guard/jobs/pry_wrapper.rb | # frozen_string_literal: true
require "shellany/sheller"
require "guard/commands/all"
require "guard/commands/change"
require "guard/commands/notification"
require "guard/commands/pause"
require "guard/commands/reload"
require "guard/commands/scope"
require "guard/commands/show"
require "guard/jobs/base"
require "gua... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/jobs/sleep.rb | lib/guard/jobs/sleep.rb | # frozen_string_literal: true
require "guard/jobs/base"
require "guard/ui"
module Guard
module Jobs
class Sleep < Base
def foreground
UI.debug "Guards jobs done. Sleeping..."
sleep
UI.debug "Sleep interrupted by events."
:continue
rescue Interrupt
UI.debug "Sl... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/watcher/pattern.rb | lib/guard/watcher/pattern.rb | # frozen_string_literal: true
require "guard/ui"
require_relative "pattern/matcher"
require_relative "pattern/simple_path"
module Guard
class Watcher
# @private
class Pattern
def self.create(pattern)
case pattern
when String, Pathname
SimplePath.new(pattern)
else
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/watcher/pattern/simple_path.rb | lib/guard/watcher/pattern/simple_path.rb | # frozen_string_literal: true
module Guard
class Watcher
class Pattern
class SimplePath
def initialize(string_or_pathname)
@path = normalize(string_or_pathname)
end
def to_s
@path
end
alias_method :inspect, :to_s
def match(string_or_path... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/watcher/pattern/matcher.rb | lib/guard/watcher/pattern/matcher.rb | # frozen_string_literal: true
module Guard
class Watcher
class Pattern
class Matcher
attr_reader :matcher
def initialize(obj)
@matcher = obj
end
def to_s
matcher.to_s
end
alias_method :inspect, :to_s
# Compare with other matcher... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/watcher/pattern/match_result.rb | lib/guard/watcher/pattern/match_result.rb | # frozen_string_literal: true
module Guard
class Watcher
class Pattern
class MatchResult
def initialize(match_result, original_value)
@match_result = match_result
@original_value = original_value
end
def [](index)
return @match_result[index] if index.i... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/reload.rb | lib/guard/commands/reload.rb | # frozen_string_literal: true
require "pry"
module Guard
module Commands
class Reload
def self.import
Pry::Commands.create_command "reload" do
group "Guard"
description "Reload all plugins."
banner <<-BANNER
Usage: reload <scope>
Run the Guard pl... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/pause.rb | lib/guard/commands/pause.rb | # frozen_string_literal: true
require "pry"
module Guard
module Commands
class Pause
def self.import
Pry::Commands.create_command "pause" do
group "Guard"
description "Toggles the file listener."
banner <<-BANNER
Usage: pause
Toggles the file lis... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/change.rb | lib/guard/commands/change.rb | # frozen_string_literal: true
require "pry"
require "guard"
module Guard
module Commands
class Change
def self.import
Pry::Commands.create_command "change" do
group "Guard"
description "Trigger a file change."
banner <<-BANNER
Usage: change <file> <other_f... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/scope.rb | lib/guard/commands/scope.rb | # frozen_string_literal: true
require "pry"
module Guard
module Commands
class Scope
def self.import
Pry::Commands.create_command "scope" do
group "Guard"
description "Scope Guard actions to groups and plugins."
banner <<-BANNER
Usage: scope <scope>
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/notification.rb | lib/guard/commands/notification.rb | # frozen_string_literal: true
require "pry"
require "guard/notifier"
module Guard
module Commands
class Notification
def self.import
Pry::Commands.create_command "notification" do
group "Guard"
description "Toggles the notifications."
banner <<-BANNER
Usag... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/show.rb | lib/guard/commands/show.rb | # frozen_string_literal: true
require "pry"
module Guard
module Commands
class Show
def self.import
Pry::Commands.create_command "show" do
group "Guard"
description "Show all Guard plugins."
banner <<-BANNER
Usage: show
Show all defined Guard plu... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/commands/all.rb | lib/guard/commands/all.rb | # frozen_string_literal: true
require "pry"
module Guard
module Commands
class All
def self.import
Pry::Commands.create_command "all" do
group "Guard"
description "Run all plugins."
banner <<-BANNER
Usage: all <scope>
Run the Guard plugin `run_al... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/traps.rb | lib/guard/internals/traps.rb | # frozen_string_literal: true
module Guard
module Internals
module Traps
def self.handle(signal, &block)
return unless Signal.list.key?(signal)
Signal.trap(signal, &block)
end
end
end
end
| ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/plugins.rb | lib/guard/internals/plugins.rb | # frozen_string_literal: true
require "guard/plugin_util"
module Guard
# @private api
module Internals
class Plugins
def initialize
@plugins = []
end
def add(name, options)
PluginUtil.new(name).initialize_plugin(options).tap do |plugin|
@plugins << plugin
e... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/debugging.rb | lib/guard/internals/debugging.rb | # frozen_string_literal: true
# Because it's used by Sheller
require "open3"
require "logger"
require "guard/internals/tracing"
require "guard/ui"
module Guard
# @private api
module Internals
class Debugging
class << self
TRACES = [
[Kernel, :system],
[Kernel, :spawn],
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/groups.rb | lib/guard/internals/groups.rb | # frozen_string_literal: true
require "forwardable"
require "guard/group"
module Guard
# @private api
module Internals
class Groups
extend Forwardable
DEFAULT_GROUP = :default
def initialize
@groups = [Group.new(DEFAULT_GROUP)]
end
delegate each: :all
def all(f... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/session.rb | lib/guard/internals/session.rb | # frozen_string_literal: true
require "guard/options"
require "guard/internals/debugging"
require "guard/internals/plugins"
require "guard/internals/groups"
module Guard
# @private api
module Internals
# TODO: split into a commandline class and session (plugins, groups)
# TODO: swap session and metadata
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/queue.rb | lib/guard/internals/queue.rb | # frozen_string_literal: true
require "forwardable"
module Guard
module Internals
class Queue
extend Forwardable
delegate :<< => :queue
def initialize(engine, runner)
@engine = engine
@runner = runner
@queue = ::Queue.new
end
# Process the change queue, r... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/helpers.rb | lib/guard/internals/helpers.rb | # frozen_string_literal: true
module Guard
# @private api
module Internals
module Helpers
def _relative_pathnames(paths)
paths.map { |path| _relative_pathname(path) }
end
def _relative_pathname(path)
full_path = Pathname(path)
full_path.relative_path_from(Pathname.pwd... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/internals/tracing.rb | lib/guard/internals/tracing.rb | # frozen_string_literal: true
module Guard
module Internals
module Tracing
def self.trace(mod, meth)
meta = (class << mod; self; end)
original_meth = "original_#{meth}".to_sym
if mod.respond_to?(original_meth)
fail "ALREADY TRACED: #{mod}.#{meth}"
end
met... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/cli/environments/write.rb | lib/guard/cli/environments/write.rb | # frozen_string_literal: true
require "guard/cli/environments/base"
require "guard/guardfile/evaluator"
require "guard/guardfile/generator"
require "guard/ui"
module Guard
module Cli
module Environments
class Write < Base
def initialize_guardfile(
plugin_names = [],
evaluator: ... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/cli/environments/base.rb | lib/guard/cli/environments/base.rb | # frozen_string_literal: true
require "guard/ui"
module Guard
module Cli
module Environments
class Base
# Initialize a new Guard::Cli::Environments::Base object.
#
# @option options [Boolean] no_bundler_warning whether to show the "Bundler should be used" warning or not
#
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/cli/environments/read_only.rb | lib/guard/cli/environments/read_only.rb | # frozen_string_literal: true
require "guard/cli/environments/base"
require "guard/dsl"
require "guard/engine"
require "guard/guardfile/evaluator"
require "guard/ui"
module Guard
module Cli
module Environments
class ReadOnly < Base
def evaluate(evaluator: Guardfile::Evaluator.new(options))
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/guardfile/result.rb | lib/guard/guardfile/result.rb | # frozen_string_literal: true
require "guard/internals/groups"
module Guard
module Guardfile
# This class is responsible for storing the result of the Guardfile evaluation.
#
# @see Guard::Dsl
#
class Result
attr_accessor :clearing
def plugin_names
plugins.map(&:first).map(&... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/guardfile/generator.rb | lib/guard/guardfile/generator.rb | # frozen_string_literal: true
require "guard/plugin_util"
require "guard/ui"
module Guard
module Guardfile
# This class is responsible for generating the Guardfile and adding Guard'
# plugins' templates into it.
#
# @see Guard::CLI
#
class Generator
# @private
INFO_TEMPLATE_ADDED... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/guardfile/evaluator.rb | lib/guard/guardfile/evaluator.rb | # frozen_string_literal: true
require "guard/dsl"
require "guard/ui"
module Guard
module Guardfile
# This class is responsible for evaluating the Guardfile. It delegates to
# Guard::Dsl for the actual objects generation from the Guardfile content.
#
# @see Guard::Dsl
#
class Evaluator
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/ui/logger_config.rb | lib/guard/ui/logger_config.rb | # frozen_string_literal: true
require "logger"
require "guard/options"
module Guard
module UI
# @private
# Specific logger config.
class LoggerConfig < Guard::Options
DEFAULTS = {
progname: "Guard",
level: :info,
template: ":time - :severity - :message",
time_format... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/ui/config.rb | lib/guard/ui/config.rb | # frozen_string_literal: true
require "guard/options"
require "guard/ui"
module Guard
module UI
# @private
class Config < Guard::Options
DEFAULTS = {
only: nil,
except: nil,
# nil (will be whatever $stderr is later) or LumberJack device, e.g.
# $stderr or 'foo.log'
... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
guard/guard | https://github.com/guard/guard/blob/b20b7910245aee5cd4ee79fe8dc7984568afdbc4/lib/guard/ui/colors.rb | lib/guard/ui/colors.rb | # frozen_string_literal: true
module Guard
module UI
# @private
module Colors
# Brighten the color
ANSI_ESCAPE_BRIGHT = "1"
# Black foreground color
ANSI_ESCAPE_BLACK = "30"
# Red foreground color
ANSI_ESCAPE_RED = "31"
# Green foreground color
ANSI_ESCAPE_G... | ruby | MIT | b20b7910245aee5cd4ee79fe8dc7984568afdbc4 | 2026-01-04T15:40:13.883835Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/spec/integration_spec.rb | spec/integration_spec.rb | # frozen_string_literal: true
# ------------------------------------ #
# Jazzy Integration tests #
# ------------------------------------ #
#-----------------------------------------------------------------------------#
# The following integrations tests are based on file comparison.
#
# 1. For each te... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'bacon'
require 'mocha-on-bacon'
require 'pretty_bacon'
require 'pathname'
ROOT = Pathname.new(File.expand_path('..', __dir__))
$LOAD_PATH.unshift((ROOT + 'lib').to_s)
$LOAD_PATH.unshift((ROOT + 'spec').to_s)
require 'jazzy'
require 's... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/spec/spec_helper/pre_flight.rb | spec/spec_helper/pre_flight.rb | # frozen_string_literal: true
# Restores the config to the default state before each requirement
module Bacon
class Context
old_run_requirement = instance_method(:run_requirement)
define_method(:run_requirement) do |description, spec|
temporary_directory = SpecHelper.temporary_directory
::Jazz... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy.rb | lib/jazzy.rb | # frozen_string_literal: true
require 'jazzy/config'
require 'jazzy/doc_builder'
Encoding.default_external = Encoding::UTF_8
| ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/executable.rb | lib/jazzy/executable.rb | # frozen_string_literal: true
module Jazzy
module Executable
class IO < Array
def initialize(io = nil)
super()
@io = io
end
def <<(value)
super
ensure
@io << value.to_s if @io
end
def to_s
join("\n")
end
end
class << sel... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/jazzy_markdown.rb | lib/jazzy/jazzy_markdown.rb | # frozen_string_literal: true
require 'redcarpet'
require 'rouge'
require 'rouge/plugins/redcarpet'
module Jazzy
module Markdown
# Publish if generated HTML needs math support
class << self; attr_accessor :has_math; end
module Footnotes
# Global unique footnote ID
def self.next_footnote
... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/highlighter.rb | lib/jazzy/highlighter.rb | # frozen_string_literal: true
require 'rouge'
module Jazzy
# This module helps highlight code
module Highlighter
SWIFT = 'swift'
OBJC = 'objective_c'
class Formatter < Rouge::Formatters::HTML
def initialize(language)
@language = language
super()
end
def stream(token... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_document.rb | lib/jazzy/source_document.rb | # frozen_string_literal: true
require 'pathname'
require 'jazzy/jazzy_markdown'
module Jazzy
# Standalone markdown docs including index.html
class SourceDocument < SourceDeclaration
attr_accessor :overview
attr_accessor :readme_path
def initialize
super
self.children = []
self.para... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/docset_builder.rb | lib/jazzy/docset_builder.rb | # frozen_string_literal: true
require 'mustache'
require 'sqlite3'
module Jazzy
module DocBuilder
# Follows the instructions found at https://kapeli.com/docsets#dashDocset.
class DocsetBuilder
include Config::Mixin
attr_reader :output_dir
attr_reader :generated_docs_dir
attr_reader ... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/sourcekitten.rb | lib/jazzy/sourcekitten.rb | # frozen_string_literal: true
require 'json'
require 'pathname'
require 'shellwords'
require 'xcinvoke'
require 'cgi'
require 'rexml/document'
require 'jazzy/config'
require 'jazzy/executable'
require 'jazzy/highlighter'
require 'jazzy/source_declaration'
require 'jazzy/source_mark'
require 'jazzy/stats'
require 'jaz... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | true |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/documentation_generator.rb | lib/jazzy/documentation_generator.rb | # frozen_string_literal: true
require 'pathname'
require 'jazzy/jazzy_markdown'
require 'jazzy/source_document'
module Jazzy
module DocumentationGenerator
extend Config::Mixin
def self.source_docs
documentation_entries.map do |file_path|
SourceDocument.new.tap do |sd|
sd.name = Fil... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/doc.rb | lib/jazzy/doc.rb | # frozen_string_literal: true
require 'date'
require 'pathname'
require 'mustache'
require 'jazzy/config'
require 'jazzy/gem_version'
require 'jazzy/jazzy_markdown'
module Jazzy
class Doc < Mustache
include Config::Mixin
self.template_name = 'doc'
def copyright
copyright = config.copyright || (... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph.rb | lib/jazzy/symbol_graph.rb | # frozen_string_literal: true
require 'set'
require 'jazzy/symbol_graph/graph'
require 'jazzy/symbol_graph/constraint'
require 'jazzy/symbol_graph/symbol'
require 'jazzy/symbol_graph/relationship'
require 'jazzy/symbol_graph/sym_node'
require 'jazzy/symbol_graph/ext_node'
require 'jazzy/symbol_graph/ext_key'
# This i... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/grouper.rb | lib/jazzy/grouper.rb | # frozen_string_literal: true
module Jazzy
# This module deals with arranging top-level declarations and guides into
# groups automatically and/or using a custom list.
module Grouper
extend Config::Mixin
# Group root-level docs by custom categories (if any) and type or module
def self.group_docs(doc... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/podspec_documenter.rb | lib/jazzy/podspec_documenter.rb | # frozen_string_literal: true
require 'tmpdir'
require 'json'
module Jazzy
# rubocop:disable Metrics/ClassLength
class PodspecDocumenter
attr_reader :podspec
def initialize(podspec)
@podspec = podspec
end
# Build documentation from the given options
# @param [Config] options
def so... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/stats.rb | lib/jazzy/stats.rb | # frozen_string_literal: true
module Jazzy
# Collect + report metadata about a processed module
class Stats
include Config::Mixin
attr_reader :documented, :acl_skipped, :spi_skipped, :undocumented_decls
def add_documented
@documented += 1
end
def add_acl_skipped
@acl_skipped += 1... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_host.rb | lib/jazzy/source_host.rb | # frozen_string_literal: true
module Jazzy
# Deal with different source code repositories
module SourceHost
# Factory to create the right source host
def self.create(options)
return unless options.source_host_url || options.source_host_files_url
case options.source_host
when :github then... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/doc_builder.rb | lib/jazzy/doc_builder.rb | # frozen_string_literal: true
require 'fileutils'
require 'mustache'
require 'pathname'
require 'sassc'
require 'jazzy/config'
require 'jazzy/doc'
require 'jazzy/docset_builder'
require 'jazzy/documentation_generator'
require 'jazzy/search_builder'
require 'jazzy/jazzy_markdown'
require 'jazzy/podspec_documenter'
req... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_module.rb | lib/jazzy/source_module.rb | # frozen_string_literal: true
require 'uri'
require 'jazzy/config'
require 'jazzy/source_declaration'
require 'jazzy/source_host'
module Jazzy
# A cache of info that is common across all page templating, gathered
# from other parts of the program.
class SourceModule
include Config::Mixin
attr_accessor... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_mark.rb | lib/jazzy/source_mark.rb | # frozen_string_literal: true
module Jazzy
class SourceMark
attr_accessor :name
attr_accessor :has_start_dash
attr_accessor :has_end_dash
def initialize(mark_string = nil)
return unless mark_string
# Format: 'MARK: - NAME -' with dashes optional
mark_content = mark_string.sub(/^MA... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/search_builder.rb | lib/jazzy/search_builder.rb | # frozen_string_literal: true
module Jazzy
module SearchBuilder
def self.build(source_module, output_dir)
decls = source_module.all_declarations.select do |d|
d.type && d.name && !d.name.empty?
end
index = decls.to_h do |d|
[d.url,
{
name: d.name,
... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/doc_index.rb | lib/jazzy/doc_index.rb | # frozen_string_literal: true
module Jazzy
# This class stores an index of symbol names for doing name lookup
# when resolving custom categories and autolinks.
class DocIndex
# A node in the index tree. The root has no decl; its children are
# per-module indexed by module names. The second level, where... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_declaration.rb | lib/jazzy/source_declaration.rb | # frozen_string_literal: true
require 'jazzy/source_declaration/access_control_level'
require 'jazzy/source_declaration/type'
module Jazzy
# rubocop:disable Metrics/ClassLength
class SourceDeclaration
# kind of declaration (e.g. class, variable, function)
attr_accessor :type
# static type of declared ... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/config.rb | lib/jazzy/config.rb | # frozen_string_literal: true
require 'optparse'
require 'pathname'
require 'uri'
require 'jazzy/podspec_documenter'
require 'jazzy/source_declaration/access_control_level'
module Jazzy
# rubocop:disable Metrics/ClassLength
class Config
# rubocop:disable Naming/AccessorMethodName
class Attribute
at... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/gem_version.rb | lib/jazzy/gem_version.rb | # frozen_string_literal: true
module Jazzy
VERSION = '0.15.4' unless defined? Jazzy::VERSION
end
| ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_declaration/access_control_level.rb | lib/jazzy/source_declaration/access_control_level.rb | # frozen_string_literal: true
module Jazzy
class SourceDeclaration
class AccessControlLevel
include Comparable
# Order matters
LEVELS = %i[private fileprivate internal package public open].freeze
LEVELS_INDEX = LEVELS.to_h { |i| [i, LEVELS.index(i)] }.freeze
attr_reader :level
... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/source_declaration/type.rb | lib/jazzy/source_declaration/type.rb | # frozen_string_literal: true
require 'logger'
require 'active_support'
require 'active_support/inflector'
module Jazzy
class SourceDeclaration
# rubocop:disable Metrics/ClassLength
class Type
def self.all
TYPES.keys.map { |k| new(k) }.reject { |t| t.name.nil? }
end
attr_reader :k... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/graph.rb | lib/jazzy/symbol_graph/graph.rb | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
module Jazzy
module SymbolGraph
# A Graph is the coordinator to import a symbolgraph json file.
# Deserialize it to Symbols and Relationships, then rebuild
# the AST shape using SymNodes and ExtNodes and extract SourceKit json.
class... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/relationship.rb | lib/jazzy/symbol_graph/relationship.rb | # frozen_string_literal: true
module Jazzy
module SymbolGraph
# A Relationship is a tidied-up SymbolGraph JSON object
class Relationship
attr_accessor :kind
attr_accessor :source_usr
attr_accessor :target_usr
attr_accessor :target_fallback # can be nil
attr_accessor :constraints... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/sym_node.rb | lib/jazzy/symbol_graph/sym_node.rb | # frozen_string_literal: true
module Jazzy
module SymbolGraph
# The rebuilt syntax tree is made of nodes that either match
# symbols or that we fabricate for extensions. This is the common
# treeishness.
class BaseNode
attr_accessor :children # array, can be empty
attr_accessor :parent #... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/constraint.rb | lib/jazzy/symbol_graph/constraint.rb | # frozen_string_literal: true
module Jazzy
module SymbolGraph
# Constraint is a tidied-up JSON object, used by both Symbol and
# Relationship, and key to reconstructing extensions.
class Constraint
attr_accessor :kind
attr_accessor :lhs
attr_accessor :rhs
private
def initi... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/ext_node.rb | lib/jazzy/symbol_graph/ext_node.rb | # frozen_string_literal: true
require 'set'
module Jazzy
module SymbolGraph
# For extensions we need to track constraints of the extended type
# and the constraints introduced by the extension.
class ExtConstraints
attr_accessor :type # array
attr_accessor :ext # array
# all constrain... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.