Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters Manage Dependencies #80

Merged
merged 10 commits into from
Oct 23, 2013

Conversation

simeonwillbanks
Copy link
Contributor

Fixes #77

  • Add dependency management test cases for each Filter with a
    dependency
  • Add assert_dependency_management_error custom assertion which
    asserts a custom exception and message are raised if a dependency
    is missing
  • Move all Filter dependencies to Gemfile :test block for
    test cases and CI
  • Implement TestingDependency helper to abstract unloading and
    loading Gemfile :test block gems when asserting dependency
    management errors
  • Implement MissingDependencyException custom exception with
    MESSAGE constant as a format string, so each Filter raises a
    uniform exception
  • Add begin..rescue..end blocks around each Filter require
    statement to raise a MissingDependencyException when a gem can
    not be loaded
  • Update README.md detailing new dependency management with listing
    of Filter gem dependencies
  • Add gemspec post install message to inform users their apps must
    bundle Filter dependencies

* Add dependency management test cases for each `Filter` with a
  dependency
* Add `assert_dependency_management_error` custom assertion which
  asserts a custom exception and message are raised if a dependency
  is missing
* Move all `Filter` dependencies to `Gemfile` `:test` block for
  test cases and CI
* Implement `TestingDependency` helper to abstract unloading and
  loading `Gemfile` `:test` block gems when asserting dependency
  management errors
* Implement `MissingDependencyException` custom exception with
 `MESSAGE` constant as a format string, so each `Filter` raises a
  uniform exception
* Add `begin..rescue..end` blocks around each `Filter` `require`
  statement to raise a `MissingDependencyException` when a gem can
  not be loaded
* Update README.md detailing new dependency management with listing
  of `Filter` gem dependencies
* Add gemspec post install message to inform users their apps must
  bundle `Filter` dependencies
@simeonwillbanks
Copy link
Contributor Author

Notes/Questions:

  1. Error messages do not have versions.
    • Hard coding versions meant they were repeated in filters, tests and
      the Gemfile; this wasn't maintainable.
    • Dynamically setting versions seemed overkill. e.g. Bundler.load.specs.find{ |s| s.name == "rinku" }
  2. Should activesupport be a full dependency?

@@ -1,4 +1,9 @@
require 'emoji'
begin
require "gemoji"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gemoji.rb is just a stub for emoji.rb. Changing this back to require "emoji" will eliminate a require. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave it alone in case the gem ever decides to load more things in gemoji.rb.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@jch
Copy link
Contributor

jch commented Aug 27, 2013

Thanks for the pull! I've left comments inline.

Simeon F. Willbanks added 3 commits August 27, 2013 19:19
* Copy edit README.md
* In gemspec, link README.md dependencies and update post install message
* Rename test helper to `assert_dependency`
* Remove `TestingDependency` in favor of stubbing `Kernal#require`
…in #to_hash is only used by #assert_equal_html
@simeonwillbanks
Copy link
Contributor Author

@jch You're welcome!

The latest Travis build was terminated. It hung on $ sudo apt-get install -qq libicu-dev. Can you please restart the build? Thanks.

travis-ci-html-pipeline

@jch
Copy link
Contributor

jch commented Aug 28, 2013

re: double gem. Sounds good.

Job restarted.

On Wed, Aug 28, 2013 at 11:06 AM, Simeon Willbanks <notifications@github.com

wrote:

@jch https://github.com/jch You're welcome!

The latest Travis buildhttps://travis-ci.org/jch/html-pipeline/jobs/10719183was terminated. It hung on $
sudo apt-get install -qq libicu-dev. Can you please restart the job?
Thanks.

[image: travis-ci-html-pipeline]https://f.cloud.github.com/assets/164506/1044162/809911d8-100c-11e3-9784-290c910e916d.png


Reply to this email directly or view it on GitHubhttps://github.com//pull/80#issuecomment-23435121
.

-Jerry
@whatcodecraves http://twitter.com/whatcodecraves
github http://github.com/jch

@jch
Copy link
Contributor

jch commented Sep 26, 2013

Just an update, but I pinged some other GitHubbers for feedback. I think the code here is fine, but wanted to get a 2nd pair of 👀 on it before I released it.

@simeonwillbanks
Copy link
Contributor Author

Sounds good!

* `SyntaxHighlightFilter` - `github-linguist`
* `TextileFilter` - `RedCloth`

_Note:_ See [Gemfile](https://github.com/jch/html-pipeline/blob/master/Gemfile) `:test` block for version requirements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub markdown supports relative links now. So you can just do /Gemfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@simeonwillbanks
Copy link
Contributor Author

@jch This Pull Request has many twists and turns. Before you merge, maybe you want to rebase? If so, for your convenience, here is a list of pertinent commit messages.

  • Add begin..rescue..end blocks around Filter require gem statements. If a dependency is missing, exit with a 1 status and write help message to STDERR.
  • Move all Filter dependencies to Gemfile :test block for test cases and CI.
  • Add gemspec post install message to inform users their apps must bundle Filter dependencies.
  • Update README.md detailing new dependency management with listing of Filter gem dependencies.

@jch
Copy link
Contributor

jch commented Oct 23, 2013

No need to rebase, just fetch and merge master into your branch. I like
having all the twists and turns in the history because it matches up with
the pull request discussion.

On Tuesday, October 22, 2013, Simeon Willbanks wrote:

@jch https://github.com/jch This Pull Request has many twists and
turns. Before you merge, maybe you want to rebase? If so, for your
convenience, here is a list of pertinent commit messages.

  • Add begin..rescue..end blocks around Filter require gem statements.
    If a dependency is missing, exit with a 1 status and write help message to
    STDERR.
  • Move all Filter dependencies to Gemfile :test block for test cases
    and CI.
  • Add gemspec post install message to inform users their apps must
    bundle Filter dependencies.
  • Update README.md detailing new dependency management with listing of
    Filter gem dependencies.


Reply to this email directly or view it on GitHubhttps://github.com//pull/80#issuecomment-26878827
.

-Jerry
@whatcodecraves http://twitter.com/whatcodecraves
github http://github.com/jch

@simeonwillbanks
Copy link
Contributor Author

Cool. It's good to go. Last night, I fetched and merged master.

jch added a commit that referenced this pull request Oct 23, 2013
@jch jch merged commit 42f013f into gjtorikian:master Oct 23, 2013
@jch
Copy link
Contributor

jch commented Oct 23, 2013

I'll cut a new release after I try this out on a few applications first.

@simeonwillbanks
Copy link
Contributor Author

Sounds good!

@parkr
Copy link
Contributor

parkr commented Jan 14, 2016

@simeonwillbanks @jch The move to rescue LoadError; abort has broken the ability to handle lack of dependencies in the client applications. See: gjtorikian/jekyll-html-pipeline#7 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Place Dependency Management On Filters
5 participants