gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 382 forks source link

Set instrumentation name #275

Closed gjtorikian closed 7 years ago

gjtorikian commented 7 years ago

Newer Ruby versions have begun to complain when an ivar is not set properly:

/Users/gjtorikian/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/html-pipeline-2.5.0/lib/html/pipeline.rb:72: warning: instance variable @instrumentation_name not initialized
/Users/gjtorikian/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/html-pipeline-2.5.0/lib/html/pipeline.rb:72: warning: instance variable @instrumentation_name not initialized
/Users/gjtorikian/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/html-pipeline-2.5.0/lib/html/pipeline.rb:72: warning: instance variable @instrumentation_name not initialized
/Users/gjtorikian/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/html-pipeline-2.5.0/lib/html/pipeline.rb:72: warning: instance variable @instrumentation_name not initialized

For large sites, this message is repeatedly endlessly.

This PR simply checks to see if @instrumentation_name is defined, and if it's not, sets it to the default class name.

gjtorikian commented 7 years ago

Some of the CI dependencies depend on https://github.com/jch/html-pipeline/pull/274.