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

Add parser&filter support for compat_parameters plugin helper #1079

Merged
merged 26 commits into from
Jul 28, 2016

Conversation

tagomoris
Copy link
Member

@tagomoris tagomoris commented Jul 5, 2016

This pull-request adds some methods to convert v0.12 style parser/formatter parameters to v0.14 style. (flat "format" parameter -> @type in <format> section)

With this plugin helper, users can move to v0.14 without any modification on configuration file about formatting/parsing.

This change requires some changes listed below:

  • add default_type keyword argument in methods of parser/formatter/storage plugin helpers to specify default type of these plugins even without any subsections for these plugins
  • move code for injecting tag/time (HandleTagAndTimeMixin) from formatter to filter/output using inject plugin helper
  • enable inject plugin helper to simulate HandleTagAndTimeMixin in compat filter/output plugins in default

Generally speaking, injecting tag/time into records are not of formatter, but filter and output plugins (there are many plugins to do it without formatter plugins). It's best to migrate to use just a code (inject plugin helper) from many similar code in many files.

@tagomoris tagomoris added the v0.14 label Jul 6, 2016
@tagomoris tagomoris changed the title Add parser&filter support for compat_parameters plugin helper [WIP] Add parser&filter support for compat_parameters plugin helper Jul 6, 2016
@tagomoris tagomoris force-pushed the plugin-helper-compat-parameters-parser-filter branch 2 times, most recently from 5622485 to b50715f Compare July 20, 2016 08:00
tagomoris added 22 commits July 20, 2016 19:15
…arser

by using inject plugin helper in filter/output plugin side
with conversion of configuration + automated inject_* method invocation for compat plugins
@tagomoris tagomoris force-pushed the plugin-helper-compat-parameters-parser-filter branch from b50715f to fc380f8 Compare July 21, 2016 07:13
@tagomoris tagomoris changed the title [WIP] Add parser&filter support for compat_parameters plugin helper Add parser&filter support for compat_parameters plugin helper Jul 21, 2016
@tagomoris
Copy link
Member Author

@repeatedly Hi, could you please review this?


parser_params = {}
PARSER_PARAMS.each do |older, newer|
next unless newer
Copy link
Member

Choose a reason for hiding this comment

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

PARSER_PARAMS doesn't have false/nil value.
Is this unless for safety?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Someone might add another entry which has nil value.

@repeatedly
Copy link
Member

Others are LGTM

@tagomoris
Copy link
Member Author

I added commits for review comments.

@tagomoris tagomoris closed this Jul 27, 2016
@tagomoris tagomoris reopened this Jul 27, 2016
@tagomoris tagomoris merged commit 26eebdb into master Jul 28, 2016
@tagomoris tagomoris deleted the plugin-helper-compat-parameters-parser-filter branch July 28, 2016 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants