middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
325 stars 179 forks source link

Extension should not fail to activate if middleman-core/cli is missing #357

Closed mojavelinux closed 5 months ago

mojavelinux commented 6 years ago

Expected behaviour

The extension should load even if the middleman-cli gem is not available (i.e., require path: middleman-core/cli).

While the CLI integration is nice, it should not be required to use this extension. This makes the extension less friendly when using Middleman via the API, such as from a test. Other extensions work fine without middleman-cli, but not this one.

Actual behaviour

The extension fails to activate (silently) if the middleman-cli gem is not available. If you enable the debug level for logging, you discover the following message in the log:

== Failed Activation `blog` : cannot load such file -- middleman-core/cli

Steps to reproduce the problem

Create a cucumber test that attempts to activate the blog extension, but do not include middleman-cli as a dependency. The blog extension will silently fail to activate.

An example you can use for reference is the middleman-asciidoc extension. Clone the repository and comment out the middleman-cli dependency in the Gemfile. The asciidoc-blog.feature tests will fail to run.

Additional information