Sha256: 7fa47cddaa5ee6b95050ab08229b950f189aaed5d80ea349ce8d14da5d256332

Contents?: true

Size: 603 Bytes

Versions: 8

Compression:

Stored size: 603 Bytes

Contents

# encoding: utf-8

usage       'shell'
summary     'open a shell on the nanoc environment'
aliases     'console'
description "
Open an IRB shell on a context that contains @items, @layouts, @config and @site.
"

module Nanoc::CLI::Commands

  class Shell < ::Nanoc::CLI::CommandRunner

    def run
      require 'pry'

      require_site

      Nanoc::Context.new(env).pry
    end

  protected

    def env
      {
        :site    => site,
        :items   => site.items,
        :layouts => site.layouts,
        :config  => site.config
      }
    end

  end

end

runner Nanoc::CLI::Commands::Shell

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-3.7.3 lib/nanoc/cli/commands/shell.rb
nanoc-3.7.2 lib/nanoc/cli/commands/shell.rb
nanoc-3.7.1 lib/nanoc/cli/commands/shell.rb
nanoc-3.7.0 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.11 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.10 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.9 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.8 lib/nanoc/cli/commands/shell.rb