Sha256: 088a542bd9fcac1b580f47e7fdc548b61da46b1cfe7533d33dddf7868141cade

Contents?: true

Size: 635 Bytes

Versions: 8

Compression:

Stored size: 635 Bytes

Contents

# encoding: utf-8

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

module Nanoc::CLI::Commands

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

    def run
      require 'pry'

      self.require_site

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

  protected

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

  end

end

runner Nanoc::CLI::Commands::Shell

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.6 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.5 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.4 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.3 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.2 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.1 lib/nanoc/cli/commands/shell.rb
nanoc-3.6.0 lib/nanoc/cli/commands/shell.rb