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 |
|---|---|---|---|---|---|---|---|---|
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/checksum_collection.rb | nanoc-core/lib/nanoc/core/checksum_collection.rb | # frozen_string_literal: true
module Nanoc
module Core
class ChecksumCollection
include Nanoc::Core::ContractsSupport
c_obj = C::Or[Nanoc::Core::Item, Nanoc::Core::Layout, Nanoc::Core::Configuration, Nanoc::Core::CodeSnippet]
def initialize(checksums)
@checksums = checksums
@... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/binary_compiled_content_cache.rb | nanoc-core/lib/nanoc/core/binary_compiled_content_cache.rb | # frozen_string_literal: true
module Nanoc
module Core
# Represents a cache than can be used to store already compiled content,
# to prevent it from being needlessly recompiled.
#
# @api private
class BinaryCompiledContentCache < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/processing_action.rb | nanoc-core/lib/nanoc/core/processing_action.rb | # frozen_string_literal: true
module Nanoc
module Core
class ProcessingAction
def serialize
raise NotImplementedError.new('Nanoc::ProcessingAction subclasses must implement #serialize and #to_s')
end
def to_s
raise NotImplementedError.new('Nanoc::ProcessingAction subclasses mus... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/view_context_for_pre_compilation.rb | nanoc-core/lib/nanoc/core/view_context_for_pre_compilation.rb | # frozen_string_literal: true
module Nanoc
module Core
class ViewContextForPreCompilation
include Nanoc::Core::ContractsSupport
attr_reader :items
attr_reader :dependency_tracker
contract C::KeywordArgs[items: Nanoc::Core::IdentifiableCollection] => C::Any
def initialize(items:)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/prefixed_data_source.rb | nanoc-core/lib/nanoc/core/prefixed_data_source.rb | # frozen_string_literal: true
module Nanoc
module Core
class PrefixedDataSource < Nanoc::Core::DataSource
def initialize(data_source, items_prefix, layouts_prefix)
super({}, '/', '/', {})
@data_source = data_source
@items_prefix = items_prefix
@layouts_prefix = layouts_pref... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/layout_collection.rb | nanoc-core/lib/nanoc/core/layout_collection.rb | # frozen_string_literal: true
module Nanoc
module Core
class LayoutCollection < IdentifiableCollection
prepend MemoWise
def initialize(config, objects = [])
initialize_basic(config, objects, 'layouts')
end
def reference
'layouts'
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/mutable_document_view_mixin.rb | nanoc-core/lib/nanoc/core/mutable_document_view_mixin.rb | # frozen_string_literal: true
module Nanoc
module Core
module MutableDocumentViewMixin
# @api private
class DisallowedAttributeValueError < Nanoc::Core::Error
attr_reader :value
def initialize(value)
@value = value
end
def message
"The #{value.cla... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/filter.rb | nanoc-core/lib/nanoc/core/filter.rb | # frozen_string_literal: true
module Nanoc
module Core
# Nanoc::Core::Filter is responsible for filtering items. It is the superclass
# for all textual filters.
#
# A filter instance should only be used once. Filters should not be reused
# since they store state.
#
# When creating a filte... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/view.rb | nanoc-core/lib/nanoc/core/view.rb | # frozen_string_literal: true
module Nanoc
module Core
class View
include Nanoc::Core::ContractsSupport
# @api private
# TODO: disallow nil
contract C::Maybe[C::Or[
Nanoc::Core::ViewContextForCompilation,
Nanoc::Core::ViewContextForPreCompilation,
Nanoc::Core::Vie... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/toml_loader.rb | nanoc-core/lib/nanoc/core/toml_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
module TomlLoader
def self.load(string)
require 'perfect_toml'
PerfectTOML.parse(string)
end
def self.load_file(filename)
require 'perfect_toml'
load(File.read(filename))
end
end... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/utils.rb | nanoc-core/lib/nanoc/core/utils.rb | # frozen_string_literal: true
# .sub(/^[A-Z]:/,'')
module Nanoc
module Core
# Utilities that don’t fit anywhere else.
#
# @api private
module Utils
# Same as File.expand_path, but does not add a drive identifier on
# Windows. This is necessary in case the path is a Nanoc path, rather tha... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/snapshot_def.rb | nanoc-core/lib/nanoc/core/snapshot_def.rb | # frozen_string_literal: true
module Nanoc
module Core
class SnapshotDef
include Nanoc::Core::ContractsSupport
attr_reader :name
attr_reader :binary
contract Symbol, C::KeywordArgs[binary: C::Optional[C::Bool]] => C::Any
def initialize(name, binary:)
@name = name
@... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/config_loader.rb | nanoc-core/lib/nanoc/core/config_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class ConfigLoader
class NoConfigFileFoundError < ::Nanoc::Core::Error
def initialize
super('No configuration file found')
end
end
class NoParentConfigFileFoundError < ::Nanoc::Core::Error
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/binary_content.rb | nanoc-core/lib/nanoc/core/binary_content.rb | # frozen_string_literal: true
module Nanoc
module Core
class BinaryContent < Content
contract C::None => C::Bool
def binary?
true
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/changes_stream.rb | nanoc-core/lib/nanoc/core/changes_stream.rb | # frozen_string_literal: true
module Nanoc
module Core
class ChangesStream
class ChangesListener
def initialize(y)
@y = y
end
def unknown
@y << :unknown
end
def lib
@y << :lib
end
def to_stop(&block)
if block... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/store.rb | nanoc-core/lib/nanoc/core/store.rb | # frozen_string_literal: true
module Nanoc
module Core
# An abstract superclass for classes that need to store data to the
# filesystem, such as checksums, cached compiled content and dependency
# graphs.
#
# Each store has a version number. When attempting to load data from a store
# that ha... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compiled_content_cache.rb | nanoc-core/lib/nanoc/core/compiled_content_cache.rb | # frozen_string_literal: true
module Nanoc
module Core
# Represents a cache than can be used to store already compiled content,
# to prevent it from being needlessly recompiled.
#
# @api private
class CompiledContentCache < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/checksummer.rb | nanoc-core/lib/nanoc/core/checksummer.rb | # frozen_string_literal: true
module Nanoc
module Core
# Creates checksums for given objects.
#
# A checksum is a string, such as “mL+TaqNsEeiPkWloPgCtAofT1yg=”, that is used
# to determine whether a piece of data has changed.
class Checksummer
class VerboseDigest
def initialize
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/feature.rb | nanoc-core/lib/nanoc/core/feature.rb | # frozen_string_literal: true
module Nanoc
module Core
# @example Defining a feature and checking its enabledness
#
# Nanoc::Core::Feature.define('environments', version: '4.3')
# Nanoc::Core::Feature.enabled?(Nanoc::Core::Feature::ENVIRONMENTS)
#
module Feature
# Defines a new ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/regexp_pattern.rb | nanoc-core/lib/nanoc/core/regexp_pattern.rb | # frozen_string_literal: true
module Nanoc
module Core
class RegexpPattern < Pattern
contract Regexp => C::Any
def initialize(regexp)
@regexp = regexp
end
contract C::Or[Nanoc::Core::Identifier, String] => C::Bool
def match?(identifier)
(identifier.to_s =~ @regexp) ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/processing_actions.rb | nanoc-core/lib/nanoc/core/processing_actions.rb | # frozen_string_literal: true
module Nanoc
module Core
module ProcessingActions
end
end
end
require 'nanoc/core/processing_actions/filter'
require 'nanoc/core/processing_actions/layout'
require 'nanoc/core/processing_actions/snapshot'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_context.rb | nanoc-core/lib/nanoc/core/compilation_context.rb | # frozen_string_literal: true
module Nanoc
module Core
class CompilationContext
class FilterNameAndArgs
include Nanoc::Core::ContractsSupport
attr_reader :name
attr_reader :args
contract C::KeywordArgs[name: C::Maybe[Symbol], args: Hash] => C::Any
def initialize(na... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/view_context_for_shell.rb | nanoc-core/lib/nanoc/core/view_context_for_shell.rb | # frozen_string_literal: true
module Nanoc
module Core
class ViewContextForShell
include Nanoc::Core::ContractsSupport
attr_reader :items
attr_reader :reps
attr_reader :dependency_tracker
contract C::KeywordArgs[
items: Nanoc::Core::IdentifiableCollection,
reps: Na... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/aggregate_data_source.rb | nanoc-core/lib/nanoc/core/aggregate_data_source.rb | # frozen_string_literal: true
module Nanoc
module Core
class AggregateDataSource < ::Nanoc::Core::DataSource
def initialize(data_sources, config)
super({}, '/', '/', {})
@data_sources = data_sources
@config = config
end
def items
@_items ||= begin
obj... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/dependency_tracker.rb | nanoc-core/lib/nanoc/core/dependency_tracker.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class DependencyTracker
include Nanoc::Core::ContractsSupport
C_OBJ =
C::Or[
Nanoc::Core::Item,
Nanoc::Core::Layout,
Nanoc::Core::Configuration,
Nanoc::Core::IdentifiableCollecti... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/trivial_error.rb | nanoc-core/lib/nanoc/core/trivial_error.rb | # frozen_string_literal: true
module Nanoc
module Core
# Generic trivial error. Superclass for all Nanoc-specific errors that are
# considered "trivial", i.e. errors that do not require a full crash report.
class TrivialError < ::Nanoc::Core::Error
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_rep_selector.rb | nanoc-core/lib/nanoc/core/item_rep_selector.rb | # frozen_string_literal: true
module Nanoc
module Core
# Yields item reps to compile.
class ItemRepSelector
def initialize(outdated_reps:, reps:, dependency_store:)
@outdated_reps = outdated_reps
@reps = reps
@dependency_store = dependency_store
end
# A priority que... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/configuration.rb | nanoc-core/lib/nanoc/core/configuration.rb | # frozen_string_literal: true
module Nanoc
module Core
# Represents the site configuration.
class Configuration
include Nanoc::Core::ContractsSupport
# The default configuration for a data source. A data source's
# configuration overrides these options.
DEFAULT_DATA_SOURCE_CONFIG = {... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/identifiable_collection.rb | nanoc-core/lib/nanoc/core/identifiable_collection.rb | # frozen_string_literal: true
module Nanoc
module Core
class IdentifiableCollection
prepend MemoWise
# include Nanoc::Core::ContractsSupport
include Enumerable
extend Forwardable
def_delegator :@objects, :each
def_delegator :@objects, :size
def initialize
rai... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/textual_compiled_content_cache.rb | nanoc-core/lib/nanoc/core/textual_compiled_content_cache.rb | # frozen_string_literal: true
module Nanoc
module Core
# Represents a cache than can be used to store already compiled content,
# to prevent it from being needlessly recompiled.
#
# @api private
class TextualCompiledContentCache < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/action_sequence.rb | nanoc-core/lib/nanoc/core/action_sequence.rb | # frozen_string_literal: true
module Nanoc
module Core
class ActionSequence
# include Nanoc::Core::ContractsSupport
include Enumerable
prepend MemoWise
attr_reader :actions
def initialize(actions: [])
@actions = actions
end
# contract C::None => Numeric
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/textual_content.rb | nanoc-core/lib/nanoc/core/textual_content.rb | # frozen_string_literal: true
module Nanoc
module Core
class TextualContent < Content
contract C::Or[String, Proc], C::KeywordArgs[filename: C::Optional[C::Maybe[String]]] => C::Any
def initialize(string, filename: nil)
super(filename)
@string = Nanoc::Core::LazyValue.new(string)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/contracts_support.rb | nanoc-core/lib/nanoc/core/contracts_support.rb | # frozen_string_literal: true
module Nanoc
module Core
module ContractsSupport
class Ignorer
include Singleton
def method_missing(*_args)
self
end
def respond_to_missing?(*_args)
true
end
end
module DisabledContracts
Any ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/pruner.rb | nanoc-core/lib/nanoc/core/pruner.rb | # frozen_string_literal: true
module Nanoc
module Core
# Responsible for finding and deleting files in the site’s output directory
# that are not managed by Nanoc.
class Pruner
include Nanoc::Core::ContractsSupport
contract Nanoc::Core::Configuration, Nanoc::Core::ItemRepRepo, C::KeywordArgs... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/action_provider.rb | nanoc-core/lib/nanoc/core/action_provider.rb | # frozen_string_literal: true
module Nanoc
module Core
# @private
class ActionProvider
extend DDPlugin::Plugin
def self.for(_site)
raise NotImplementedError
end
def rep_names_for(_item)
raise NotImplementedError
end
def action_sequence_for(_obj)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/view_context_for_compilation.rb | nanoc-core/lib/nanoc/core/view_context_for_compilation.rb | # frozen_string_literal: true
module Nanoc
module Core
class ViewContextForCompilation
include Nanoc::Core::ContractsSupport
attr_reader :reps
attr_reader :items
attr_reader :dependency_tracker
attr_reader :compilation_context
attr_reader :compiled_content_repo
contrac... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_rep_writer.rb | nanoc-core/lib/nanoc/core/item_rep_writer.rb | # frozen_string_literal: true
module Nanoc
module Core
class ItemRepWriter
include Nanoc::Core::ContractsSupport
include Nanoc::Core::Assertions::Mixin
TMP_TEXT_ITEMS_DIR = 'text_items'
def write_all(item_rep, compiled_content_repo)
written_paths = Set.new
item_rep.snap... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_reasons.rb | nanoc-core/lib/nanoc/core/outdatedness_reasons.rb | # frozen_string_literal: true
module Nanoc
module Core
# Module that contains all outdatedness reasons.
#
# @api private
module OutdatednessReasons
# A generic outdatedness reason. An outdatedness reason is basically a
# descriptive message that explains why a given object is outdated.
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_status.rb | nanoc-core/lib/nanoc/core/outdatedness_status.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class OutdatednessStatus
attr_reader :reasons
attr_reader :props
def initialize(reasons: [], props: Nanoc::Core::DependencyProps.new)
@reasons = reasons
@props = props
end
def useful_to_apply... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/pattern.rb | nanoc-core/lib/nanoc/core/pattern.rb | # frozen_string_literal: true
module Nanoc
module Core
class Pattern
include Nanoc::Core::ContractsSupport
contract C::Any => self
def self.from(obj)
case obj
when Nanoc::Core::StringPattern, Nanoc::Core::RegexpPattern
obj
when String
Nanoc::Core::St... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/action_sequence_builder.rb | nanoc-core/lib/nanoc/core/action_sequence_builder.rb | # frozen_string_literal: true
module Nanoc
module Core
class ActionSequenceBuilder
include Nanoc::Core::ContractsSupport
# Error that is raised when a snapshot with an existing name is made.
class CannotCreateMultipleSnapshotsWithSameNameError < ::Nanoc::Core::Error
include Nanoc::Core... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/yaml_loader.rb | nanoc-core/lib/nanoc/core/yaml_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
module YamlLoader
OPTIONS = {
permitted_classes: [Symbol, Date, Time].freeze,
aliases: true,
}.freeze
private_constant :OPTIONS
def self.load(string)
YAML.safe_load(string, **OPTIONS)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_rep_builder.rb | nanoc-core/lib/nanoc/core/item_rep_builder.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class ItemRepBuilder
include Nanoc::Core::ContractsSupport
contract Nanoc::Core::ActionSequence, Nanoc::Core::ItemRep => C::ArrayOf[Nanoc::Core::SnapshotDef]
def self.snapshot_defs_for(action_sequence, rep)
is_bi... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_store.rb | nanoc-core/lib/nanoc/core/outdatedness_store.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class OutdatednessStore < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
contract C::KeywordArgs[config: Nanoc::Core::Configuration] => C::Any
def initialize(config:)
super(Nanoc::Core::Store.tmp_path... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/lazy_value.rb | nanoc-core/lib/nanoc/core/lazy_value.rb | # frozen_string_literal: true
module Nanoc
module Core
# Holds a value that might be generated lazily.
class LazyValue
include Nanoc::Core::ContractsSupport
# Takes a value or a proc to generate the value
def initialize(value_or_proc)
@value = { raw: value_or_proc }
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/site_loader.rb | nanoc-core/lib/nanoc/core/site_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
class SiteLoader
ENCODING_REGEX = /\A#\s+(-\*-\s+)?(en)?coding: (?<encoding>[^\s]+)(\s+-\*-\s*)?\n{0,2}/
# @return [Boolean]
def self.cwd_is_nanoc_site?
Nanoc::Core::ConfigLoader.cwd_is_nanoc_site?
end
def new_from_cwd
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/basic_outdatedness_checker.rb | nanoc-core/lib/nanoc/core/basic_outdatedness_checker.rb | # frozen_string_literal: true
module Nanoc
module Core
class BasicOutdatednessChecker
include Nanoc::Core::ContractsSupport
attr_reader :site
attr_reader :checksum_store
attr_reader :checksums
attr_reader :dependency_store
attr_reader :action_sequence_store
attr_reader ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/context.rb | nanoc-core/lib/nanoc/core/context.rb | # frozen_string_literal: true
module Nanoc
module Core
# Provides a context and a binding for use in filters such as the ERB and
# Haml ones.
class Context
# Creates a new context based off the contents of the hash.
#
# Each pair in the hash will be converted to an instance variable and... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stage.rb | nanoc-core/lib/nanoc/core/compilation_stage.rb | # frozen_string_literal: true
module Nanoc
module Core
class CompilationStage
def call(*args)
notify(:stage_started)
res = Nanoc::Core::Instrumentor.call(:stage_ran, self.class) do
run(*args)
end
notify(:stage_ended)
res
rescue
notify(:stage_a... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_checker.rb | nanoc-core/lib/nanoc/core/outdatedness_checker.rb | # frozen_string_literal: true
module Nanoc
module Core
# Responsible for determining whether an item or a layout is outdated.
#
# @api private
class OutdatednessChecker
include Nanoc::Core::ContractsSupport
attr_reader :checksum_store
attr_reader :checksums
attr_reader :depen... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/document_view_mixin.rb | nanoc-core/lib/nanoc/core/document_view_mixin.rb | # frozen_string_literal: true
module Nanoc
module Core
module DocumentViewMixin
# @api private
def initialize(document, context)
super(context)
@document = document
end
# @api private
def _unwrap
@document
end
# @see Object#==
def ==(other... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_rep_repo.rb | nanoc-core/lib/nanoc/core/item_rep_repo.rb | # frozen_string_literal: true
module Nanoc
module Core
# Stores item reps (in memory).
#
# @api private
class ItemRepRepo
include Enumerable
def initialize
@reps = []
@reps_by_item = {}
end
def <<(rep)
@reps << rep
@reps_by_item[rep.item] ||=... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/executor.rb | nanoc-core/lib/nanoc/core/executor.rb | # frozen_string_literal: true
module Nanoc
module Core
class Executor
def initialize(rep, compilation_context, dependency_tracker)
@rep = rep
@compilation_context = compilation_context
@dependency_tracker = dependency_tracker
end
def filter(filter_name, filter_args = {}... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/dependency_props.rb | nanoc-core/lib/nanoc/core/dependency_props.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class DependencyProps
include Nanoc::Core::ContractsSupport
attr_reader :attributes
attr_reader :raw_content
# TODO: Split raw_content for documents and collections
C_RAW_CONTENT =
C::Or[
C... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/in_memory_data_source.rb | nanoc-core/lib/nanoc/core/in_memory_data_source.rb | # frozen_string_literal: true
module Nanoc
module Core
class InMemoryDataSource < Nanoc::Core::DataSource
include Nanoc::Core::ContractsSupport
attr_reader :items
attr_reader :layouts
contract Nanoc::Core::ItemCollection, Nanoc::Core::LayoutCollection, C::Maybe[Nanoc::Core::DataSource] ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/dependency.rb | nanoc-core/lib/nanoc/core/dependency.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
# A dependency between two items/layouts.
class Dependency
include Nanoc::Core::ContractsSupport
C_OBJ_FROM = C::Or[Nanoc::Core::Item, Nanoc::Core::Layout, Nanoc::Core::Configuration, Nanoc::Core::IdentifiableCollection]
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/checksum_store.rb | nanoc-core/lib/nanoc/core/checksum_store.rb | # frozen_string_literal: true
module Nanoc
module Core
# Stores checksums for objects in order to be able to detect whether a file
# has changed since the last site compilation.
#
# @api private
class ChecksumStore < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
attr_wri... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rule.rb | nanoc-core/lib/nanoc/core/outdatedness_rule.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class OutdatednessRule
include Nanoc::Core::ContractsSupport
include Singleton
def self.affects_path?
@affects_path
end
def self.affects_attributes?
@affects_attributes
end
def s... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/directed_graph.rb | nanoc-core/lib/nanoc/core/directed_graph.rb | # frozen_string_literal: true
module Nanoc
module Core
# Represents a directed graph. It is used by the dependency tracker for
# storing and querying dependencies between items.
#
# @example Creating and using a directed graph
#
# # Create a graph with three vertices
# graph = Nanoc::... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_collection.rb | nanoc-core/lib/nanoc/core/item_collection.rb | # frozen_string_literal: true
module Nanoc
module Core
class ItemCollection < IdentifiableCollection
prepend MemoWise
def initialize(config, objects = [])
initialize_basic(config, objects, 'items')
end
def reference
'items'
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/error.rb | nanoc-core/lib/nanoc/core/error.rb | # frozen_string_literal: true
module Nanoc
module Core
# Generic error. Superclass for all Nanoc-specific errors.
class Error < ::StandardError
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/layout.rb | nanoc-core/lib/nanoc/core/layout.rb | # frozen_string_literal: true
module Nanoc
module Core
class Layout < ::Nanoc::Core::Document
def reference
@_reference ||= "layout:#{identifier}"
end
def identifier=(new_identifier)
super
# Invalidate memoization cache
@_reference = nil
end
end
end... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/notification_center.rb | nanoc-core/lib/nanoc/core/notification_center.rb | # frozen_string_literal: true
module Nanoc
module Core
# Provides a way to send notifications between objects. It allows blocks
# associated with a certain notification name to be registered; these blocks
# will be called when the notification with the given name is posted.
#
# It is a slightly d... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/temp_filename_factory.rb | nanoc-core/lib/nanoc/core/temp_filename_factory.rb | # frozen_string_literal: true
module Nanoc
module Core
class TempFilenameFactory
# @return [String] The root directory for all temporary filenames
attr_reader :root_dir
# @return [Nanoc::Core::TempFilenameFactory] A common instance
def self.instance
@_instance ||= new
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/document.rb | nanoc-core/lib/nanoc/core/document.rb | # frozen_string_literal: true
module Nanoc
module Core
class Document
include Nanoc::Core::ContractsSupport
# @return [Nanoc::Core::Content]
attr_reader :content
# @return [Nanoc::Core::Identifier]
attr_reader :identifier
# @return [String, nil]
attr_accessor :checksu... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/item_rep_router.rb | nanoc-core/lib/nanoc/core/item_rep_router.rb | # frozen_string_literal: true
module Nanoc
module Core
# Assigns paths to reps.
#
# @api private
class ItemRepRouter
include Nanoc::Core::ContractsSupport
class IdenticalRoutesError < ::Nanoc::Core::Error
def initialize(output_path, rep_a, rep_b)
super("The item represe... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/site.rb | nanoc-core/lib/nanoc/core/site.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class Site
# Error that is raised when multiple items or layouts with the same identifier exist.
class DuplicateIdentifierError < ::Nanoc::Core::Error
def initialize(identifier, type)
super("There are multiple... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/rules_modified.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/rules_modified.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class RulesModified < Nanoc::Core::OutdatednessRule
affects_props :compiled_content, :path
def apply(obj, basic_outdatedness_checker)
# Check rules of obj itself
if rules_modified?(obj, basi... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/item_added.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/item_added.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class ItemAdded < Nanoc::Core::OutdatednessRule
affects_props :raw_content
contract Nanoc::Core::ItemRep, C::Named['Nanoc::Core::BasicOutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic]... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/uses_always_outdated_filter.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/uses_always_outdated_filter.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class UsesAlwaysOutdatedFilter < Nanoc::Core::OutdatednessRule
affects_props :raw_content, :attributes, :path
def apply(obj, basic_outdatedness_checker)
seq = basic_outdatedness_checker.action_sequenc... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/content_modified.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/content_modified.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class ContentModified < Nanoc::Core::OutdatednessRule
affects_props :raw_content, :compiled_content
def apply(obj, basic_outdatedness_checker)
obj = obj.item if obj.is_a?(Nanoc::Core::ItemRep)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/not_written.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/not_written.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class NotWritten < Nanoc::Core::OutdatednessRule
affects_props :raw_content, :attributes, :compiled_content, :path
def apply(obj, basic_outdatedness_checker)
if obj.raw_paths.values.flatten.compact.an... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/code_snippets_modified.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/code_snippets_modified.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class CodeSnippetsModified < Nanoc::Core::OutdatednessRule
prepend MemoWise
# include Nanoc::Core::ContractsSupport
affects_props :raw_content, :attributes, :compiled_content, :path
def apply(... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/layout_added.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/layout_added.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class LayoutAdded < Nanoc::Core::OutdatednessRule
affects_props :raw_content
contract Nanoc::Core::Layout, C::Named['Nanoc::Core::BasicOutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/outdatedness_rules/attributes_modified.rb | nanoc-core/lib/nanoc/core/outdatedness_rules/attributes_modified.rb | # frozen_string_literal: true
module Nanoc
module Core
module OutdatednessRules
class AttributesModified < Nanoc::Core::OutdatednessRule
include Nanoc::Core::ContractsSupport
affects_props :attributes, :compiled_content
contract C::Or[Nanoc::Core::ItemRep, Nanoc::Core::Item, Nanoc... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/processing_actions/filter.rb | nanoc-core/lib/nanoc/core/processing_actions/filter.rb | # frozen_string_literal: true
module Nanoc
module Core
module ProcessingActions
class Filter < Nanoc::Core::ProcessingAction
# TODO: rename params to args
# filter :foo
# filter :foo, params
attr_reader :filter_name
attr_reader :params
def initialize(filte... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/processing_actions/snapshot.rb | nanoc-core/lib/nanoc/core/processing_actions/snapshot.rb | # frozen_string_literal: true
module Nanoc
module Core
module ProcessingActions
class Snapshot < Nanoc::Core::ProcessingAction
# snapshot :before_layout
# snapshot :before_layout, path: '/about.md'
include Nanoc::Core::ContractsSupport
attr_reader :snapshot_names
a... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/processing_actions/layout.rb | nanoc-core/lib/nanoc/core/processing_actions/layout.rb | # frozen_string_literal: true
module Nanoc
module Core
module ProcessingActions
class Layout < Nanoc::Core::ProcessingAction
# layout '/foo.erb'
# layout '/foo.erb', params
attr_reader :layout_identifier
attr_reader :params
def initialize(layout_identifier, params)... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/determine_outdatedness.rb | nanoc-core/lib/nanoc/core/compilation_stages/determine_outdatedness.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class DetermineOutdatedness < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(reps:, outdatedness_checker:, outdatedness_store:)
@reps = reps
@outdatedness... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/load_stores.rb | nanoc-core/lib/nanoc/core/compilation_stages/load_stores.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class LoadStores < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(checksum_store:, compiled_content_cache:, dependency_store:, action_sequence_store:, outdatedness_store:)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/store_post_compilation_state.rb | nanoc-core/lib/nanoc/core/compilation_stages/store_post_compilation_state.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class StorePostCompilationState < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(dependency_store:)
@dependency_store = dependency_store
end
contra... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/forget_outdated_dependencies.rb | nanoc-core/lib/nanoc/core/compilation_stages/forget_outdated_dependencies.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class ForgetOutdatedDependencies < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(dependency_store:)
@dependency_store = dependency_store
end
contr... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/cleanup.rb | nanoc-core/lib/nanoc/core/compilation_stages/cleanup.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class Cleanup < Nanoc::Core::CompilationStage
def initialize(output_dirs)
@output_dirs = output_dirs
end
def run
cleanup_temps(Nanoc::Core::Filter::TMP_BINARY_ITEMS_DIR)
cl... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/calculate_checksums.rb | nanoc-core/lib/nanoc/core/compilation_stages/calculate_checksums.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class CalculateChecksums < Nanoc::Core::CompilationStage
def initialize(items:, layouts:, code_snippets:, config:)
@items = items
@layouts = layouts
@code_snippets = code_snippets
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/store_pre_compilation_state.rb | nanoc-core/lib/nanoc/core/compilation_stages/store_pre_compilation_state.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class StorePreCompilationState < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(reps:, layouts:, checksum_store:, action_sequence_store:, action_sequences:)
@reps =... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/prune.rb | nanoc-core/lib/nanoc/core/compilation_stages/prune.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class Prune < Nanoc::Core::CompilationStage
def initialize(config:, reps:)
@config = config
@reps = reps
end
def run
if @config[:prune][:auto_prune]
Nanoc::Core... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/build_reps.rb | nanoc-core/lib/nanoc/core/compilation_stages/build_reps.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class BuildReps < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
contract C::KeywordArgs[site: Nanoc::Core::Site, action_provider: Nanoc::Core::ActionProvider] => C::Any
def initial... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/compile_reps.rb | nanoc-core/lib/nanoc/core/compilation_stages/compile_reps.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class CompileReps < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
include Nanoc::Core::Assertions::Mixin
def initialize(reps:, outdatedness_store:, dependency_store:, action_sequen... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/postprocess.rb | nanoc-core/lib/nanoc/core/compilation_stages/postprocess.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class Postprocess < Nanoc::Core::CompilationStage
include Nanoc::Core::ContractsSupport
def initialize(action_provider:, site:)
@action_provider = action_provider
@site = site
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_stages/preprocess.rb | nanoc-core/lib/nanoc/core/compilation_stages/preprocess.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationStages
class Preprocess < Nanoc::Core::CompilationStage
def initialize(action_provider:, site:, dependency_store:, checksum_store:)
@action_provider = action_provider
@site = site
@dependency_stor... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/core_ext/array.rb | nanoc-core/lib/nanoc/core/core_ext/array.rb | # frozen_string_literal: true
module Nanoc
module Core
module CoreExt
module ArrayExtensions
# Returns a new array where all items' keys are recursively converted to
# symbols by calling {Nanoc::ArrayExtensions#__nanoc_symbolize_keys_recursively} or
# {Nanoc::HashExtensions#__nanoc_... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/core_ext/string.rb | nanoc-core/lib/nanoc/core/core_ext/string.rb | # frozen_string_literal: true
module Nanoc
module Core
module CoreExt
module StringExtensions
# Transforms string into an actual identifier
#
# @return [String] The identifier generated from the receiver
def __nanoc_cleaned_identifier
"/#{self}/".gsub(%r{^/+|/+$}, ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/core_ext/hash.rb | nanoc-core/lib/nanoc/core/core_ext/hash.rb | # frozen_string_literal: true
module Nanoc
module Core
module CoreExt
module HashExtensions
# Returns a new hash where all keys are recursively converted to symbols by
# calling {Nanoc::ArrayExtensions#__nanoc_symbolize_keys_recursively} or
# {Nanoc::HashExtensions#__nanoc_symbolize... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/compilation_item_view.rb | nanoc-core/lib/nanoc/core/views/compilation_item_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class CompilationItemView < ::Nanoc::Core::BasicItemView
# Returns the compiled content.
#
# @param [String] rep The name of the representation
# from which the compiled content should be fetched. By default, the
# compiled ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/compilation_item_rep_view.rb | nanoc-core/lib/nanoc/core/views/compilation_item_rep_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class CompilationItemRepView < ::Nanoc::Core::BasicItemRepView
# @abstract
def item_view_class
Nanoc::Core::CompilationItemView
end
# Returns the item rep’s raw path. It includes the path to the output
# directory and t... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/layout_view.rb | nanoc-core/lib/nanoc/core/views/layout_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class LayoutView < ::Nanoc::Core::View
include Nanoc::Core::DocumentViewMixin
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_item_view.rb | nanoc-core/lib/nanoc/core/views/mutable_item_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableItemView < Nanoc::Core::BasicItemView
include Nanoc::Core::MutableDocumentViewMixin
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/item_collection_without_reps_view.rb | nanoc-core/lib/nanoc/core/views/item_collection_without_reps_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class ItemCollectionWithoutRepsView < ::Nanoc::Core::IdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::BasicItemView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_layout_collection_view.rb | nanoc-core/lib/nanoc/core/views/mutable_layout_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableLayoutCollectionView < Nanoc::Core::MutableIdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::MutableLayoutView
end
# Creates a new layout and adds it to the site’s collection of layouts.
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/compilation_item_rep_collection_view.rb | nanoc-core/lib/nanoc/core/views/compilation_item_rep_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class CompilationItemRepCollectionView < ::Nanoc::Core::BasicItemRepCollectionView
# @api private
def view_class
Nanoc::Core::CompilationItemRepView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.