repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/identifiable_collection_view.rb | nanoc-core/lib/nanoc/core/views/identifiable_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class IdentifiableCollectionView < ::Nanoc::Core::View
include Enumerable
NOTHING = Object.new
# @api private
def initialize(objects, context)
super(context)
@objects = objects
end
# @api private
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/views/post_compile_item_collection_view.rb | nanoc-core/lib/nanoc/core/views/post_compile_item_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class PostCompileItemCollectionView < Nanoc::Core::IdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::PostCompileItemView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/layout_collection_view.rb | nanoc-core/lib/nanoc/core/views/layout_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class LayoutCollectionView < ::Nanoc::Core::IdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::LayoutView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/post_compile_item_rep_collection_view.rb | nanoc-core/lib/nanoc/core/views/post_compile_item_rep_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class PostCompileItemRepCollectionView < Nanoc::Core::BasicItemRepCollectionView
# @api private
def view_class
Nanoc::Core::PostCompileItemRepView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_config_view.rb | nanoc-core/lib/nanoc/core/views/mutable_config_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableConfigView < Nanoc::Core::ConfigView
# Sets the value for the given attribute.
#
# @param [Symbol] key
#
# @see Hash#[]=
def []=(key, value)
@config[key] = value
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/basic_item_rep_view.rb | nanoc-core/lib/nanoc/core/views/basic_item_rep_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class BasicItemRepView < ::Nanoc::Core::View
# @api private
def initialize(item_rep, context)
super(context)
@item_rep = item_rep
end
# @abstract
def item_view_class
Nanoc::Core::BasicItemView
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/item_collection_with_reps_view.rb | nanoc-core/lib/nanoc/core/views/item_collection_with_reps_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class ItemCollectionWithRepsView < ::Nanoc::Core::IdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::CompilationItemView
end
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_identifiable_collection_view.rb | nanoc-core/lib/nanoc/core/views/mutable_identifiable_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableIdentifiableCollectionView < Nanoc::Core::IdentifiableCollectionView
# Deletes every object for which the block evaluates to true.
#
# @yieldparam [#identifier] object
#
# @yieldreturn [Boolean]
#
# @ret... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/config_view.rb | nanoc-core/lib/nanoc/core/views/config_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class ConfigView < ::Nanoc::Core::View
# @api private
def initialize(config, context)
super(context)
@config = config
end
# @api private
def _unwrap
@config
end
# @api private
def outp... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/basic_item_view.rb | nanoc-core/lib/nanoc/core/views/basic_item_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class BasicItemView < ::Nanoc::Core::View
include Nanoc::Core::DocumentViewMixin
# Returns the children of this item. For items with identifiers that have
# extensions, returns an empty collection.
#
# @return [Enumerable<Nanoc... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_item_collection_view.rb | nanoc-core/lib/nanoc/core/views/mutable_item_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableItemCollectionView < Nanoc::Core::MutableIdentifiableCollectionView
# @api private
def view_class
Nanoc::Core::MutableItemView
end
# Creates a new item and adds it to the site’s collection of items.
#
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/mutable_layout_view.rb | nanoc-core/lib/nanoc/core/views/mutable_layout_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class MutableLayoutView < Nanoc::Core::LayoutView
include Nanoc::Core::MutableDocumentViewMixin
end
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/basic_item_rep_collection_view.rb | nanoc-core/lib/nanoc/core/views/basic_item_rep_collection_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class BasicItemRepCollectionView < ::Nanoc::Core::View
include Enumerable
class NoSuchItemRepError < ::Nanoc::Core::Error
def initialize(rep_name)
super("No rep named #{rep_name.inspect} was found.")
end
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/post_compile_item_view.rb | nanoc-core/lib/nanoc/core/views/post_compile_item_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class PostCompileItemView < Nanoc::Core::CompilationItemView
def reps
Nanoc::Core::PostCompileItemRepCollectionView.new(@context.reps[_unwrap], @context)
end
# @deprecated Use {#modified_reps} instead
def modified
mod... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/views/post_compile_item_rep_view.rb | nanoc-core/lib/nanoc/core/views/post_compile_item_rep_view.rb | # frozen_string_literal: true
module Nanoc
module Core
class PostCompileItemRepView < ::Nanoc::Core::BasicItemRepView
def item_view_class
Nanoc::Core::PostCompileItemView
end
def compiled_content(snapshot: nil)
compilation_context = @context.compilation_context
snapshot... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/mark_done.rb | nanoc-core/lib/nanoc/core/compilation_phases/mark_done.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
class MarkDone < Abstract
include Nanoc::Core::ContractsSupport
def initialize(wrapped:, outdatedness_store:)
super(wrapped:)
@outdatedness_store = outdatedness_store
end
c... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/write.rb | nanoc-core/lib/nanoc/core/compilation_phases/write.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
class Write < Abstract
include Nanoc::Core::ContractsSupport
def initialize(compiled_content_repo:, wrapped:)
super(wrapped:)
@compiled_content_repo = compiled_content_repo
@writ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/notify.rb | nanoc-core/lib/nanoc/core/compilation_phases/notify.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
# Provides functionality for notifying start and end of compilation.
class Notify < Abstract
include Nanoc::Core::ContractsSupport
contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool], C::F... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/recalculate.rb | nanoc-core/lib/nanoc/core/compilation_phases/recalculate.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
# Provides functionality for (re)calculating the content of an item rep, without caching or
# outdatedness checking.
class Recalculate < Abstract
include Nanoc::Core::ContractsSupport
def initialize... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/abstract.rb | nanoc-core/lib/nanoc/core/compilation_phases/abstract.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
class Abstract
include Nanoc::Core::ContractsSupport
def initialize(wrapped:)
@wrapped = wrapped
end
def start
@wrapped&.start
end
def stop
@wrapp... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-core/lib/nanoc/core/compilation_phases/cache.rb | nanoc-core/lib/nanoc/core/compilation_phases/cache.rb | # frozen_string_literal: true
module Nanoc
module Core
module CompilationPhases
# Stores the compiled content in the cache once available.
class Cache < Abstract
include Nanoc::Core::ContractsSupport
def initialize(wrapped:, compiled_content_cache:, compiled_content_repo:)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/spec/manifest_spec.rb | nanoc-external/spec/manifest_spec.rb | # frozen_string_literal: true
describe 'manifest', chdir: false do
example do
expect('nanoc-external').to have_a_valid_manifest
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/spec/filter_spec.rb | nanoc-external/spec/filter_spec.rb | # frozen_string_literal: true
describe Nanoc::External::Filter do
example do
filter = described_class.new({})
src = <<-SHAKESPEARE
Shall I compare thee to a Summer's day?
Thou art more lovely and more temperate
SHAKESPEARE
res = filter.run(src, exec: 'wc', options: %w[-l])
expect(res.st... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/spec/gem_spec.rb | nanoc-external/spec/gem_spec.rb | # frozen_string_literal: true
describe 'nanoc-external.gem', :stdio, chdir: false do
subject do
TTY::Command.new.run('gem build nanoc-external.gemspec')
end
around do |ex|
Dir['*.gem'].each { |f| FileUtils.rm(f) }
ex.run
Dir['*.gem'].each { |f| FileUtils.rm(f) }
end
it 'builds gem' do
e... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/spec/spec_helper.rb | nanoc-external/spec/spec_helper.rb | # frozen_string_literal: true
require_relative '../../common/spec/spec_helper_head'
require 'nanoc/external'
require_relative '../../common/spec/spec_helper_foot'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/lib/nanoc-external.rb | nanoc-external/lib/nanoc-external.rb | # frozen_string_literal: true
require 'nanoc/external'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/lib/nanoc/external.rb | nanoc-external/lib/nanoc/external.rb | # frozen_string_literal: true
module Nanoc
module External
end
end
require 'nanoc/external/version'
require 'nanoc/external/filter'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/lib/nanoc/external/version.rb | nanoc-external/lib/nanoc/external/version.rb | # frozen_string_literal: true
module Nanoc
module External
VERSION = '1.0.5'
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-external/lib/nanoc/external/filter.rb | nanoc-external/lib/nanoc/external/filter.rb | # frozen_string_literal: true
module Nanoc
module External
class Filter < Nanoc::Filter
identifier :external
def run(content, params = {})
cmd = params.fetch(:exec)
opts = params.fetch(:options, [])
command = TTY::Command.new(printer: :null)
command.run(cmd, *opts... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/common/spec/spec_helper_foot.rb | common/spec/spec_helper_foot.rb | # frozen_string_literal: true
require_relative 'spec_helper_foot_core'
Nanoc::CLI.setup
RSpec.configure do |c|
c.around do |example|
Nanoc::CLI::ErrorHandler.disable
example.run
Nanoc::CLI::ErrorHandler.enable
end
c.before(:each, :fork) do
skip 'fork() is not supported on Windows' if Nanoc::Co... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/common/spec/spec_helper_foot_core.rb | common/spec/spec_helper_foot_core.rb | # frozen_string_literal: true
require 'nanoc/spec'
def __nanoc_core_chdir(dir)
here = Dir.getwd
Dir.chdir(dir)
yield
ensure
Dir.chdir(here)
end
def __nanoc_core_with_env_vars(hash, &)
orig_env_hash = ENV.to_hash
hash.each_pair { |k, v| ENV[k] = v }
yield
ensure
orig_env_hash.each_pair { |k, v| ENV[k]... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/common/spec/spec_helper_head_core.rb | common/spec/spec_helper_head_core.rb | # frozen_string_literal: true
require 'simplecov'
SimpleCov.start
ENV['NANOC_DEV_MODE'] = 'true'
require 'fuubar'
require 'rspec/its'
require 'timecop'
require 'tty-command'
require 'yard'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/common/spec/spec_helper_head.rb | common/spec/spec_helper_head.rb | # frozen_string_literal: true
require_relative 'spec_helper_head_core'
require 'nanoc'
require 'nanoc/orig_cli'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/spec/manifest_spec.rb | nanoc-org-mode/spec/manifest_spec.rb | # frozen_string_literal: true
describe 'manifest', chdir: false do
example do
expect('nanoc-org-mode').to have_a_valid_manifest
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/spec/gem_spec.rb | nanoc-org-mode/spec/gem_spec.rb | # frozen_string_literal: true
describe 'nanoc-org-mode.gem', :stdio, chdir: false do
subject(:build_gem) do
TTY::Command.new.run('gem build nanoc-org-mode.gemspec')
end
around do |ex|
Dir['*.gem'].each { |f| FileUtils.rm(f) }
ex.run
Dir['*.gem'].each { |f| FileUtils.rm(f) }
end
it 'builds g... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/spec/spec_helper.rb | nanoc-org-mode/spec/spec_helper.rb | # frozen_string_literal: true
require_relative '../../common/spec/spec_helper_head'
require 'nanoc/org_mode'
require_relative '../../common/spec/spec_helper_foot'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/spec/nanoc/org_mode/filter_spec.rb | nanoc-org-mode/spec/nanoc/org_mode/filter_spec.rb | # frozen_string_literal: true
describe Nanoc::OrgMode::Filter, :helper do
it 'converts org-mode to HTML' do
# Create item
ctx.create_item('stuff', {}, '/foo.scss')
ctx.create_rep(ctx.items['/foo.scss'], '/assets/foo.css')
ctx.item = ctx.items['/foo.scss']
filter = described_class.new(ctx.assigns... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/lib/nanoc-org-mode.rb | nanoc-org-mode/lib/nanoc-org-mode.rb | # frozen_string_literal: true
require 'nanoc/org_mode'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/lib/nanoc/org_mode.rb | nanoc-org-mode/lib/nanoc/org_mode.rb | # frozen_string_literal: true
module Nanoc
module OrgMode
end
end
require 'org-ruby'
require 'nanoc/org_mode/version'
require 'nanoc/org_mode/filter'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/lib/nanoc/org-mode.rb | nanoc-org-mode/lib/nanoc/org-mode.rb | # frozen_string_literal: true
require_relative 'org_mode'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/lib/nanoc/org_mode/version.rb | nanoc-org-mode/lib/nanoc/org_mode/version.rb | # frozen_string_literal: true
module Nanoc
module OrgMode
VERSION = '1.0.0'
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-org-mode/lib/nanoc/org_mode/filter.rb | nanoc-org-mode/lib/nanoc/org_mode/filter.rb | # frozen_string_literal: true
module Nanoc
module OrgMode
class Filter < Nanoc::Filter
identifier :org_mode
# Runs the content through [Org Mode](https://orgmode.org/) via
# [org-ruby](https://github.com/wallyqs/org-ruby).
#
# @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-cli/spec/manifest_spec.rb | nanoc-cli/spec/manifest_spec.rb | # frozen_string_literal: true
describe 'manifest', chdir: false do
example do
expect('nanoc-cli').to have_a_valid_manifest
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/meta_spec.rb | nanoc-cli/spec/meta_spec.rb | # frozen_string_literal: true
describe 'meta', chdir: false do
it 'is covered by specs' do
regular_files = Dir['lib/nanoc/cli/**/*.rb']
regular_file_base_names = regular_files.map { |fn| fn.gsub(%r{^lib/nanoc/cli/|\.rb$}, '').tr('-', '_') }
spec_files = Dir['spec/nanoc/cli/**/*_spec.rb']
spec_file_b... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/gem_spec.rb | nanoc-cli/spec/gem_spec.rb | # frozen_string_literal: true
describe 'nanoc-cli.gem', :stdio, chdir: false do
subject do
TTY::Command.new.run('gem build nanoc-cli.gemspec')
end
around do |ex|
Dir['*.gem'].each { |f| FileUtils.rm(f) }
ex.run
Dir['*.gem'].each { |f| FileUtils.rm(f) }
end
it 'builds gem' do
expect { su... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/spec_helper.rb | nanoc-cli/spec/spec_helper.rb | # frozen_string_literal: true
require_relative '../../common/spec/spec_helper_head_core'
require 'nanoc/cli'
require_relative '../../common/spec/spec_helper_foot_core'
Nanoc::CLI.setup
Class.new(Nanoc::Core::DataSource) do
# fake
identifier :filesystem
def items
Dir['content/*'].map do |filename|
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli_spec.rb | nanoc-cli/spec/nanoc/cli_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI do
it 'enables UTF-8 only on TTYs' do
new_env_diff = {
'LC_ALL' => 'en_US.ISO-8859-1',
'LC_CTYPE' => 'en_US.ISO-8859-1',
'LANG' => 'en_US.ISO-8859-1',
}
__nanoc_core_with_env_vars(new_env_diff) do
io = StringIO.new
def io.tty... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/version_spec.rb | nanoc-cli/spec/nanoc/cli/version_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::VERSION do
it 'is the same as Nanoc::Core::VERSION' do
expect(Nanoc::CLI::VERSION).to eq(Nanoc::Core::VERSION)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/error_handler_spec.rb | nanoc-cli/spec/nanoc/cli/error_handler_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::ErrorHandler, :stdio do
subject(:error_handler) { described_class.new }
describe '#trivial?' do
subject { error_handler.trivial?(error) }
context 'LoadError of known gem' do
let(:error) do
raise LoadError, 'cannot load such file -- nokogiri... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/stack_trace_writer_spec.rb | nanoc-cli/spec/nanoc/cli/stack_trace_writer_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::StackTraceWriter do
subject(:writer) do
described_class.new(io)
end
let(:io) { StringIO.new }
describe '#write' do
subject { writer.write(exception, verbose:) }
let(:exception) do
backtrace_generator = lambda do |af|
if af.zero?
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/cleaning_stream_spec.rb | nanoc-cli/spec/nanoc/cli/cleaning_stream_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CleaningStream do
let(:stream_class) do
Class.new do
attr_accessor :called_methods
def initialize
@called_methods = []
end
def printf(*_args)
@called_methods << :printf
end
def method_missing(symbol, *_args)... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/command_runner_spec.rb | nanoc-cli/spec/nanoc/cli/command_runner_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CommandRunner, :stdio do
describe '.find_site_dir' do
subject { described_class.find_site_dir }
context 'config file in current dir' do
before { File.write('nanoc.yaml', 'hi') }
it 'returns the current dir' do
expect(subject).to eq(File... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/commands/show_data_spec.rb | nanoc-cli/spec/nanoc/cli/commands/show_data_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::Commands::ShowData, :stdio do
describe '#print_item_dependencies' do
subject { runner.send(:print_item_dependencies, items, dependency_store) }
let(:runner) do
described_class.new(options, arguments, command)
end
let(:options) { {} }
let(... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/commands/view_spec.rb | nanoc-cli/spec/nanoc/cli/commands/view_spec.rb | # frozen_string_literal: true
require 'net/http'
describe Nanoc::CLI::Commands::View, :fork, :site, :stdio do
describe '#run' do
def run_nanoc_cmd(cmd)
pid = fork { Nanoc::CLI.run(cmd) }
# Wait for server to start up
20.times do |i|
begin
Net::HTTP.get('127.0.0.1', '/', 50_3... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/commands/compile_spec.rb | nanoc-cli/spec/nanoc/cli/commands/compile_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::Commands::Compile, :site, :stdio do
describe '#run' do
let(:site) do
Nanoc::Core::Site.new(
config:,
code_snippets:,
data_source: Nanoc::Core::InMemoryDataSource.new(items, layouts),
)
end
let(:config) { Nanoc::Core::... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/commands/shell_spec.rb | nanoc-cli/spec/nanoc/cli/commands/shell_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::Commands::Shell, :site, :stdio do
describe '#run' do
before do
# Prevent double-loading
expect(Nanoc::CLI).to receive(:setup)
File.write('content/hello.md', 'Hello!')
File.write('Rules', <<~EOS)
preprocess do
@items['/... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/commands/show_plugins_spec.rb | nanoc-cli/spec/nanoc/cli/commands/show_plugins_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::Commands::ShowPlugins, :site, :stdio do
describe '#run' do
it 'can be invoked' do # rubocop:disable RSpec/NoExpectationExample
Nanoc::CLI.run(['show-plugins'])
end
context 'site with plugins' do
before do
File.write('lib/default.rb',... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/stream_cleaners/utf8_spec.rb | nanoc-cli/spec/nanoc/cli/stream_cleaners/utf8_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::StreamCleaners::UTF8 do
subject { described_class.new }
context 'when passed a string that is not UTF-8 encoded' do
let(:str) { String.new('Not UTF-8', encoding: 'ASCII-8BIT') }
it 'does not attempt to clean the string' do
expect(str).not_to receiv... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/compile_listeners/timing_recorder_spec.rb | nanoc-cli/spec/nanoc/cli/compile_listeners/timing_recorder_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CompileListeners::TimingRecorder, :stdio do
let(:listener) { described_class.new(reps:) }
let(:reps) do
Nanoc::Core::ItemRepRepo.new.tap do |reps|
reps << rep
end
end
let(:item) { Nanoc::Core::Item.new('<%= 1 + 2 %>', {}, '/hi.md') }
let(:rep) ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/compile_listeners/file_action_printer_spec.rb | nanoc-cli/spec/nanoc/cli/compile_listeners/file_action_printer_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CompileListeners::FileActionPrinter, :stdio do
let(:listener) { described_class.new(reps:) }
let(:reps) do
Nanoc::Core::ItemRepRepo.new.tap do |reps|
reps << rep
end
end
let(:item) { Nanoc::Core::Item.new('<%= 1 + 2 %>', {}, '/hi.md') }
let(:re... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/compile_listeners/abstract_spec.rb | nanoc-cli/spec/nanoc/cli/compile_listeners/abstract_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CompileListeners::Abstract do
subject { klass.new }
context 'abstract class' do
let(:klass) { described_class }
it 'errors on starting' do
expect { subject.start }.to raise_error(NotImplementedError)
end
it 'stops silently' do # rubocop:di... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/compile_listeners/diff_generator_spec.rb | nanoc-cli/spec/nanoc/cli/compile_listeners/diff_generator_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CompileListeners::DiffGenerator do
describe '.enable_for?' do
subject { described_class.enable_for?(command_runner, site) }
let(:options) { {} }
let(:config_hash) { {} }
let(:arguments) { double(:arguments) }
let(:command) { double(:command) }
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/spec/nanoc/cli/compile_listeners/debug_printer_spec.rb | nanoc-cli/spec/nanoc/cli/compile_listeners/debug_printer_spec.rb | # frozen_string_literal: true
describe Nanoc::CLI::CompileListeners::DebugPrinter, :stdio do
let(:listener) { described_class.new(reps:) }
let(:reps) do
Nanoc::Core::ItemRepRepo.new
end
let(:item) { Nanoc::Core::Item.new('item content', {}, '/donkey.md') }
let(:rep) { Nanoc::Core::ItemRep.new(item, :la... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc-cli.rb | nanoc-cli/lib/nanoc-cli.rb | # frozen_string_literal: true
require_relative 'nanoc/cli'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli.rb | nanoc-cli/lib/nanoc/cli.rb | # frozen_string_literal: true
require 'nanoc/core'
require 'diff/lcs'
require 'diff/lcs/hunk'
require 'logger'
begin
require 'cri'
rescue LoadError => e
$stderr.puts e
$stderr.puts "If you are using a Gemfile, make sure that the Gemfile contains Nanoc ('gem \"nanoc\"')."
exit 1
end
module Nanoc
# @api priv... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/stack_trace_writer.rb | nanoc-cli/lib/nanoc/cli/stack_trace_writer.rb | # frozen_string_literal: true
module Nanoc
module CLI
class StackTraceWriter
def initialize(stream)
@stream = stream
end
def write(error, verbose:)
count = verbose ? -1 : 10
error.backtrace[0...count].each_with_index do |item, index|
@stream.puts " #{index}.... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/ansi_string_colorizer.rb | nanoc-cli/lib/nanoc/cli/ansi_string_colorizer.rb | # frozen_string_literal: true
module Nanoc
module CLI
# A simple ANSI colorizer for strings. When given a string and a list of
# attributes, it returns a colorized string.
#
# @api private
class ANSIStringColorizer
CLEAR = "\e[0m"
MAPPING = {
bold: "\e[1m",
black: "\... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/version.rb | nanoc-cli/lib/nanoc/cli/version.rb | # frozen_string_literal: true
module Nanoc
module CLI
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-cli/lib/nanoc/cli/logger.rb | nanoc-cli/lib/nanoc/cli/logger.rb | # frozen_string_literal: true
module Nanoc
module CLI
# Nanoc::CLI::Logger is a singleton class responsible for generating
# feedback in the terminal.
#
# @api private
class Logger
ACTION_COLORS = {
create: [:green],
update: [:yellow],
identical: [],
cached: ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/transform.rb | nanoc-cli/lib/nanoc/cli/transform.rb | # frozen_string_literal: true
module Nanoc
module CLI
# @api private
module Transform
module Port
RANGE = (0x0001..0xffff)
def self.call(data)
Integer(data).tap do |int|
raise 'not a valid port' unless RANGE.cover?(int)
end
end
end
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/error_handler.rb | nanoc-cli/lib/nanoc/cli/error_handler.rb | # frozen_string_literal: true
module Nanoc::CLI
# Catches errors and prints nice diagnostic messages, then exits.
#
# @api private
class ErrorHandler
# Enables error handling in the given block.
#
# @return [void]
def self.handle_while(exit_on_error: true, &)
if @disabled
yield
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/command_runner.rb | nanoc-cli/lib/nanoc/cli/command_runner.rb | # frozen_string_literal: true
module Nanoc
module CLI
# A command runner subclass for Nanoc commands that adds Nanoc-specific
# convenience methods and error handling.
#
# @api private
class CommandRunner < ::Cri::CommandRunner
# @see http://rubydoc.info/gems/cri/Cri/CommandRunner#call-inst... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/cleaning_stream.rb | nanoc-cli/lib/nanoc/cli/cleaning_stream.rb | # frozen_string_literal: true
module Nanoc
module CLI
# An output stream that passes output through stream cleaners. This can be
# used to strip ANSI color sequences, for instance.
class CleaningStream
extend Forwardable
def_delegator :@stream, :close
def_delegator :@stream, :closed?
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/show-plugins.rb | nanoc-cli/lib/nanoc/cli/commands/show-plugins.rb | # frozen_string_literal: true
summary 'show all available plugins'
aliases :info
usage 'show-plugins [options]'
description <<~EOS
Show a list of available plugins, including filters and data sources.
If the current directory contains a Nanoc web site, the plugins defined in this site will be shown as well.
EOS
no... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/create-site.rb | nanoc-cli/lib/nanoc/cli/commands/create-site.rb | # frozen_string_literal: true
usage 'create-site [options] path'
aliases :create_site, :cs
summary 'create a site'
description 'Create a new site at the given path. The site will use the `filesystem` data source.'
flag nil, :force, 'force creation of new site'
param :path
module Nanoc::CLI::Commands
class CreateSit... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/view.rb | nanoc-cli/lib/nanoc/cli/commands/view.rb | # frozen_string_literal: true
usage 'view [options]'
summary 'start the web server that serves static files'
description <<~EOS
Start the static web server. Unless specified, the web server will run on port
3000 and listen 127.0.0.1. Running this static web server requires
`adsf` (not `asdf`!).
EOS
option :H, :... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/prune.rb | nanoc-cli/lib/nanoc/cli/commands/prune.rb | # frozen_string_literal: true
usage 'prune'
summary 'remove files not managed by Nanoc from the output directory'
description <<~EOS
Find all files in the output directory that do not correspond to an item
managed by Nanoc and remove them. Since this is a hazardous operation, an
additional `--yes` flag is needed... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/show-data.rb | nanoc-cli/lib/nanoc/cli/commands/show-data.rb | # frozen_string_literal: true
usage 'show-data'
aliases :debug
summary 'show data in this site'
description <<~EOS
Show information about all items, item representations and layouts in the
current site, along with dependency information.
EOS
no_params
module Nanoc::CLI::Commands
class ShowData < ::Nanoc::CLI::C... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/shell.rb | nanoc-cli/lib/nanoc/cli/commands/shell.rb | # frozen_string_literal: true
usage 'shell'
summary 'open a shell on the Nanoc environment'
aliases 'console', 'sh'
description "
Open an IRB shell on a context that contains @items, @layouts, and @config.
"
flag :p, :preprocess, 'run preprocessor'
no_params
module Nanoc::CLI::Commands
class Shell < ::Nanoc::CLI::C... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/compile.rb | nanoc-cli/lib/nanoc/cli/commands/compile.rb | # frozen_string_literal: true
usage 'compile [options]'
summary 'compile items of this site'
description <<~EOS
Compile all items of the current site.
EOS
no_params
flag nil, :diff, 'generate diff'
flag :W, :watch, 'watch for changes and recompile when needed'
option nil, :focus, 'compile only items matching the gi... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/commands/nanoc.rb | nanoc-cli/lib/nanoc/cli/commands/nanoc.rb | # frozen_string_literal: true
usage 'nanoc command [options] [arguments]'
summary 'Nanoc, a static site compiler written in Ruby'
default_subcommand 'compile'
opt :l, :color, 'enable color' do
Nanoc::CLI.force_color = Nanoc::CLI::FORCE_COLOR_ENABLED
end
opt :d, :debug, 'enable debugging' do
Nanoc::CLI.debug = tr... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/stream_cleaners/utf8.rb | nanoc-cli/lib/nanoc/cli/stream_cleaners/utf8.rb | # frozen_string_literal: true
module Nanoc
module CLI
module StreamCleaners
# Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
#
class UTF8 < Abstract
# @see Nanoc::CLI::StreamCleaners::Abstract#clean
def clean(str)
return str unless str... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/stream_cleaners/abstract.rb | nanoc-cli/lib/nanoc/cli/stream_cleaners/abstract.rb | # frozen_string_literal: true
module Nanoc
module CLI
module StreamCleaners
# Superclass for all stream cleaners. Stream cleaners have a single method,
# {#clean}, that takes a string and returns a cleaned string. Stream cleaners
# can have state, so they can act as a FSM.
#
# @abst... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/file_action_printer.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/file_action_printer.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class FileActionPrinter < Abstract
def initialize(reps:)
@reps = reps
@stopwatches = {}
end
# @see Listener#start
def start
on(:compilation_started) do |rep|
@stopwatches[rep] ||= DDMetrics::Stopwatch.new
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/timing_recorder.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/timing_recorder.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class TimingRecorder < Abstract
attr_reader :stages_summary
attr_reader :phases_summary
attr_reader :outdatedness_rules_summary
attr_reader :filters_summary
# @see Listener#enable_for?
def self.enable_for?(_command_runner, _si... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/diff_generator.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/diff_generator.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class DiffGenerator < Abstract
class Differ
def initialize(path, str_a, str_b)
@path = path
@str_a = str_a
@str_b = str_b
end
def call
run
end
private
def run
lines_a =... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/abstract.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/abstract.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class Abstract
def initialize(*)
super()
end
def self.enable_for?(command_runner, site) # rubocop:disable Lint/UnusedMethodArgument
true
end
# @abstract
def start
raise NotImplementedError, "Subclasses of #{... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/aggregate.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/aggregate.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class Aggregate < Abstract
def initialize(command_runner:, site:, compiler:)
@site = site
@compiler = compiler
@command_runner = command_runner
@listener_classes = self.class.default_listener_classes
end
def start... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc-cli/lib/nanoc/cli/compile_listeners/debug_printer.rb | nanoc-cli/lib/nanoc/cli/compile_listeners/debug_printer.rb | # frozen_string_literal: true
module Nanoc::CLI::CompileListeners
class DebugPrinter < Abstract
# @see Listener#enable_for?
def self.enable_for?(command_runner, _site)
command_runner.debug?
end
COLOR_MAP = {
'compilation' => :red,
'content' => :green,
'filtering' => :yellow,
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/helper.rb | nanoc/test/helper.rb | # frozen_string_literal: true
$VERBOSE = false
require 'simplecov'
SimpleCov.start
require 'minitest/mock'
require 'minitest/autorun'
require 'mocha/minitest'
require 'vcr'
require 'tmpdir'
require 'stringio'
require 'yard'
VCR.configure do |c|
c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
c.hook_into... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/base/test_compiler.rb | nanoc/test/base/test_compiler.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Core::CompilerTest < Nanoc::TestCase
def test_compile_rep_should_write_proper_snapshots_real
with_site do |_site|
File.write('content/moo.txt', '<%= 1 %> <%%= 2 %> <%%%= 3 %>')
File.write('layouts/default.erb', 'head <%= yield %> foot')
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/base/test_site.rb | nanoc/test/base/test_site.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Core::SiteTest < Nanoc::TestCase
def test_initialize_with_dir_without_config_yaml
assert_raises(Nanoc::Core::ConfigLoader::NoConfigFileFoundError) do
Nanoc::Core::SiteLoader.new.new_from_cwd
end
end
def test_initialize_with_dir_with_conf... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/test_cli.rb | nanoc/test/orig_cli/test_cli.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::OrigCLITest < Nanoc::TestCase
COMMAND_CODE = <<~EOS
usage '_test [options]'
summary 'meh'
description 'longer meh'
run do |opts, args, cmd|
File.open('_test.out', 'w') { |io| io.write('It works!') }
end
EOS
SUBCOMM... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/test_error_handler.rb | nanoc/test/orig_cli/test_error_handler.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::ErrorHandlerTest < Nanoc::TestCase
def setup
super
@handler = Nanoc::CLI::ErrorHandler.new
end
def test_resolution_for_with_unknown_gem
error = LoadError.new('no such file to load -- afjlrestjlsgrshter')
assert_nil @handler.send(... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/test_logger.rb | nanoc/test/orig_cli/test_logger.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::LoggerTest < Nanoc::TestCase
def test_stub; end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/commands/test_prune.rb | nanoc/test/orig_cli/commands/test_prune.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::Commands::PruneTest < Nanoc::TestCase
def test_run_without_yes
with_site do |_site|
# Set output dir
File.write('nanoc.yaml', "output_dir: output2\nstring_pattern_type: legacy\n")
FileUtils.mkdir_p('output2')
# Create sour... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/commands/test_help.rb | nanoc/test/orig_cli/commands/test_help.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::Commands::HelpTest < Nanoc::TestCase
def test_run
Nanoc::CLI.run %w[help]
Nanoc::CLI.run %w[help co]
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/commands/test_compile.rb | nanoc/test/orig_cli/commands/test_compile.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::Commands::CompileTest < Nanoc::TestCase
def test_profiling_information
with_site do |_site|
File.open('content/foo.md', 'w') { |io| io << 'asdf' }
File.open('content/bar.md', 'w') { |io| io << 'asdf' }
File.open('content/baz.md',... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/orig_cli/commands/test_create_site.rb | nanoc/test/orig_cli/commands/test_create_site.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::CLI::Commands::CreateSiteTest < Nanoc::TestCase
def test_create_site_with_existing_name
Nanoc::CLI.run %w[create_site foo]
assert_raises(::Nanoc::Core::TrivialError) do
Nanoc::CLI.run %w[create_site foo]
end
end
def test_can_compile_... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/helpers/test_blogging.rb | nanoc/test/helpers/test_blogging.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
include Nanoc::Helpers::Blogging
include Nanoc::Helpers::Text
def mock_article
item = mock
item.stubs(:[]).with(:updated_at).returns(Time.now - 500)
item.stubs(:[]).with(:kind).returns('article')
... | 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.