Skip to content

Commit

Permalink
Fixed misc
Browse files Browse the repository at this point in the history
Add ensure to re-assignment of timezone.
Remove unnecessary code.
  • Loading branch information
ganmacs committed Sep 1, 2016
1 parent e186971 commit 9eda447
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/fluent/command/unpacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def call
File.open(@path, 'r') do |io|
i = 1
Fluent::MessagePackFactory.unpacker(io).each do |(time, record)|
print @formatter.format(@path, time, record) # tag is use for tag
print @formatter.format(@path, time, record) # path is used for tag
break if i == @options[:count] && @options[:count] != -1
i += 1
end
Expand Down Expand Up @@ -195,10 +195,6 @@ class Cat < Head
count: -1
}

def initialize(argv = ARGV)
super
end

def default_options
DEFAULT_CAT_OPTIONS
end
Expand Down
1 change: 1 addition & 0 deletions test/command/test_unpacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def timezone(timezone = 'UTC')
old = ENV['TZ']
ENV['TZ'] = timezone
yield
ensure
ENV['TZ'] = old
end

Expand Down

0 comments on commit 9eda447

Please sign in to comment.