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/spec/nanoc/regressions/gh_1047_spec.rb
nanoc/spec/nanoc/regressions/gh_1047_spec.rb
# frozen_string_literal: true describe 'GH-1047', :site, :stdio do before do File.write('Rules', <<EOS) compile '/*' do filter :erb write item.identifier end EOS end it 'does not reuse old content' do File.write('content/foo.md', 'I am old foo!') File.write('content/bar.md', 'I am old ba...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_795_spec.rb
nanoc/spec/nanoc/regressions/gh_795_spec.rb
# frozen_string_literal: true describe 'GH-795', :site, :stdio do before do File.write('content/items.md', 'Frozen? <%= @items._unwrap.frozen? %>!') File.write('content/items-view.md', 'Frozen? <%= @items.frozen? %>!') File.write('Rules', <<EOS) compile '/**/*' do filter :erb write item.identif...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_807_spec.rb
nanoc/spec/nanoc/regressions/gh_807_spec.rb
# frozen_string_literal: true describe 'GH-807', :site, :stdio do before do File.write('content/item.md', 'Stuff!') File.write('Rules', <<EOS) compile '/**/*' do filter :erb if item[:dynamic] write item.identifier.without_ext + '.html' end EOS end it 'does not crash' do Nanoc::CLI.run(['...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1097_spec.rb
nanoc/spec/nanoc/regressions/gh_1097_spec.rb
# frozen_string_literal: true describe 'GH-1097', :site, :stdio do before do File.write('content/a.dat', 'foo') File.write('content/index.html', '<%= @items.find_all("/*.dat").flat_map(&:reps).all? { |r| File.file?(r.raw_path) } %>') File.write('content/z.dat', 'quux') File.write('Rules', <<EOS) c...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1378_spec.rb
nanoc/spec/nanoc/regressions/gh_1378_spec.rb
# frozen_string_literal: true describe 'GH-1378', :site, :stdio do before do FileUtils.mkdir_p('content') File.write('outside.scss', 'p { color: red; }') File.write('content/style.scss', '@import "../outside.scss";') File.write('Rules', <<~EOS) compile '/*' do filter :sass, syntax: :sc...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_882_spec.rb
nanoc/spec/nanoc/regressions/gh_882_spec.rb
# frozen_string_literal: true describe 'GH-882', :site, :stdio do before do File.write('content/foo.md', 'I am foo!') File.write('content/bar.md', 'I am bar!') File.write('Rules', <<EOS) compile '/**/*' do write item.identifier.without_ext + '.html' end postprocess do modified_reps = item...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1045_spec.rb
nanoc/spec/nanoc/regressions/gh_1045_spec.rb
# frozen_string_literal: true describe 'GH-1045', :site, :stdio do before do File.write('content/foo.txt', 'foo') FileUtils.touch('content/foo.txt', mtime: Time.parse('2015-03-02 10:00:00Z')) File.write('content/sitemap.erb', '<%= xml_sitemap(items: items.select { |i| i.path.end_with?(\'/\') }) %>') ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1093_spec.rb
nanoc/spec/nanoc/regressions/gh_1093_spec.rb
# frozen_string_literal: true describe 'GH-1093', :site, :stdio do before do File.write('content/index.html', '<%= @items["/z.dat"].reps.all? { |r| File.file?(r.raw_path) } %>') File.write('content/z.dat', 'asdf') File.write('Rules', <<EOS) class TestFilter < Nanoc::Filter identifier :gh_1093_test...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_924_spec.rb
nanoc/spec/nanoc/regressions/gh_924_spec.rb
# frozen_string_literal: true describe 'GH-924', :site, :stdio do before do File.write('nanoc.yaml', <<~EOS) text_extensions: [ 'xml', 'xsl' ] EOS File.write('content/index.xml', '<root/>') File.write('layouts/default.xsl', <<~EOS) <?xml version="1.0" encoding="UTF-8" ?> <xsl:styl...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1094_spec.rb
nanoc/spec/nanoc/regressions/gh_1094_spec.rb
# frozen_string_literal: true describe 'GH-1094', :site, :stdio do before do File.write('content/a.dat', 'foo') File.write('content/index.html', '<%= @items["/*.dat"].compiled_content %>') File.write('Rules', <<EOS) compile '/**/*.html' do filter :erb write item.identifier.to_s end passth...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_828_spec.rb
nanoc/spec/nanoc/regressions/gh_828_spec.rb
# frozen_string_literal: true describe 'GH-828', :site, :stdio do before do File.write('content/bad.md', "---\nbad: true\n---\n\nI am bad!") File.write('content/good.md', "---\nbad: false\n---\n\nI am good!") File.write('Rules', <<EOS) preprocess do @items.delete_if { |i| i[:bad] } end compile...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1338_spec.rb
nanoc/spec/nanoc/regressions/gh_1338_spec.rb
# frozen_string_literal: true describe 'GH-1338', :site, :stdio do before do File.write('lib/default.rb', <<~EOS) Nanoc::Filter.define(:gh_1338) do |content, params = {}| Dir.chdir('..') content.upcase end EOS File.write('Rules', <<~EOS) compile '/*' do filter :...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_769_spec.rb
nanoc/spec/nanoc/regressions/gh_769_spec.rb
# frozen_string_literal: true describe 'GH-769', :site do before do File.write('content/index.md', 'Index!') File.write('content/donkey.md', 'Donkey! [<%= @item.parent.identifier %>]') File.open('nanoc.yaml', 'w') do |io| io << 'string_pattern_type: legacy' << "\n" io << 'data_sources:' << "...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1040_spec.rb
nanoc/spec/nanoc/regressions/gh_1040_spec.rb
# frozen_string_literal: true describe 'GH-1040', :site, :stdio do before do File.write('content/foo.txt', 'bar=<%= @items["/bar.*"].compiled_content %>') File.write('content/bar.txt', 'foo=<%= @items["/foo.*"].compiled_content %>') File.write('layouts/default.erb', '*<%= yield %>*') File.write('Ru...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1216_spec.rb
nanoc/spec/nanoc/regressions/gh_1216_spec.rb
# frozen_string_literal: true describe 'GH-1216', :site, :stdio do before do FileUtils.mkdir_p('content/talks') File.write('content/talks/aaa.html', 'A') File.write('content/talks/bbb.html', 'B') File.write('content/talks.html', '<%= @items.find_all("/talks/*").map { |i| i.raw_content + "=" + i[:stat...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_787_spec.rb
nanoc/spec/nanoc/regressions/gh_787_spec.rb
# frozen_string_literal: true describe 'GH-787', :site, :stdio do before do File.write('Rules', <<EOS) preprocess do @items.create('foo', {}, '/pig.md') end compile '/**/*' do write '/oink.html' end layout '/foo.*', :erb EOS end it 'runs the preprocessor only once' do expect { Nanoc:...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1037a_spec.rb
nanoc/spec/nanoc/regressions/gh_1037a_spec.rb
# frozen_string_literal: true describe 'GH-1037', :site, :stdio do before do File.write('content/giraffe.md', 'I am a giraffe!') File.write('content/donkey.erb', '[<%= @items["/giraffe.*"].compiled_content(snapshot: :last) %>]') File.write('Rules', <<EOS) compile '/donkey.erb' do filter :erb w...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1064_spec.rb
nanoc/spec/nanoc/regressions/gh_1064_spec.rb
# frozen_string_literal: true describe 'GH-1064', :site, :stdio do before do File.write('content/foo.erb', '*<%= @items["/bar.*"].compiled_content(snapshot: :pre) %>*') File.write('content/bar.erb', 'Bar!') File.write('Rules', <<EOS) compile '/*' do filter :erb write item.identifier end EOS ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_809_spec.rb
nanoc/spec/nanoc/regressions/gh_809_spec.rb
# frozen_string_literal: true describe 'GH-809', :site, :stdio do before do File.write('content/greeting.md', 'Hallöchen!') File.write('Rules', <<EOS) compile '/**/*' do snapshot :something, path: '/greeting.tmp' end EOS end specify 'stale check does not consider output/greeting.tmp as stale' do...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_981_spec.rb
nanoc/spec/nanoc/regressions/gh_981_spec.rb
# frozen_string_literal: true describe 'GH-981', :site, :stdio do before do File.write('content/foo.md', 'I am foo!') File.write('Rules', <<EOS) compile '/foo.*' do filter :erb, stuff: self write '/foo.html' end EOS end it 'creates at first' do expect { Nanoc::CLI.run(%w[compile --verbo...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/integration/compile_command_spec.rb
nanoc/spec/nanoc/integration/compile_command_spec.rb
# frozen_string_literal: true describe 'Compile command', :site, :stdio do describe 'diff generation' do before do File.write('content/foo.md', "I am foo!\n") File.write('Rules', <<~EOS) compile '/foo.*' do write '/foo.html' end EOS end it 'does not generate ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/integration/partial_recompilation_spec.rb
nanoc/spec/nanoc/integration/partial_recompilation_spec.rb
# frozen_string_literal: true describe 'Partial recompilation', :site, :stdio do before do File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoo") File.write('content/bar.md', '<%= @items["/foo.*"].compiled_content %><% raise "boom" %>') File.write('Rules', <<~EOS) compile '/foo.*' do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/integration/write_nil_spec.rb
nanoc/spec/nanoc/integration/write_nil_spec.rb
# frozen_string_literal: true describe 'write nil (skip routing rule)', :site, :stdio do context 'write non-nil + write nil' do before do File.write('content/foo.md', 'foo') File.write('Rules', <<~EOS) compile '/foo.*' do write '/foo-via-compilation-rule.txt' write nil ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/integration/outdatedness_integration_spec.rb
nanoc/spec/nanoc/integration/outdatedness_integration_spec.rb
# frozen_string_literal: true describe 'Outdatedness integration', :site, :stdio do context 'only attribute dependency' do let(:time) { Time.now } before do File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoo") File.write('content/bar.md', '<%= @items["/foo.*"][:title] %>') FileUt...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/orig_cli/commands/show_rules_spec.rb
nanoc/spec/nanoc/orig_cli/commands/show_rules_spec.rb
# frozen_string_literal: true describe Nanoc::OrigCLI::Commands::ShowRules, :site, :stdio do describe '#run' do subject { runner.run } around do |ex| orig_force_color = Nanoc::CLI.force_color Nanoc::CLI.force_color = Nanoc::CLI::FORCE_COLOR_ENABLED ex.run ensure Nanoc::CLI.force_...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/text_spec.rb
nanoc/spec/nanoc/helpers/text_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Text, :helper do describe '#excerptize' do subject { helper.excerptize(string, **params) } let(:string) { 'Foo bar baz quux meow woof' } let(:params) { {} } context 'no params' do it 'takes 25 characters' do expect(subject).to eql...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/link_to_spec.rb
nanoc/spec/nanoc/helpers/link_to_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::LinkTo, :helper do describe '#link_to' do subject { helper.link_to(text, target, attributes) } let(:text) { 'Text' } let(:target) { raise 'override me' } let(:attributes) { {} } context 'with string path' do let(:target) { '/foo/' } ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/blogging_spec.rb
nanoc/spec/nanoc/helpers/blogging_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Blogging, :helper do describe '#articles' do subject { helper.articles } before do ctx.create_item('blah', { kind: 'item' }, '/0') ctx.create_item('blah blah', { kind: 'article' }, '/1') ctx.create_item('blah blah blah', { kind: 'artic...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/html_escape_spec.rb
nanoc/spec/nanoc/helpers/html_escape_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::HTMLEscape, :helper do describe '#html_escape' do subject { helper.html_escape(string) } context 'when given angular brackets' do let(:string) { '<br/>' } it { is_expected.to eql('&lt;br/&gt;') } end context 'when given ampersand' ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/rendering_spec.rb
nanoc/spec/nanoc/helpers/rendering_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Rendering, :helper do describe '#render' do subject { helper.instance_eval { render('/partial.erb') } } let(:action_sequence_for_layout) do [Nanoc::Core::ProcessingActions::Filter.new(:erb, {})] end let(:layout_view) { ctx.layouts[layout_...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/breadcrumbs_spec.rb
nanoc/spec/nanoc/helpers/breadcrumbs_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Breadcrumbs, :helper, :stdio do describe '#breadcrumbs_trail' do subject { helper.breadcrumbs_trail } context 'legacy identifiers' do context 'root' do before do ctx.create_item('root', {}, Nanoc::Core::Identifier.new('/', type: ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/filtering_spec.rb
nanoc/spec/nanoc/helpers/filtering_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Filtering, :helper do describe '#filter' do subject { ERB.new(content).result(helper.get_binding) } before do ctx.create_item('some content', { title: 'Hello!' }, '/about.md') ctx.create_rep(ctx.items['/about.md'], '/about.html') ctx....
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/tagging_spec.rb
nanoc/spec/nanoc/helpers/tagging_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Tagging, :helper do describe '#tags_for' do subject { helper.tags_for(item, **params) } let(:item) { ctx.items['/me.*'] } let(:params) { {} } let(:item_attributes) { {} } before do ctx.create_item('content', item_attributes, '/me.md')...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/capturing_spec.rb
nanoc/spec/nanoc/helpers/capturing_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::Capturing, :helper do describe '#content_for' do before do ctx.create_item('some content', {}, '/about.md') ctx.create_rep(ctx.items['/about.md'], '/about.html') ctx.item = ctx.items['/about.md'] end describe 'setting content' do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/helpers/child_parent_spec.rb
nanoc/spec/nanoc/helpers/child_parent_spec.rb
# frozen_string_literal: true describe Nanoc::Helpers::ChildParent, :helper do describe '#children_of' do subject { helper.children_of(item) } before { ctx.create_item('some content', {}, identifier) } let(:item) { ctx.items[identifier] } context 'legacy identifier' do let(:identifier) { Nan...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/extra/srcset_parser_spec.rb
nanoc/spec/nanoc/extra/srcset_parser_spec.rb
# frozen_string_literal: true describe Nanoc::Extra::SrcsetParser do subject(:parsed) { described_class.new(value).call } let(:value) { 'http://example.com/a.jpg' } test_cases = { 'http://example.com/a.jpg 2w 3x' => [{ url: 'http://example.com/a.jpg', rest: ' 2w 3x' }], 'http://example.com/a.jpg...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/asciidoctor_spec.rb
nanoc/spec/nanoc/filters/asciidoctor_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::Asciidoctor do subject { filter.setup_and_run(input, params) } let(:filter) { described_class.new } let(:input) { '== Blah blah' } let(:params) { {} } it { is_expected.to match(%r{<h2 id="_blah_blah">Blah blah</h2>}) } end
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/less_spec.rb
nanoc/spec/nanoc/filters/less_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::Less, :site, :stdio do before do skip_unless_gem_available('less') File.open('Rules', 'w') do |io| io.write "compile '/**/*.less' do\n" io.write " filter :less\n" io.write " write item.identifier.without_ext + '.css'\n" io.write...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/asciidoc_spec.rb
nanoc/spec/nanoc/filters/asciidoc_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::AsciiDoc do subject { described_class.new } before do skip_unless_have_command 'asciidoc' end example do expect(subject.setup_and_run('== Blah blah')) .to match(%r{<h2 id="_blah_blah">Blah blah</h2>}) end end
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/relativize_paths_spec.rb
nanoc/spec/nanoc/filters/relativize_paths_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::RelativizePaths do subject(:filter) { described_class.new(assigns) } let(:assigns) do { item_rep: } end let(:item) do Nanoc::Core::Item.new('contentz', {}, '/sub/page.html') end let(:item_rep) do Nanoc::Core::ItemRep.new(item, :default)....
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/sass_spec.rb
nanoc/spec/nanoc/filters/sass_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::SassCommon do context 'with item, items, config context' do subject(:sass_sourcemap) do Nanoc::Filter.named(:sass_sourcemap).new(sass_sourcemap_params) end let(:sass) { Nanoc::Filter.named(:sass).new(sass_params) } let(:sass_params) do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/erb_spec.rb
nanoc/spec/nanoc/filters/erb_spec.rb
# frozen_string_literal: true describe Nanoc::Filters::ERB do context 'no assigns' do let(:filter) { described_class.new } example do result = filter.setup_and_run('[<%= @foo %>]') expect(result).to eq('[]') end end context 'simple assigns' do let(:filter) { described_class.new(loca...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/filters/colorize_syntax/rouge_spec.rb
nanoc/spec/nanoc/filters/colorize_syntax/rouge_spec.rb
# frozen_string_literal: true require 'rouge' describe Nanoc::Filters::ColorizeSyntax, :filter do subject { filter.setup_and_run(input, default_colorizer: :rouge, rouge: params) } let(:filter) { described_class.new } let(:params) { {} } let(:wrap) { false } let(:css_class) { 'highlight' } let(:input) do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/core/checksummer_spec.rb
nanoc/spec/nanoc/core/checksummer_spec.rb
# frozen_string_literal: true # NOTE: this spec checks all the bits that aren’t in Core. describe Nanoc::Core::Checksummer do subject { described_class.calc(obj, Nanoc::Core::Checksummer::VerboseDigest) } context 'Nanoc::RuleDSL::RulesCollection' do let(:obj) do Nanoc::RuleDSL::RulesCollection.new.tap ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/rule_dsl/rule_spec.rb
nanoc/spec/nanoc/rule_dsl/rule_spec.rb
# frozen_string_literal: true shared_examples 'a generic rule' do subject(:rule) do described_class.new(pattern, :xml, block) end let(:pattern) { Nanoc::Core::Pattern.from(%r{/(.*)/(.*)/}) } let(:block) { proc {} } describe '#matches' do subject { rule.matches(identifier) } context 'does not m...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb
nanoc/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb
# frozen_string_literal: true describe(Nanoc::RuleDSL::ActionSequenceCalculator) do subject(:action_sequence_calculator) do described_class.new(site:, rules_collection:) end let(:rules_collection) { Nanoc::RuleDSL::RulesCollection.new } let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd).with_d...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/rule_dsl/rule_context_spec.rb
nanoc/spec/nanoc/rule_dsl/rule_context_spec.rb
# frozen_string_literal: true shared_examples 'a rule context' do let(:item_identifier) { Nanoc::Core::Identifier.new('/foo.md') } let(:item) { Nanoc::Core::Item.new('content', {}, item_identifier) } let(:config) { Nanoc::Core::Configuration.new(dir: Dir.getwd) } let(:items) { Nanoc::Core::ItemCollection.new(c...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/rule_dsl/action_recorder_spec.rb
nanoc/spec/nanoc/rule_dsl/action_recorder_spec.rb
# frozen_string_literal: true describe Nanoc::RuleDSL::ActionRecorder do let(:recorder) { described_class.new(rep) } let(:action_sequence) { recorder.action_sequence } let(:item) { Nanoc::Core::Item.new('stuff', {}, '/foo.md') } let(:rep) { Nanoc::Core::ItemRep.new(item, :default) } describe '#filter' do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/rule_dsl/rules_collection_spec.rb
nanoc/spec/nanoc/rule_dsl/rules_collection_spec.rb
# frozen_string_literal: true describe Nanoc::RuleDSL::RulesCollection do let(:rules_collection) { described_class.new } describe '#data' do subject { rules_collection.data } it 'is nil by default' do expect(subject).to be_nil end it 'can be set' do rules_collection.data = 'asdf' ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/data_sources/filesystem_spec.rb
nanoc/spec/nanoc/data_sources/filesystem_spec.rb
# frozen_string_literal: true describe Nanoc::DataSources::Filesystem, :site do let(:data_source) { described_class.new(site.config, nil, nil, params) } let(:now) { Time.local(2008, 1, 2, 14, 5, 0) } let(:params) { {} } let(:site) { Nanoc::Core::SiteLoader.new.new_from_cwd } describe '#load_objects' do ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/data_sources/filesystem/tools_spec.rb
nanoc/spec/nanoc/data_sources/filesystem/tools_spec.rb
# frozen_string_literal: true describe Nanoc::DataSources::Filesystem::Tools do describe '.read_file' do subject { described_class.read_file(filename, config:) } let(:filename) { 'foo.dat' } let(:config) { {} } context 'file does not exist' do it 'errors' do expect { subject } ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/data_sources/filesystem/parser_spec.rb
nanoc/spec/nanoc/data_sources/filesystem/parser_spec.rb
# frozen_string_literal: true describe Nanoc::DataSources::Filesystem::Parser do subject(:parser) { described_class.new(config:) } let(:config) do Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults end describe '#call' do subject { parser.call(content_filename, meta_filename) } let(:co...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc.rb
nanoc/lib/nanoc.rb
# frozen_string_literal: true # Load external dependencies require 'addressable' require 'ddplugin' require 'json' require 'parallel' module Nanoc end # Load general requirements require 'cgi' require 'digest' require 'English' require 'fileutils' require 'forwardable' require 'logger' require 'net/http' require 'ne...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/version.rb
nanoc/lib/nanoc/version.rb
# frozen_string_literal: true module Nanoc # The current Nanoc version. VERSION = '4.14.6' end
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/data_sources.rb
nanoc/lib/nanoc/data_sources.rb
# frozen_string_literal: true # @api private module Nanoc::DataSources end require_relative 'data_sources/filesystem'
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/rule_dsl.rb
nanoc/lib/nanoc/rule_dsl.rb
# frozen_string_literal: true module Nanoc # @api private module RuleDSL end end require_relative 'rule_dsl/errors' require_relative 'rule_dsl/compiler_dsl' require_relative 'rule_dsl/action_provider' require_relative 'rule_dsl/action_recorder' require_relative 'rule_dsl/action_sequence_calculator' require_rela...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/orig_cli.rb
nanoc/lib/nanoc/orig_cli.rb
# frozen_string_literal: true require 'nanoc-cli' # @api private module Nanoc::OrigCLI module Commands end end Nanoc::CLI.after_setup do root = File.dirname(__FILE__) commands_path = File.join(root, 'orig_cli', 'commands') Nanoc::CLI.add_command(Cri::Command.load_file(File.join(commands_path, 'show-rules.r...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers.rb
nanoc/lib/nanoc/helpers.rb
# frozen_string_literal: true module Nanoc::Helpers end require_relative 'helpers/blogging' require_relative 'helpers/breadcrumbs' require_relative 'helpers/capturing' require_relative 'helpers/child_parent' require_relative 'helpers/filtering' require_relative 'helpers/html_escape' require_relative 'helpers/link_to'...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/extra.rb
nanoc/lib/nanoc/extra.rb
# frozen_string_literal: true require 'nanoc/checking' require 'nanoc/deploying' # @api private module Nanoc::Extra # @deprecated Checking = Nanoc::Checking # @deprecated Deployer = Nanoc::Deploying::Deployer # @deprecated Pruner = Nanoc::Core::Pruner end require_relative 'extra/srcset_parser' require_...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters.rb
nanoc/lib/nanoc/filters.rb
# frozen_string_literal: true # @api private module Nanoc::Filters end require_relative 'filters/asciidoc' require_relative 'filters/asciidoctor' require_relative 'filters/bluecloth' require_relative 'filters/colorize_syntax' require_relative 'filters/coffeescript' require_relative 'filters/erb' require_relative 'fil...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/orig_cli/commands/show-rules.rb
nanoc/lib/nanoc/orig_cli/commands/show-rules.rb
# frozen_string_literal: true usage 'show-rules' aliases :explain summary 'describe the rules for each item' description " Prints the rules used for all items and layouts in the current site. " no_params module Nanoc::OrigCLI::Commands class ShowRules < ::Nanoc::CLI::CommandRunner def run site = load_site...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/breadcrumbs.rb
nanoc/lib/nanoc/helpers/breadcrumbs.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#breadcrumbs module Breadcrumbs class AmbiguousAncestorError < ::Nanoc::Core::Error def initialize(pattern, items) @pattern = pattern @items = items end def message "exp...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/text.rb
nanoc/lib/nanoc/helpers/text.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#text module Text # @param [String] string # @param [Number] length # @param [String] omission # # @return [String] def excerptize(string, length: 25, omission: '...') if string.length >...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/filtering.rb
nanoc/lib/nanoc/helpers/filtering.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#filtering module Filtering require 'nanoc/helpers/capturing' include Nanoc::Helpers::Capturing # @param [Symbol] filter_name # @param [Hash] arguments # # @return [void] def filter(filte...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/link_to.rb
nanoc/lib/nanoc/helpers/link_to.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#linkto module LinkTo require 'nanoc/helpers/html_escape' include Nanoc::Helpers::HTMLEscape # @param [String] text # # @param [Hash] attributes # # @return [String] def link_to(text,...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/xml_sitemap.rb
nanoc/lib/nanoc/helpers/xml_sitemap.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#xmlsitemap module XMLSitemap # @option params [Array] :items # @option params [Proc] :rep_select # # @return [String] def xml_sitemap(params = {}) require 'builder' # Extract paramet...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/rendering.rb
nanoc/lib/nanoc/helpers/rendering.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#rendering module Rendering include Nanoc::Helpers::Capturing # @param [String] identifier # @param [Hash] other_assigns # # @raise [Nanoc::Core::Errors::UnknownLayout] # @raise [Nanoc::Core:...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/blogging.rb
nanoc/lib/nanoc/helpers/blogging.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#blogging module Blogging # @return [Array] def articles blk = -> { @items.select { |item| item[:kind] == 'article' } } if @items.frozen? @article_items ||= blk.call else blk...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/child_parent.rb
nanoc/lib/nanoc/helpers/child_parent.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#childparent module ChildParent def parent_of(item) if item.identifier.legacy? item.parent else path_without_last_component = item.identifier.to_s.sub(%r{[^/]+$}, '').chop @ite...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/tagging.rb
nanoc/lib/nanoc/helpers/tagging.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#tagging module Tagging require 'nanoc/helpers/html_escape' include Nanoc::Helpers::HTMLEscape # @param [String] base_url # @param [String] none_text # @param [String] separator # # @retu...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/html_escape.rb
nanoc/lib/nanoc/helpers/html_escape.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#filtering module HTMLEscape require 'nanoc/helpers/capturing' include Nanoc::Helpers::Capturing # @param [String] string # # @return [String] def html_escape(string = nil, &block) if b...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/helpers/capturing.rb
nanoc/lib/nanoc/helpers/capturing.rb
# frozen_string_literal: true module Nanoc::Helpers # @see https://nanoc.app/doc/reference/helpers/#capturing module Capturing # @api private class SetContent include Nanoc::Helpers::Capturing def initialize(name, params, item) @name = name @params = params @item = item...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/extra/core_ext.rb
nanoc/lib/nanoc/extra/core_ext.rb
# frozen_string_literal: true require 'nanoc/extra/core_ext/time'
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/extra/srcset_parser.rb
nanoc/lib/nanoc/extra/srcset_parser.rb
# frozen_string_literal: true module Nanoc module Extra # @api private class SrcsetParser class InvalidFormat < ::Nanoc::Core::Error def initialize super('Invalid srcset format') end end REGEX_REST = / ( # Zero or one of the followi...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/extra/core_ext/time.rb
nanoc/lib/nanoc/extra/core_ext/time.rb
# frozen_string_literal: true # @api private module Nanoc::Extra::TimeExtensions # @return [String] The time in an ISO-8601 date format. def __nanoc_to_iso8601_date getutc.strftime('%Y-%m-%d') end # @return [String] The time in an ISO-8601 time format. def __nanoc_to_iso8601_time getutc.strftime('%Y...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/rainpress.rb
nanoc/lib/nanoc/filters/rainpress.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Rainpress < Nanoc::Filter identifier :rainpress requires 'rainpress' # Runs the content through [Rainpress](https://github.com/ddfreyne/rainpress). # Parameters passed to this filter will be passed on to Rainpress. # ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/asciidoctor.rb
nanoc/lib/nanoc/filters/asciidoctor.rb
# frozen_string_literal: true module Nanoc::Filters class Asciidoctor < Nanoc::Filter identifier :asciidoctor requires 'asciidoctor' def run(content, params = {}) ::Asciidoctor.render(content, params) end end end
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/sass.rb
nanoc/lib/nanoc/filters/sass.rb
# frozen_string_literal: true module Nanoc::Filters module SassCommon REQUIRES = %w[sass nanoc/filters/sass/importer nanoc/filters/sass/functions].freeze def css(filter, rep, content, params) css, = render(filter, rep, content, params) css end def sourcemap(filter, rep, content, params)...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/typogruby.rb
nanoc/lib/nanoc/filters/typogruby.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Typogruby < Nanoc::Filter identifier :typogruby requires 'typogruby' # Runs the content through [Typogruby](http://avdgaag.github.com/typogruby/). # This method takes no options. # # @param [String] content The conte...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/rdoc.rb
nanoc/lib/nanoc/filters/rdoc.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class RDoc < Nanoc::Filter identifier :rdoc requires 'rdoc' # Runs the content through [RDoc::Markup](http://docs.seattlerb.org/rdoc/RDoc/Markup.html). # This method takes no options. # # @param [String] content The conten...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/rdiscount.rb
nanoc/lib/nanoc/filters/rdiscount.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class RDiscount < Nanoc::Filter identifier :rdiscount requires 'rdiscount' # Runs the content through [RDiscount](https://github.com/davidfstr/rdiscount). # # @option params [Array] :extensions ([]) A list of RDiscount extensi...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/kramdown.rb
nanoc/lib/nanoc/filters/kramdown.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Kramdown < Nanoc::Filter identifier :kramdown requires 'kramdown' # Runs the content through [Kramdown](https://kramdown.gettalong.org/). # Parameters passed to this filter will be passed on to Kramdown. # # @param [...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/yui_compressor.rb
nanoc/lib/nanoc/filters/yui_compressor.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class YUICompressor < Nanoc::Filter identifier :yui_compressor requires 'yuicompressor' # Compress Javascript or CSS using [YUICompressor](http://rubydoc.info/gems/yuicompressor). # This method optionally takes options to pass dir...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/xsl.rb
nanoc/lib/nanoc/filters/xsl.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class XSL < Nanoc::Filter identifier :xsl requires 'nokogiri' always_outdated # Runs the item content through an [XSLT](http://www.w3.org/TR/xslt) # stylesheet using [Nokogiri](http://nokogiri.org/). # # This filter ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/bluecloth.rb
nanoc/lib/nanoc/filters/bluecloth.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class BlueCloth < Nanoc::Filter identifier :bluecloth requires 'bluecloth' # Runs the content through [BlueCloth](http://deveiate.org/projects/BlueCloth). # This method takes no options. # # @param [String] content The con...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/redcloth.rb
nanoc/lib/nanoc/filters/redcloth.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class RedCloth < Nanoc::Filter identifier :redcloth requires 'redcloth' # Runs the content through [RedCloth](http://redcloth.org/). This method # takes the following options: # # * `:filter_class` # * `:filter_html` ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/erubi.rb
nanoc/lib/nanoc/filters/erubi.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Erubi < Nanoc::Filter identifier :erubi requires 'erubi' # Runs the content through [Erubi](https://github.com/jeremyevans/erubi). # To prevent single quote escaping use :escapefunc => 'Nanoc::Helpers::HTMLEscape.html_escape...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/maruku.rb
nanoc/lib/nanoc/filters/maruku.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Maruku < Nanoc::Filter identifier :maruku requires 'maruku' # Runs the content through [Maruku](https://github.com/bhollis/maruku/). # Parameters passed to this filter will be passed on to Maruku. # # @param [String]...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/coffeescript.rb
nanoc/lib/nanoc/filters/coffeescript.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class CoffeeScript < Nanoc::Filter identifier :coffeescript requires 'coffee-script' # Runs the content through [CoffeeScript](http://coffeescript.org/). # This method takes no options. # # @param [String] content The Coff...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/rubypants.rb
nanoc/lib/nanoc/filters/rubypants.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class RubyPants < Nanoc::Filter identifier :rubypants requires 'rubypants' # Runs the content through [RubyPants](http://rubydoc.info/gems/rubypants/). # This method takes no options. # # @param [String] content The conten...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/less.rb
nanoc/lib/nanoc/filters/less.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Less < Nanoc::Filter identifier :less requires 'less' # Runs the content through [LESS](http://lesscss.org/). # This method takes no options. # # @param [String] content The content to filter # # @return [Str...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/handlebars.rb
nanoc/lib/nanoc/filters/handlebars.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Handlebars < Nanoc::Filter identifier :handlebars requires 'ruby-handlebars' # Runs the content through # [Handlebars](http://handlebarsjs.com/) using # [Handlebars.rb](https://github.com/cowboyd/handlebars.rb). # Th...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/terser.rb
nanoc/lib/nanoc/filters/terser.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Terser < Nanoc::Filter identifier :terser identifier :uglify_js requires 'terser' # Runs the content through [terser](https://github.com/ahorek/terser-ruby). # This method optionally takes options to pass directly to Ter...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/asciidoc.rb
nanoc/lib/nanoc/filters/asciidoc.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class AsciiDoc < Nanoc::Filter identifier :asciidoc # Runs the content through [AsciiDoc](http://www.methods.co.nz/asciidoc/). # This method takes no options. # # @param [String] content The content to filter # # @retur...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/relativize_paths.rb
nanoc/lib/nanoc/filters/relativize_paths.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class RelativizePaths < Nanoc::Filter identifier :relativize_paths require 'nanoc/helpers/link_to' include Nanoc::Helpers::LinkTo prepend MemoWise SELECTORS = [ '*/@href', '*/@src', 'object/@data...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/pandoc.rb
nanoc/lib/nanoc/filters/pandoc.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Pandoc < Nanoc::Filter identifier :pandoc requires 'pandoc-ruby' # Runs the content through [Pandoc](http://johnmacfarlane.net/pandoc/) # using [PandocRuby](https://github.com/alphabetum/pandoc-ruby). # # Arguments c...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/erubis.rb
nanoc/lib/nanoc/filters/erubis.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Erubis < Nanoc::Filter identifier :erubis requires 'erubis' # Runs the content through [Erubis](http://www.kuwata-lab.com/erubis/). # This method takes no options. # # @param [String] content The content to filter ...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/redcarpet.rb
nanoc/lib/nanoc/filters/redcarpet.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Redcarpet < Nanoc::Filter identifier :redcarpet requires 'redcarpet' def run(content, params = {}) options = params.fetch(:options, {}) renderer_class = params.fetch(:renderer, ::Redcarpet...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/erb.rb
nanoc/lib/nanoc/filters/erb.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class ERB < Nanoc::Filter identifier :erb requires 'erb' class << self attr_accessor :_erb_cache end self._erb_cache = {} # Runs the content through [ERB](http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false
nanoc/nanoc
https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/lib/nanoc/filters/haml.rb
nanoc/lib/nanoc/filters/haml.rb
# frozen_string_literal: true module Nanoc::Filters # @api private class Haml < Nanoc::Filter identifier :haml requires 'haml' # Runs the content through [Haml](http://haml-lang.com/). # Parameters passed to this filter will be passed on to Haml. # # @param [String] content The content to...
ruby
MIT
59f767805018b4fc69e0bba896309c0028d3f53e
2026-01-04T15:57:49.460670Z
false