Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

AndrewKvalheim/middleman-pry

Repository files navigation

middleman-pry

Gem Version Build Status

Replaces Middleman's built-in console with Pry, à la pry-rails.

Installation

Install the gem:

# Gemfile

gem 'middleman-pry'
$ bundle install

and activate the extension:

# config.rb

activate :pry

Usage

Start the Middleman console like normal:

$ middleman console

You should find yourself in an interactive Pry session in the context of your Middleman app:

middleman:~$ cd sitemap.resources.first
middleman:Middleman::Sitemap::Resource$ ls
Middleman::Sitemap::Resource#methods:
  add_metadata     blog_controller=   instrument  request_path  url
  app              destination_path   logger      source_file
  binary?          destination_path=  metadata    store
  blog_controller  ext                path        template?
Middleman::Blog::BlogArticle#methods:
  blog_data     default_summary_generator  previous_article  summary
  blog_options  inspect                    published?        tags
  body          lang                       render            title
  date          next_article               slug
middleman:Middleman::Sitemap::Resource$ url
=> "/use-pry-as-the-middleman-console/"