AndrewKvalheim / middleman-pry

Use Pry as the Middleman console.

Home Page:https://Andrew.Kvalhe.im/use-pry-as-the-middleman-console/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/"

About

Use Pry as the Middleman console.

https://Andrew.Kvalhe.im/use-pry-as-the-middleman-console/

License:MIT License


Languages

Language:Ruby 86.9%Language:Gherkin 13.1%