Skip to content

Commit

Permalink
Merge pull request #1168 from fluent/fix-1156
Browse files Browse the repository at this point in the history
fix to require compat modules missed in previous
  • Loading branch information
tagomoris authored Aug 22, 2016
2 parents 89b32d8 + 0ec963a commit a906d40
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/fluent/compat/handle_tag_and_time_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# limitations under the License.
#

require 'fluent/time' # TimeFormatter

module Fluent
module Compat
module HandleTagAndTimeMixin
Expand Down
4 changes: 3 additions & 1 deletion lib/fluent/compat/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
require 'fluent/plugin/bare_output'
require 'fluent/compat/call_super_mixin'
require 'fluent/compat/formatter_utils'
require 'fluent/compat/handle_tag_and_time_mixin'
require 'fluent/compat/parser_utils'
require 'fluent/compat/propagate_default'
require 'fluent/compat/record_filter_mixin'
require 'fluent/compat/output_chain'
require 'fluent/timezone'
require 'fluent/mixin'
Expand Down Expand Up @@ -265,7 +267,7 @@ def configure(conf)
conf.elements << Fluent::Config::Element.new('buffer', '', buf_params, [])
end

@includes_record_filter = self.class.ancestors.include?(Fluent::RecordFilterMixin) # TODO rename Compat::RecordFilterMixin
@includes_record_filter = self.class.ancestors.include?(Fluent::Compat::RecordFilterMixin)

methods_of_plugin = self.class.instance_methods(false)
@overrides_emit = methods_of_plugin.include?(:emit)
Expand Down
14 changes: 14 additions & 0 deletions test/test_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ def test_configure
# assert_equal Float, d.instance.retry_wait.class
end

class FormatterInjectTestOutput < Fluent::Output
def initialize
super
@formatter = nil
end
end
def test_start
i = FormatterInjectTestOutput.new
i.configure(config_element('ROOT', '', {}, [config_element('inject', '', {'hostname_key' => "host"})]))
assert_nothing_raised do
i.start
end
end

def create_mock_driver(conf=CONFIG)
Fluent::Test::BufferedOutputTestDriver.new(Fluent::BufferedOutput) do
attr_accessor :submit_flush_threads
Expand Down

0 comments on commit a906d40

Please sign in to comment.