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/spec/nanoc/core/directed_graph_spec.rb | nanoc-core/spec/nanoc/core/directed_graph_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::DirectedGraph do
subject(:graph) { described_class.new(%w[1 2 3]) }
describe '#edges' do
subject { graph.edges }
context 'empty graph' do
it { is_expected.to be_empty }
end
context 'graph with vertices, but no edges' do
before do
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_rep_selector_spec.rb | nanoc-core/spec/nanoc/core/item_rep_selector_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ItemRepSelector do
let(:selector) do
described_class.new(
outdated_reps:,
reps: item_rep_repo,
dependency_store:,
)
end
let(:item_rep_repo) do
Nanoc::Core::ItemRepRepo.new.tap do |reps|
reps_array.each { reps << _1 }
end... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_rep_spec.rb | nanoc-core/spec/nanoc/core/item_rep_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ItemRep do
let(:item) { Nanoc::Core::Item.new('asdf', {}, '/foo.md') }
let(:rep) { described_class.new(item, :giraffe) }
describe '#snapshot?' do
subject { rep.snapshot?(snapshot_name) }
let(:snapshot_name) { raise 'override me' }
before do
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/code_snippet_spec.rb | nanoc-core/spec/nanoc/core/code_snippet_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CodeSnippet do
subject(:code_snippet) { described_class.new(data, 'lib/foo.rb') }
describe '#load' do
subject { code_snippet.load }
describe 'calling #include' do
let(:data) do
<<~EOS
module CodeSnippetSpecHelper1
def... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/configuration_spec.rb | nanoc-core/spec/nanoc/core/configuration_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Configuration do
let(:hash) { { foo: 'bar' } }
let(:config) { described_class.new(hash:, dir: Dir.getwd) }
describe '#key?' do
subject { config.key?(key) }
context 'non-existent key' do
let(:key) { :donkey }
it { is_expected.to be(false) ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/identifiable_collection_spec.rb | nanoc-core/spec/nanoc/core/identifiable_collection_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::IdentifiableCollection do
shared_examples 'a generic identifiable collection' do
subject(:identifiable_collection) { described_class.new(config, objects) }
let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd) }
let(:objects) { [] }
descri... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/yaml_loader_spec.rb | nanoc-core/spec/nanoc/core/yaml_loader_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::YamlLoader do
subject(:loader) { described_class }
let(:input) do
<<~YAML
point: &point_data
x: 42
y: 43
rect:
origin: *point_data
extent: {w: 10, h: 11}
YAML
end
let(:expected_output) do
{
'poin... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/store_spec.rb | nanoc-core/spec/nanoc/core/store_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Store do
let(:test_store_klass) do
Class.new(Nanoc::Core::Store) do
def data
@data
end
def data=(new_data)
@data = new_data
end
end
end
describe '#tmp_path_for' do
context 'passing config' do
subject {... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/utils_spec.rb | nanoc-core/spec/nanoc/core/utils_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Utils do
describe '.expand_path_without_drive_identifier' do
# TODO: Test on Windows
subject { described_class.expand_path_without_drive_identifier('foo.html', '/home/denis') }
it { is_expected.to eq('/home/denis/foo.html') }
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/processing_action_spec.rb | nanoc-core/spec/nanoc/core/processing_action_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ProcessingAction do
let(:action) { described_class.new }
it 'is abstract' do
expect { action.serialize }.to raise_error(NotImplementedError)
expect { action.to_s }.to raise_error(NotImplementedError)
expect { action.inspect }.to raise_error(NotImplem... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/action_sequence_builder_spec.rb | nanoc-core/spec/nanoc/core/action_sequence_builder_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ActionSequenceBuilder do
let(:builder) { described_class.new }
let(:item_rep) { Nanoc::Core::ItemRep.new(item, :default) }
let(:item) { Nanoc::Core::Item.new('some content', {}, '/foo.md') }
describe '#add_filter' do
subject { builder.add_filter(:erb, f... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/content_spec.rb | nanoc-core/spec/nanoc/core/content_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Content do
describe '.create' do
subject { described_class.create(arg, **params) }
let(:params) { {} }
context 'nil arg' do
let(:arg) { nil }
it 'raises' do
expect { subject }.to raise_error(ArgumentError)
end
end
c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stage_spec.rb | nanoc-core/spec/nanoc/core/compilation_stage_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStage do
subject(:stage) { klass.new }
let(:klass) { described_class }
before { Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 0)) }
after { Timecop.return }
around do |ex|
Nanoc::Core::Instrumentor.enable { ex.run }
end
describe '#cal... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/textual_content_spec.rb | nanoc-core/spec/nanoc/core/textual_content_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::TextualContent do
describe '#initialize' do
context 'without filename' do
let(:content) { described_class.new('foo') }
it 'sets string and filename' do
expect(content.string).to eq('foo')
expect(content.filename).to be_nil
end... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/executor_spec.rb | nanoc-core/spec/nanoc/core/executor_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Executor do
Class.new(Nanoc::Core::Filter) do
identifier :simple_erb_uy2wbp6dcf4hlc4gbluauh07zuz2wvei
def run(content, _params = {})
context = Nanoc::Core::Context.new(assigns)
ERB.new(content).result(context.get_binding)
end
end
let(:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/textual_compiled_content_cache_spec.rb | nanoc-core/spec/nanoc/core/textual_compiled_content_cache_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::TextualCompiledContentCache do
let(:cache) { described_class.new(config:) }
let(:items) { [item] }
let(:item) { Nanoc::Core::Item.new('asdf', {}, '/foo.md') }
let(:item_rep) { Nanoc::Core::ItemRep.new(item, :default) }
let(:other_item) { Nanoc::Core::Ite... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/filter_spec.rb | nanoc-core/spec/nanoc/core/filter_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Filter do
describe '.define' do
context 'simple filter' do
let(:filter_name) { :b5355bbb4d772b9853d21be57da614dba521dbbb }
let(:filter_class) { described_class.named(filter_name) }
before do
described_class.define(filter_name) do |con... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/toml_loader_spec.rb | nanoc-core/spec/nanoc/core/toml_loader_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::TomlLoader do
subject(:loader) { described_class }
let(:input) do
<<~TOML
point.x = 42
point.y = 43
TOML
end
let(:expected_output) do
{
'point' => { 'x' => 42, 'y' => 43 },
}
end
describe 'load' do
it 'returns pars... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/basic_outdatedness_checker_spec.rb | nanoc-core/spec/nanoc/core/basic_outdatedness_checker_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::BasicOutdatednessChecker do
let(:basic_outdatedness_checker) do
described_class.new(
reps:,
site:,
checksum_store:,
checksums:,
dependency_store:,
action_sequence_store:,
action_sequences:,
)
end
let(:checksum_... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/binary_content_spec.rb | nanoc-core/spec/nanoc/core/binary_content_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::BinaryContent do
describe '#initialize' do
let(:content) { described_class.new('/foo.dat') }
it 'sets filename' do
expect(content.filename).to eql('/foo.dat')
end
context 'with relative filename' do
let(:content) { described_class.new(... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_rep_router_spec.rb | nanoc-core/spec/nanoc/core/item_rep_router_spec.rb | # frozen_string_literal: true
describe(Nanoc::Core::ItemRepRouter) do
subject(:item_rep_router) { described_class.new(reps, action_provider, site) }
let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults }
let(:site) do
Nanoc::Core::Site.new(
config:,
code_snippets: [],
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/prefixed_data_source_spec.rb | nanoc-core/spec/nanoc/core/prefixed_data_source_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::PrefixedDataSource, :stdio do
subject(:data_source) do
described_class.new(original_data_source, '/itemz', '/layoutz')
end
let(:klass) do
Class.new(Nanoc::Core::DataSource) do
def item_changes
%i[one_foo one_bar]
end
def layo... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/aggregate_data_source_spec.rb | nanoc-core/spec/nanoc/core/aggregate_data_source_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::AggregateDataSource, :stdio do
subject(:data_source) do
described_class.new([data_source_1, data_source_2], {})
end
let(:klass_1) do
Class.new(Nanoc::Core::DataSource) do
def items
[Nanoc::Core::Item.new('One', {}, '/one.md')]
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_rep_builder_spec.rb | nanoc-core/spec/nanoc/core/item_rep_builder_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ItemRepBuilder do
describe '.snapshot_defs' do
let(:item) { Nanoc::Core::Item.new('asdf', {}, '/foo.md') }
let(:rep) { Nanoc::Core::ItemRep.new(item, :default) }
Class.new(Nanoc::Core::Filter) do
identifier :RuleMemSpec_filter_b2b
type :bin... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/config_loader_spec.rb | nanoc-core/spec/nanoc/core/config_loader_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ConfigLoader do
let(:loader) { described_class.new }
describe '#new_from_cwd' do
subject { loader.new_from_cwd }
context 'no config file present' do
it 'errors' do
expect { subject }.to raise_error(
Nanoc::Core::ConfigLoader::NoC... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compiled_content_repo_spec.rb | nanoc-core/spec/nanoc/core/compiled_content_repo_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompiledContentRepo do
subject(:repo) { described_class.new }
describe '#get' do
subject { repo.get(rep, snapshot_name) }
let(:item) { Nanoc::Core::Item.new('contentz', {}, '/foo.md') }
let(:rep) { Nanoc::Core::ItemRep.new(item, :foo) }
let(:sna... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/outdatedness_rules_spec.rb | nanoc-core/spec/nanoc/core/outdatedness_rules_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::OutdatednessRules do
Class.new(Nanoc::Core::Filter) do
identifier :always_outdated_voibwz9nhgf6gbpkdznrxcwkqgzlwnif
always_outdated
def run(content, _params)
content.upcase
end
end
describe '#apply' do
subject { rule_class.instance.a... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/structured_data_loader_spec.rb | nanoc-core/spec/nanoc/core/structured_data_loader_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::StructuredDataLoader do
subject(:loader) { described_class }
describe '.for_language' do
it 'can handle YAML' do
expect(loader.for_language(:yaml).load('hello: world'))
.to eq({ 'hello' => 'world' })
end
it 'can handle TOML' do
e... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_spec.rb | nanoc-core/spec/nanoc/core/item_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Item do
it_behaves_like 'a document'
describe '#reference' do
let(:item) { described_class.new('hi', {}, '/foo.md') }
it 'has the proper reference' do
expect(item.reference).to eql('item:/foo.md')
end
it 'updates reference after updating ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compiled_content_cache_spec.rb | nanoc-core/spec/nanoc/core/compiled_content_cache_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompiledContentCache do
let(:cache) { described_class.new(config:) }
let(:items) { [item] }
let(:item) { Nanoc::Core::Item.new('asdf', {}, '/foo.md') }
let(:item_rep) { Nanoc::Core::ItemRep.new(item, :default) }
let(:other_item) { Nanoc::Core::Item.new('... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/dependency_store_spec.rb | nanoc-core/spec/nanoc/core/dependency_store_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::DependencyStore do
let(:store) { described_class.new(items, layouts, config) }
let(:item_a) { Nanoc::Core::Item.new('a', {}, '/a.md') }
let(:item_b) { Nanoc::Core::Item.new('b', {}, '/b.md') }
let(:item_c) { Nanoc::Core::Item.new('c', {}, '/c.md') }
let(:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/lazy_value_spec.rb | nanoc-core/spec/nanoc/core/lazy_value_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::LazyValue do
describe '#value' do
subject { lazy_value.value }
let(:value_arg) { +'Hello world' }
let(:lazy_value) { described_class.new(value_arg) }
context 'object' do
it { is_expected.to equal(value_arg) }
end
context 'proc' do
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/outdatedness_checker_spec.rb | nanoc-core/spec/nanoc/core/outdatedness_checker_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::OutdatednessChecker do
Class.new(Nanoc::Core::Filter) do
identifier :always_outdated_3zh5qfqlqysghkd5ipek8glxzrljrylr
always_outdated
def run(content, _params)
content.upcase
end
end
let(:site) do
Nanoc::Core::Site.new(
config:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | true |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/layout_spec.rb | nanoc-core/spec/nanoc/core/layout_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Layout do
it_behaves_like 'a document'
describe '#reference' do
let(:layout) { described_class.new('hi', {}, '/foo.md') }
it 'has the proper reference' do
expect(layout.reference).to eql('layout:/foo.md')
end
it 'updates reference after u... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/identifier_spec.rb | nanoc-core/spec/nanoc/core/identifier_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Identifier do
describe '.from' do
subject { described_class.from(arg) }
context 'given an identifier' do
let(:arg) { described_class.new('/foo.md') }
it 'returns an identifier' do
expect(subject).to be_a(described_class)
expect... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/feature_spec.rb | nanoc-core/spec/nanoc/core/feature_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Feature do
describe '.enabled?' do
subject { described_class.enabled?(feature_name) }
let(:feature_name) { 'magic' }
before do
described_class.reset_caches
ENV['NANOC_FEATURES'] = +''
end
context 'not set' do
it { is_expecte... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/pruner_spec.rb | nanoc-core/spec/nanoc/core/pruner_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Pruner, :stdio do
subject(:pruner) { described_class.new(config, reps, dry_run:, exclude:) }
let(:config) { Nanoc::Core::Configuration.new(hash: {}, dir: Dir.getwd).with_defaults }
let(:dry_run) { false }
let(:exclude) { [] }
let(:reps) do
Nanoc::Core... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/action_sequence_spec.rb | nanoc-core/spec/nanoc/core/action_sequence_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ActionSequence do
let(:action_sequence) { raise 'override me' }
let(:item) { Nanoc::Core::Item.new('foo', {}, '/foo.md') }
let(:rep) { Nanoc::Core::ItemRep.new(item, :default) }
describe '#initialize' do
context 'with actions' do
subject { describ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/pattern_spec.rb | nanoc-core/spec/nanoc/core/pattern_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Pattern do
describe '.from' do
it 'converts from string' do
pattern = described_class.from('/foo/x[ab]z/bar.*')
expect(pattern.match?('/foo/xaz/bar.html')).to be(true)
expect(pattern.match?('/foo/xyz/bar.html')).to be(false)
end
it 'c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compiler_spec.rb | nanoc-core/spec/nanoc/core/compiler_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Compiler do
Class.new(Nanoc::Core::Filter) do
identifier :simple_erb_ob3rqra0yc
def run(content, _params = {})
context = Nanoc::Core::Context.new(assigns)
ERB.new(content).result(context.get_binding)
end
end
let(:compiler) do
descr... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/instrumentor_spec.rb | nanoc-core/spec/nanoc/core/instrumentor_spec.rb | # frozen_string_literal: true
describe(Nanoc::Core::Instrumentor) do
subject { described_class }
before { Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 0)) }
after { Timecop.return }
context 'when not enabled (i.e. by default)' do
it 'does not send notification' do
expect do
subject.call(:s... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/dependency_props_spec.rb | nanoc-core/spec/nanoc/core/dependency_props_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::DependencyProps do
let(:props) { described_class.new }
let(:props_all) do
described_class.new(raw_content: true, attributes: true, compiled_content: true, path: true)
end
describe '#inspect' do
subject { props.inspect }
context 'nothing active'... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/item_rep_view_examples.rb | nanoc-core/spec/nanoc/core/support/item_rep_view_examples.rb | # frozen_string_literal: true
shared_examples 'an item rep view' do
# needs expected_item_view_class
let(:view_context) do
Nanoc::Core::ViewContextForCompilation.new(
reps:,
items:,
dependency_tracker:,
compilation_context:,
compiled_content_repo:,
)
end
let(:compilation... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/document_view_examples.rb | nanoc-core/spec/nanoc/core/support/document_view_examples.rb | # frozen_string_literal: true
shared_examples 'a document view' do
let(:view) { described_class.new(document, view_context) }
let(:dependency_tracker) { Nanoc::Core::DependencyTracker.new(dependency_store, root: base_item) }
let(:dependency_store) { Nanoc::Core::DependencyStore.new(items, layouts, config) }
l... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/identifiable_collection_view_examples.rb | nanoc-core/spec/nanoc/core/support/identifiable_collection_view_examples.rb | # frozen_string_literal: true
# Needs :view_class
shared_examples 'an identifiable collection view' do
let(:view) { described_class.new(wrapped, view_context) }
let(:view_context) do
Nanoc::Core::ViewContextForCompilation.new(
reps:,
items: Nanoc::Core::ItemCollection.new(config),
dependency... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/item_rep_collection_view_examples.rb | nanoc-core/spec/nanoc/core/support/item_rep_collection_view_examples.rb | # frozen_string_literal: true
shared_examples 'an item rep collection view' do
let(:view) { described_class.new(wrapped, view_context) }
let(:view_context) { nil }
let(:wrapped) do
[
double(:item_rep, name: :foo),
double(:item_rep, name: :bar),
double(:item_rep, name: :baz),
]
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/mutable_document_view_examples.rb | nanoc-core/spec/nanoc/core/support/mutable_document_view_examples.rb | # frozen_string_literal: true
shared_examples 'a mutable document view' do
let(:view) { described_class.new(document, view_context) }
let(:view_context) do
Nanoc::Core::ViewContextForCompilation.new(
reps: Nanoc::Core::ItemRepRepo.new,
items: Nanoc::Core::ItemCollection.new(config),
dependen... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/support/mutable_identifiable_collection_view_examples.rb | nanoc-core/spec/nanoc/core/support/mutable_identifiable_collection_view_examples.rb | # frozen_string_literal: true
shared_examples 'a mutable identifiable collection view' do
let(:view) { described_class.new(wrapped, view_context) }
let(:view_context) { nil }
let(:config) do
{}
end
describe '#delete_if' do
let(:wrapped) do
collection_class.new(
config,
[doubl... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/processing_actions/filter_spec.rb | nanoc-core/spec/nanoc/core/processing_actions/filter_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ProcessingActions::Filter do
let(:action) { described_class.new(:foo, awesome: true) }
describe '#serialize' do
subject { action.serialize }
it { is_expected.to eql([:filter, :foo, 'v+eiDx9FKFH7+UBdX93/FK7/pRM=']) }
end
describe '#to_s' do
subj... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/processing_actions/snapshot_spec.rb | nanoc-core/spec/nanoc/core/processing_actions/snapshot_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ProcessingActions::Snapshot do
let(:action) { described_class.new([:before_layout], ['/foo.md']) }
describe '#serialize' do
subject { action.serialize }
it { is_expected.to eql([:snapshot, [:before_layout], true, ['/foo.md']]) }
end
describe '#to_s... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/processing_actions/layout_spec.rb | nanoc-core/spec/nanoc/core/processing_actions/layout_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ProcessingActions::Layout do
let(:action) { described_class.new('/foo.erb', awesome: true) }
describe '#serialize' do
subject { action.serialize }
it { is_expected.to eql([:layout, '/foo.erb', 'v+eiDx9FKFH7+UBdX93/FK7/pRM=']) }
end
describe '#to_s'... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/errors/dependency_cycle_spec.rb | nanoc-core/spec/nanoc/core/errors/dependency_cycle_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::Errors::DependencyCycle do
subject(:error) { described_class.new(cycle) }
let(:cycle) do
[
rep_b,
rep_c,
rep_d,
rep_e,
]
end
let(:rep_a) { Nanoc::Core::ItemRep.new(Nanoc::Core::Item.new('a', {}, '/a.md'), :default) }
let(:r... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stages/calculate_checksums_spec.rb | nanoc-core/spec/nanoc/core/compilation_stages/calculate_checksums_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStages::CalculateChecksums do
let(:stage) do
described_class.new(items:, layouts:, code_snippets:, config:)
end
let(:config) do
Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults
end
let(:code_snippets) do
[code_snippet]
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stages/compile_reps_spec.rb | nanoc-core/spec/nanoc/core/compilation_stages/compile_reps_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStages::CompileReps do
Class.new(Nanoc::Core::Filter) do
identifier :simple_erb_vcn3np2ayqmv6ayqp8su2crbusonmgwh
def run(content, _params = {})
context = Nanoc::Core::Context.new(assigns)
ERB.new(content).result(context.get_binding)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stages/preprocess_spec.rb | nanoc-core/spec/nanoc/core/compilation_stages/preprocess_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStages::Preprocess do
let(:stage) do
described_class.new(
action_provider:,
site:,
dependency_store:,
checksum_store:,
)
end
let(:action_provider) do
Class.new(Nanoc::Core::ActionProvider) do
def self.for(_c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stages/cleanup_spec.rb | nanoc-core/spec/nanoc/core/compilation_stages/cleanup_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStages::Cleanup do
let(:stage) { described_class.new(config.output_dirs) }
let(:config) do
Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults
end
describe '#run' do
subject { stage.run }
def gen_hash(path)
Digest::SHA... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_stages/determine_outdatedness_spec.rb | nanoc-core/spec/nanoc/core/compilation_stages/determine_outdatedness_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationStages::DetermineOutdatedness do
let(:stage) do
described_class.new(
reps:,
outdatedness_checker:,
outdatedness_store:,
)
end
let(:reps) do
Nanoc::Core::ItemRepRepo.new
end
let(:outdatedness_checker) do
double(... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/core_ext/string_spec.rb | nanoc-core/spec/nanoc/core/core_ext/string_spec.rb | # frozen_string_literal: true
describe String do
describe '#__nanoc_cleaned_identifier' do
it 'does not convert already clean paths' do
expect('/foo/bar/'.__nanoc_cleaned_identifier).to eql('/foo/bar/')
end
it 'prepends slash if necessary' do
expect('foo/bar/'.__nanoc_cleaned_identifier).to ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/core_ext/array_spec.rb | nanoc-core/spec/nanoc/core/core_ext/array_spec.rb | # frozen_string_literal: true
describe Array do
describe '#__nanoc_symbolize_keys_recursively' do
it 'converts keys to symbols' do
array_old = [:abc, 'xyz', { 'foo' => 'bar', :baz => :qux }]
array_new = [:abc, 'xyz', { foo: 'bar', baz: :qux }]
expect(array_old.__nanoc_symbolize_keys_recursively... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/core_ext/hash_spec.rb | nanoc-core/spec/nanoc/core/core_ext/hash_spec.rb | # frozen_string_literal: true
describe Hash do
describe '#__nanoc_symbolize_keys_recursively' do
it 'converts keys to symbols' do
hash_old = { 'foo' => 'bar' }
hash_new = { foo: 'bar' }
expect(hash_old.__nanoc_symbolize_keys_recursively).to eql(hash_new)
end
it 'does not require string... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/mutable_config_view_spec.rb | nanoc-core/spec/nanoc/core/views/mutable_config_view_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::MutableConfigView do
let(:config) { {} }
let(:view) { described_class.new(config, nil) }
describe '#[]=' do
it 'sets attributes' do
view[:awesomeness] = 'rather high'
expect(config[:awesomeness]).to eq('rather high')
end
end
describe '... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/config_view_spec.rb | nanoc-core/spec/nanoc/core/views/config_view_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ConfigView do
let(:config) do
Nanoc::Core::Configuration.new(dir: Dir.getwd, hash:)
end
let(:hash) { { output_dir: 'ootpoot/', amount: 9000, animal: 'donkey', foo: { bar: :baz } } }
let(:view) { described_class.new(config, view_context) }
let(:view_c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/post_compile_item_rep_view_spec.rb | nanoc-core/spec/nanoc/core/views/post_compile_item_rep_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_view_examples'
describe Nanoc::Core::PostCompileItemRepView do
let(:expected_item_view_class) { Nanoc::Core::PostCompileItemView }
let(:compiled_content_cache) do
# Pretend binary snapshots exist on disk so the binary cache can cache them.
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/basic_item_rep_view_spec.rb | nanoc-core/spec/nanoc/core/views/basic_item_rep_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_view_examples'
describe Nanoc::Core::BasicItemRepView do
let(:expected_item_view_class) { Nanoc::Core::BasicItemView }
it_behaves_like 'an item rep view'
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/compilation_item_rep_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/compilation_item_rep_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_collection_view_examples'
describe Nanoc::Core::CompilationItemRepCollectionView do
let(:expected_view_class) { Nanoc::Core::CompilationItemRepView }
it_behaves_like 'an item rep collection view'
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/compilation_item_view_spec.rb | nanoc-core/spec/nanoc/core/views/compilation_item_view_spec.rb | # frozen_string_literal: true
require_relative '../support/document_view_examples'
describe Nanoc::Core::CompilationItemView do
let(:entity_class) { Nanoc::Core::Item }
let(:other_view_class) { Nanoc::Core::LayoutView }
let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults }
let(:empty_... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/mutable_item_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/mutable_item_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/identifiable_collection_view_examples'
require_relative '../support/mutable_identifiable_collection_view_examples'
describe Nanoc::Core::MutableItemCollectionView do
let(:view_class) { Nanoc::Core::MutableItemView }
let(:collection_class) { Nanoc::Core::I... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/compilation_item_rep_view_spec.rb | nanoc-core/spec/nanoc/core/views/compilation_item_rep_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_view_examples'
describe Nanoc::Core::CompilationItemRepView do
let(:expected_item_view_class) { Nanoc::Core::CompilationItemView }
let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults }
let(:empty_layouts) { Nanoc::Core:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/item_collection_with_reps_view_spec.rb | nanoc-core/spec/nanoc/core/views/item_collection_with_reps_view_spec.rb | # frozen_string_literal: true
require_relative '../support/identifiable_collection_view_examples'
describe Nanoc::Core::ItemCollectionWithRepsView do
let(:view_class) { Nanoc::Core::CompilationItemView }
let(:collection_class) { Nanoc::Core::ItemCollection }
it_behaves_like 'an identifiable collection view' do... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/mutable_layout_view_spec.rb | nanoc-core/spec/nanoc/core/views/mutable_layout_view_spec.rb | # frozen_string_literal: true
require_relative '../support/mutable_document_view_examples'
describe Nanoc::Core::MutableLayoutView do
let(:entity_class) { Nanoc::Core::Layout }
it_behaves_like 'a mutable document view'
describe '#inspect' do
subject { view.inspect }
let(:item) { Nanoc::Core::Item.new... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/post_compile_item_rep_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/post_compile_item_rep_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_collection_view_examples'
describe Nanoc::Core::PostCompileItemRepCollectionView do
let(:expected_view_class) { Nanoc::Core::PostCompileItemRepView }
it_behaves_like 'an item rep collection view'
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/layout_view_spec.rb | nanoc-core/spec/nanoc/core/views/layout_view_spec.rb | # frozen_string_literal: true
require_relative '../support/document_view_examples'
describe Nanoc::Core::LayoutView do
let(:entity_class) { Nanoc::Core::Layout }
let(:other_view_class) { Nanoc::Core::CompilationItemView }
it_behaves_like 'a document view'
describe '#inspect' do
subject { view.inspect }
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/mutable_item_view_spec.rb | nanoc-core/spec/nanoc/core/views/mutable_item_view_spec.rb | # frozen_string_literal: true
require_relative '../support/mutable_document_view_examples'
describe Nanoc::Core::MutableItemView do
let(:entity_class) { Nanoc::Core::Item }
let(:view) { described_class.new(item, nil) }
let(:item) { entity_class.new('content', {}, '/asdf') }
it_behaves_like 'a mutable documen... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/layout_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/layout_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/identifiable_collection_view_examples'
describe Nanoc::Core::LayoutCollectionView do
let(:view_class) { Nanoc::Core::LayoutView }
let(:collection_class) { Nanoc::Core::LayoutCollection }
it_behaves_like 'an identifiable collection view' do
let(:ele... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/post_compile_item_view_spec.rb | nanoc-core/spec/nanoc/core/views/post_compile_item_view_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::PostCompileItemView do
let(:item) { Nanoc::Core::Item.new('blah', {}, '/foo.md') }
let(:rep_a) { Nanoc::Core::ItemRep.new(item, :no_mod) }
let(:rep_b) { Nanoc::Core::ItemRep.new(item, :modded).tap { |r| r.modified = true } }
let(:reps) do
Nanoc::Core::It... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/mutable_layout_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/mutable_layout_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/identifiable_collection_view_examples'
require_relative '../support/mutable_identifiable_collection_view_examples'
describe Nanoc::Core::MutableLayoutCollectionView do
let(:view_class) { Nanoc::Core::MutableLayoutView }
let(:collection_class) { Nanoc::Cor... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/item_collection_without_reps_view_spec.rb | nanoc-core/spec/nanoc/core/views/item_collection_without_reps_view_spec.rb | # frozen_string_literal: true
require_relative '../support/identifiable_collection_view_examples'
describe Nanoc::Core::ItemCollectionWithoutRepsView do
let(:view_class) { Nanoc::Core::BasicItemView }
let(:collection_class) { Nanoc::Core::ItemCollection }
it_behaves_like 'an identifiable collection view' do
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/views/basic_item_rep_collection_view_spec.rb | nanoc-core/spec/nanoc/core/views/basic_item_rep_collection_view_spec.rb | # frozen_string_literal: true
require_relative '../support/item_rep_collection_view_examples'
describe Nanoc::Core::BasicItemRepCollectionView do
let(:expected_view_class) { Nanoc::Core::BasicItemRepView }
it_behaves_like 'an item rep collection view'
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/item_rep_selector/item_rep_priority_queue_spec.rb | nanoc-core/spec/nanoc/core/item_rep_selector/item_rep_priority_queue_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::ItemRepSelector::ItemRepPriorityQueue do
subject(:priority_queue) do
described_class.new(
outdated_reps:,
reps: item_rep_repo,
dependency_store:,
)
end
let(:items) do
[
Nanoc::Core::Item.new('item A', {}, '/a.md'),
Nan... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_phases/abstract_spec.rb | nanoc-core/spec/nanoc/core/compilation_phases/abstract_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationPhases::Abstract do
subject(:phase) do
described_class.new(wrapped:)
end
let(:item) { Nanoc::Core::Item.new('foo', {}, '/stuff.md') }
let(:rep) { Nanoc::Core::ItemRep.new(item, :default) }
let(:wrapped) { nil }
describe '#run' do
sub... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/spec/nanoc/core/compilation_phases/cache_spec.rb | nanoc-core/spec/nanoc/core/compilation_phases/cache_spec.rb | # frozen_string_literal: true
describe Nanoc::Core::CompilationPhases::Cache do
subject(:phase) do
described_class.new(
compiled_content_cache:,
compiled_content_repo:,
wrapped:,
)
end
let(:compiled_content_cache) do
Nanoc::Core::CompiledContentCache.new(config:)
end
let(:comp... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc-core.rb | nanoc-core/lib/nanoc-core.rb | # frozen_string_literal: true
require '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.rb | nanoc-core/lib/nanoc/core.rb | # frozen_string_literal: true
# Ruby stdlib
require 'base64'
require 'find'
require 'singleton'
require 'tmpdir'
require 'yaml'
require 'zlib'
# External gems
require 'concurrent-ruby'
require 'json_schema'
require 'ddmetrics'
require 'ddplugin'
require 'immutable'
require 'memo_wise'
require 'slow_enumerator_tools'
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/structured_data_loader.rb | nanoc-core/lib/nanoc/core/structured_data_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
module StructuredDataLoader
class UnknownLanguageError < StandardError
def initialize(lang)
super("cannot find loader for language: #{lang.inspect}")
end
end
def self.for_language(language)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/identifier.rb | nanoc-core/lib/nanoc/core/identifier.rb | # frozen_string_literal: true
module Nanoc
module Core
class Identifier
include Comparable
include Nanoc::Core::ContractsSupport
class InvalidIdentifierError < ::Nanoc::Core::Error
def initialize(string)
super("Invalid identifier (does not start with a slash): #{string.inspec... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/string_pattern.rb | nanoc-core/lib/nanoc/core/string_pattern.rb | # frozen_string_literal: true
module Nanoc
module Core
class StringPattern < Pattern
MATCH_OPTS = File::FNM_PATHNAME | File::FNM_EXTGLOB
contract String => C::Any
def initialize(string)
@string = string
end
contract C::Or[Nanoc::Core::Identifier, String] => C::Bool
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/content.rb | nanoc-core/lib/nanoc/core/content.rb | # frozen_string_literal: true
module Nanoc
module Core
class Content
include Nanoc::Core::ContractsSupport
contract C::Or[self, String, Proc], C::KeywordArgs[binary: C::Optional[C::Bool], filename: C::Optional[C::Maybe[String]]] => self
def self.create(content, binary: false, filename: nil)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/instrumentor.rb | nanoc-core/lib/nanoc/core/instrumentor.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class Instrumentor
@enabled = false
def self.enable
if block_given?
begin
enable
yield
ensure
disable
end
else
@enabled = true
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/version.rb | nanoc-core/lib/nanoc/core/version.rb | # frozen_string_literal: true
module Nanoc
module Core
VERSION = '4.14.6'
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/compiler_loader.rb | nanoc-core/lib/nanoc/core/compiler_loader.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class CompilerLoader
def load(site, focus: nil, action_provider: nil)
action_sequence_store = Nanoc::Core::ActionSequenceStore.new(config: site.config)
dependency_store =
Nanoc::Core::DependencyStore.new(si... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/code_snippet.rb | nanoc-core/lib/nanoc/core/code_snippet.rb | # frozen_string_literal: true
module Nanoc
module Core
# Nanoc::Core::CodeSnippet represent a piece of custom code of a Nanoc site.
#
# @api private
class CodeSnippet
include Nanoc::Core::ContractsSupport
# A string containing the actual code in this code snippet.
#
# @return... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/assertions.rb | nanoc-core/lib/nanoc/core/assertions.rb | # frozen_string_literal: true
module Nanoc
module Core
module Assertions
class AssertionFailure < Nanoc::Core::Error
end
module Mixin
def assert(assertion)
return unless Nanoc::Core::ContractsSupport.enabled?
unless assertion.call
raise AssertionFailure... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compiler.rb | nanoc-core/lib/nanoc/core/compiler.rb | # frozen_string_literal: true
module Nanoc
module Core
class Compiler
include Nanoc::Core::ContractsSupport
contract Nanoc::Core::Site => C::Any
def self.compile(site, focus: nil)
new_for(site, focus:).run_until_end
end
contract Nanoc::Core::Site => Nanoc::Core::Compiler
... | 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_store.rb | nanoc-core/lib/nanoc/core/dependency_store.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class DependencyStore < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
C_RAW_CONTENT =
C::Or[
C::ArrayOf[C::Or[String, Regexp]],
C::Bool,
]
C_ATTR =
C::Or[
... | 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.rb | nanoc-core/lib/nanoc/core/item_rep.rb | # frozen_string_literal: true
module Nanoc
module Core
class ItemRep
include Nanoc::Core::ContractsSupport
contract C::None => C::Bool
attr_accessor :compiled
alias compiled? compiled
contract C::None => C::HashOf[Symbol => C::IterOf[String]]
attr_reader :raw_paths
co... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/errors.rb | nanoc-core/lib/nanoc/core/errors.rb | # frozen_string_literal: true
module Nanoc
module Core
module Errors
# Error that is raised when the compiled content at a non-existing snapshot
# is requested.
class NoSuchSnapshot < ::Nanoc::Core::Error
# @return [Nanoc::Core::ItemRep] The item rep from which the compiled content
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/data_source.rb | nanoc-core/lib/nanoc/core/data_source.rb | # frozen_string_literal: true
module Nanoc
module Core
# Responsible for loading site data. It is the (abstract) superclass for all
# data sources. Subclasses must at least implement the data reading methods
# ({#items} and {#layouts}).
#
# Apart from the methods for loading and storing data, the... | 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_store.rb | nanoc-core/lib/nanoc/core/action_sequence_store.rb | # frozen_string_literal: true
module Nanoc
module Core
# Stores action sequences for objects that can be run through a rule (item
# representations and layouts).
#
# @api private
class ActionSequenceStore < ::Nanoc::Core::Store
include Nanoc::Core::ContractsSupport
contract C::Keywor... | 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_repo.rb | nanoc-core/lib/nanoc/core/compiled_content_repo.rb | # frozen_string_literal: true
module Nanoc
module Core
# @api private
class CompiledContentRepo
include Nanoc::Core::ContractsSupport
def initialize
@contents = Hash.new { |hash, rep| hash[rep] = {} }
@current_content = {}
end
contract Nanoc::Core::ItemRep, Symbol =>... | 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.rb | nanoc-core/lib/nanoc/core/item.rb | # frozen_string_literal: true
module Nanoc
module Core
class Item < ::Nanoc::Core::Document
def reference
@_reference ||= "item:#{identifier}"
end
def identifier=(new_identifier)
super
# Invalidate memoization cache
@_reference = nil
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.