Skip to content

Commit

Permalink
- don't need to extract the file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed May 3, 2013
1 parent 9e06b92 commit f4409ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/logstash/filters/useragent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def register
begin
# Running from a flatjar which has a different layout
jar_path = [__FILE__.split("!").first, "/vendor/ua-parser/regexes.yaml"].join("!")
tmp_file = Tempfile.new('logstash-uaparser-regexes')
tmp_file.write(File.read(jar_path))
tmp_file.close # this file is reaped when ruby exits
@parser = UserAgentParser::Parser.new(:patterns_path => tmp_file.path)
#tmp_file = Tempfile.new('logstash-uaparser-regexes')
#tmp_file.write(File.read(jar_path))
#tmp_file.close # this file is reaped when ruby exits
@parser = UserAgentParser::Parser.new(:patterns_path => jar_path)
rescue => ex
raise "Failed to cache, due to: #{ex}\n#{ex.backtrace}"
end
Expand Down

0 comments on commit f4409ad

Please sign in to comment.