logstash-core 1.5.0.rc3.snapshot3-java → 1.5.0.rc3.snapshot4-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of logstash-core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 349047620a2726f0c42566a25c9e6a2b229d9ece
4
- data.tar.gz: d6d9a858c12499f66ff7f0d2e250267208bd77d3
3
+ metadata.gz: 6bb968a4b584644456a6f45c2e3d7adcf8da5e9c
4
+ data.tar.gz: 3439e9929c164e31daf11a7061e3990f71ecadf8
5
5
  SHA512:
6
- metadata.gz: e5fe3f78adde94e7fbc5327fdebb3534f3086f14d86d558a6f225c930256bbdf7edd9ce175bc08757e6c3cbc6872db8166a25f439718712a3eb20b5c5e4a18d0
7
- data.tar.gz: d0f571cbc5d26b5b0a54a4e79b3ca87abb698bd5d4ad9a05bc6ff7ecfdf7f1f726f1b40c99643c99319f58d742d45f06f08c7a7c95048421051f7f2a9ada60cc
6
+ metadata.gz: 0882eab882091ad08fb1eee07b681665d34418d9fc669362257c236a09a9be8da34f68b3be6401febc1cded7a91c2f49134eb2b1e903d2348fb56d259b410c39
7
+ data.tar.gz: 6688bd4c05c3c25c40b3b9f0806c6370fb24abbb8f34bb89c631c7746d1f4b00dd589e1e066f2742d38b63857d6cf440201c11da49f13e7310c67f597513f376
@@ -1,25 +1,4 @@
1
- require "bundler"
2
- require "bundler/cli"
3
-
4
- module Bundler
5
- # Patch bundler to write a .lock file specific to the version of ruby.
6
- # This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates
7
- module SharedHelpers
8
- def default_lockfile
9
- ruby = "#{LogStash::Environment.ruby_engine}-#{LogStash::Environment.ruby_abi_version}"
10
- Pathname.new("#{default_gemfile}.#{ruby}.lock")
11
- end
12
- end
13
-
14
- # Add the Bundler.reset! method which has been added in master but is not in 1.7.9.
15
- class << self
16
- unless self.method_defined?("reset!")
17
- def reset!
18
- @definition = nil
19
- end
20
- end
21
- end
22
- end
1
+ require "logstash/environment"
23
2
 
24
3
  module LogStash
25
4
  module Bundler
@@ -46,6 +25,32 @@ module LogStash
46
25
  return [package, target_path]
47
26
  end
48
27
 
28
+ def self.setup!(options = {})
29
+ options = {:without => [:development]}.merge(options)
30
+ options[:without] = Array(options[:without])
31
+
32
+ # make sure we use our own installed bundler
33
+ require "logstash/patches/rubygems" # patch rubygems before clear_paths
34
+ ::Gem.clear_paths
35
+ ::Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = LogStash::Environment.logstash_gem_home
36
+
37
+ # set BUNDLE_GEMFILE ENV before requiring bundler to avoid bundler recurse and load unrelated Gemfile(s)
38
+ ENV["BUNDLE_GEMFILE"] = LogStash::Environment::GEMFILE_PATH
39
+
40
+ require "bundler"
41
+ require "logstash/bundler"
42
+ require "logstash/patches/bundler"
43
+
44
+ ::Bundler.settings[:path] = LogStash::Environment::BUNDLE_DIR
45
+ ::Bundler.settings[:without] = options[:without].join(":")
46
+ # in the context of Bundler.setup it looks like this is useless here because Gemfile path can only be specified using
47
+ # the ENV, see https://github.com/bundler/bundler/blob/v1.8.3/lib/bundler/shared_helpers.rb#L103
48
+ ::Bundler.settings[:gemfile] = LogStash::Environment::GEMFILE_PATH
49
+
50
+ ::Bundler.reset!
51
+ ::Bundler.setup
52
+ end
53
+
49
54
  # capture any $stdout from the passed block. also trap any exception in that block, in which case the trapped exception will be returned
50
55
  # @param [Proc] the code block to execute
51
56
  # @return [String, Exception] the captured $stdout string and any trapped exception or nil if none
@@ -73,7 +78,19 @@ module LogStash
73
78
  options[:without] = Array(options[:without])
74
79
  options[:update] = Array(options[:update]) if options[:update]
75
80
 
76
- ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
81
+ # make sure we use our own installed bundler
82
+ require "logstash/patches/rubygems" # patch rubygems before clear_paths
83
+ ::Gem.clear_paths
84
+ ::Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = LogStash::Environment.logstash_gem_home
85
+
86
+ # set BUNDLE_GEMFILE ENV before requiring bundler to avoid bundler recurse and load unrelated Gemfile(s).
87
+ # in the context of calling Bundler::CLI this is not really required since Bundler::CLI will look at
88
+ # Bundler.settings[:gemfile] unlike Bundler.setup. For the sake of consistency and defensive/future proofing, let's keep it here.
89
+ ENV["BUNDLE_GEMFILE"] = LogStash::Environment::GEMFILE_PATH
90
+
91
+ require "bundler"
92
+ require "bundler/cli"
93
+ require "logstash/patches/bundler"
77
94
 
78
95
  # force Rubygems sources to our Gemfile sources
79
96
  ::Gem.sources = options[:rubygems_source] if options[:rubygems_source]
@@ -472,7 +472,7 @@ module LogStash::Config::Mixin
472
472
  bytes = Integer(value.first) rescue nil
473
473
  result = bytes || Filesize.from(value.first).to_i
474
474
  rescue ArgumentError
475
- return false, "Unparseable filesize: #{value.first}. possible units (KiB, MiB, ...) e.g. '10 KiB'. doc reference: http://www.elasticsearch.org/guide/en/logstash/current/_logstash_config_language.html#bytes"
475
+ return false, "Unparseable filesize: #{value.first}. possible units (KiB, MiB, ...) e.g. '10 KiB'. doc reference: http://www.elastic.co/guide/en/logstash/current/configuration.html#bytes"
476
476
  end
477
477
  else
478
478
  return false, "Unknown validator symbol #{validator}"
@@ -1,44 +1,6 @@
1
1
  require "logstash/errors"
2
2
  require "logstash/version"
3
3
 
4
- # monkey patch RubyGems to silence ffi warnings:
5
- #
6
- # WARN: Unresolved specs during Gem::Specification.reset:
7
- # ffi (>= 0)
8
- # WARN: Clearing out unresolved specs.
9
- # Please report a bug if this causes problems.
10
- #
11
- # see https://github.com/elasticsearch/logstash/issues/2556 and https://github.com/rubygems/rubygems/issues/1070
12
- #
13
- # this code is from Rubygems v2.1.9 in JRuby 1.7.17. Per tickets this issue should be solved at JRuby >= 1.7.20.
14
-
15
- # this method implementation works for Rubygems version 2.1.0 and up, verified up to 2.4.6
16
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("2.1.0") && Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.5.0")
17
- class Gem::Specification
18
- def self.reset
19
- @@dirs = nil
20
- Gem.pre_reset_hooks.each { |hook| hook.call }
21
- @@all = nil
22
- @@stubs = nil
23
- _clear_load_cache
24
- unresolved = unresolved_deps
25
- unless unresolved.empty?
26
- unless (unresolved.size == 1 && unresolved["ffi"])
27
- w = "W" + "ARN"
28
- warn "#{w}: Unresolved specs during Gem::Specification.reset:"
29
- unresolved.values.each do |dep|
30
- warn " #{dep}"
31
- end
32
- warn "#{w}: Clearing out unresolved specs."
33
- warn "Please report a bug if this causes problems."
34
- end
35
- unresolved.clear
36
- end
37
- Gem.post_reset_hooks.each { |hook| hook.call }
38
- end
39
- end
40
- end
41
-
42
4
  module LogStash
43
5
  module Environment
44
6
  extend self
@@ -72,29 +34,6 @@ module LogStash
72
34
  env.downcase == "test"
73
35
  end
74
36
 
75
- def bundler_setup!(options = {})
76
- options = {:without => [:development]}.merge(options)
77
- options[:without] = Array(options[:without])
78
- # make sure we use our own nicely installed bundler and not a rogue, bad, mean, ugly, stupid other bundler. bad bundler, bad bad bundler go away.
79
- ::Gem.clear_paths
80
- ::Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = logstash_gem_home
81
-
82
- # set BUNDLE_GEMFILE ENV before requiring bundler to avoid bundler recurse and load unrelated Gemfile(s)
83
- ENV["BUNDLE_GEMFILE"] = LogStash::Environment::GEMFILE_PATH
84
-
85
- require "bundler"
86
- require "logstash/bundler"
87
-
88
- ::Bundler.settings[:path] = LogStash::Environment::BUNDLE_DIR
89
- ::Bundler.settings[:without] = options[:without].join(":")
90
- # in the context of Bundler.setup it looks like this is useless here because Gemfile path can only be specified using
91
- # the ENV, see https://github.com/bundler/bundler/blob/v1.8.3/lib/bundler/shared_helpers.rb#L103
92
- ::Bundler.settings[:gemfile] = LogStash::Environment::GEMFILE_PATH
93
-
94
- ::Bundler.reset!
95
- ::Bundler.setup
96
- end
97
-
98
37
  def runtime_jars_root(dir_name, package)
99
38
  ::File.join(dir_name, package, "runtime-jars")
100
39
  end
@@ -24,24 +24,39 @@ class Hash
24
24
  end
25
25
  end
26
26
 
27
+ # map_mixin to patch LinkedHashMap and HashMap. it must be done directly on the classes,
28
+ # using a module mixin does not work, and injecting in the Map interface does not work either
29
+ # but injecting in the class works.
27
30
 
28
- # this is a temporary fix to solve a bug in JRuby where classes implementing the Map interface, like LinkedHashMap
29
- # have a bug in the has_key? method that is implemented in the Enumerable module that is somehow mixed in the Map interface.
30
- # this bug makes has_key? (and all its aliases) return false for a key that has a nil value.
31
- # Only LinkedHashMap is patched here because patching the Map interface is not working.
32
- # TODO find proper fix, and submit upstream
33
- # releavant JRuby files:
34
- # https://github.com/jruby/jruby/blob/master/core/src/main/ruby/jruby/java/java_ext/java.util.rb
35
- # https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java
36
- class Java::JavaUtil::LinkedHashMap
31
+ map_mixin = lambda do
32
+ # this is a temporary fix to solve a bug in JRuby where classes implementing the Map interface, like LinkedHashMap
33
+ # have a bug in the has_key? method that is implemented in the Enumerable module that is somehow mixed in the Map interface.
34
+ # this bug makes has_key? (and all its aliases) return false for a key that has a nil value.
35
+ # Only LinkedHashMap is patched here because patching the Map interface is not working.
36
+ # TODO find proper fix, and submit upstream
37
+ # releavant JRuby files:
38
+ # https://github.com/jruby/jruby/blob/master/core/src/main/ruby/jruby/java/java_ext/java.util.rb
39
+ # https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java
37
40
  def has_key?(key)
38
41
  self.containsKey(key)
39
42
  end
40
43
  alias_method :include?, :has_key?
41
44
  alias_method :member?, :has_key?
42
45
  alias_method :key?, :has_key?
46
+
47
+ # Java 8 Map implements a merge method with a different signature from
48
+ # the Ruby Hash#merge. see https://github.com/jruby/jruby/issues/1249
49
+ # this can be removed when fixed upstream
50
+ if ENV_JAVA['java.specification.version'] >= '1.8'
51
+ def merge(other)
52
+ dup.merge!(other)
53
+ end
54
+ end
43
55
  end
44
56
 
57
+ Java::JavaUtil::LinkedHashMap.module_exec(&map_mixin)
58
+ Java::JavaUtil::HashMap.module_exec(&map_mixin)
59
+
45
60
  module java::util::Map
46
61
  # have Map objects like LinkedHashMap objects report is_a?(Array) == true
47
62
  def is_a?(clazz)
@@ -0,0 +1,20 @@
1
+ # Bundler monkey patches
2
+ module ::Bundler
3
+ # Patch bundler to write a .lock file specific to the version of ruby.
4
+ # This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates
5
+ module SharedHelpers
6
+ def default_lockfile
7
+ ruby = "#{LogStash::Environment.ruby_engine}-#{LogStash::Environment.ruby_abi_version}"
8
+ Pathname.new("#{default_gemfile}.#{ruby}.lock")
9
+ end
10
+ end
11
+
12
+ # Add the Bundler.reset! method which has been added in master but is not in 1.7.9.
13
+ class << self
14
+ unless self.method_defined?("reset!")
15
+ def reset!
16
+ @definition = nil
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,37 @@
1
+ # monkey patch RubyGems to silence ffi warnings:
2
+ #
3
+ # WARN: Unresolved specs during Gem::Specification.reset:
4
+ # ffi (>= 0)
5
+ # WARN: Clearing out unresolved specs.
6
+ # Please report a bug if this causes problems.
7
+ #
8
+ # see https://github.com/elasticsearch/logstash/issues/2556 and https://github.com/rubygems/rubygems/issues/1070
9
+ #
10
+ # this code is from Rubygems v2.1.9 in JRuby 1.7.17. Per tickets this issue should be solved at JRuby >= 1.7.20.
11
+ #
12
+ # this method implementation works for Rubygems version 2.1.0 and up, verified up to 2.4.6
13
+ if ::Gem::Version.new(::Gem::VERSION) >= ::Gem::Version.new("2.1.0") && ::Gem::Version.new(::Gem::VERSION) < ::Gem::Version.new("2.5.0")
14
+ class ::Gem::Specification
15
+ def self.reset
16
+ @@dirs = nil
17
+ ::Gem.pre_reset_hooks.each { |hook| hook.call }
18
+ @@all = nil
19
+ @@stubs = nil
20
+ _clear_load_cache
21
+ unresolved = unresolved_deps
22
+ unless unresolved.empty?
23
+ unless (unresolved.size == 1 && unresolved["ffi"])
24
+ w = "W" + "ARN"
25
+ warn "#{w}: Unresolved specs during Gem::Specification.reset:"
26
+ unresolved.values.each do |dep|
27
+ warn " #{dep}"
28
+ end
29
+ warn "#{w}: Clearing out unresolved specs."
30
+ warn "Please report a bug if this causes problems."
31
+ end
32
+ unresolved.clear
33
+ end
34
+ ::Gem.post_reset_hooks.each { |hook| hook.call }
35
+ end
36
+ end
37
+ end
@@ -32,6 +32,7 @@ class LogStash::PluginManager::Command < Clamp::Command
32
32
  end
33
33
 
34
34
  def relative_path(path)
35
- Pathname.new(path).relative_path_from(Pathname.new(LogStash::Environment::LOGSTASH_HOME)).to_s
35
+ require "pathname"
36
+ ::Pathname.new(path).relative_path_from(::Pathname.new(LogStash::Environment::LOGSTASH_HOME)).to_s
36
37
  end
37
38
  end
@@ -2,6 +2,7 @@ require 'clamp'
2
2
  require 'logstash/namespace'
3
3
  require 'logstash/pluginmanager/util'
4
4
  require 'logstash/pluginmanager/command'
5
+ require "logstash/bundler"
5
6
  require 'rubygems/spec_fetcher'
6
7
 
7
8
  class LogStash::PluginManager::List < LogStash::PluginManager::Command
@@ -16,8 +17,7 @@ class LogStash::PluginManager::List < LogStash::PluginManager::Command
16
17
  end
17
18
 
18
19
  def execute
19
- require 'logstash/environment'
20
- LogStash::Environment.bundler_setup!
20
+ LogStash::Bundler.setup!
21
21
 
22
22
  signal_error("No plugins found") if filtered_specs.empty?
23
23
 
@@ -1,15 +1,17 @@
1
1
  # encoding: utf-8
2
2
 
3
+ Thread.abort_on_exception = true
4
+
3
5
  Encoding.default_external = Encoding::UTF_8
4
6
  $START = Time.now
5
7
  $DEBUGLIST = (ENV["DEBUG"] || "").split(",")
6
8
 
9
+ require "logstash/bundler"
10
+ LogStash::Bundler.setup!
11
+
7
12
  require "logstash/environment"
8
- LogStash::Environment.bundler_setup!
9
13
  LogStash::Environment.load_locale!
10
14
 
11
- Thread.abort_on_exception = true
12
-
13
15
  require "logstash/namespace"
14
16
  require "logstash/program"
15
17
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # The version of logstash.
3
- LOGSTASH_VERSION = "1.5.0-rc3.snapshot3"
3
+ LOGSTASH_VERSION = "1.5.0-rc3.snapshot4"
4
4
 
5
5
  # Note to authors: this should not include dashes because 'gem' barfs if
6
6
  # you include a dash in the version string.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.rc3.snapshot3
4
+ version: 1.5.0.rc3.snapshot4
5
5
  platform: java
6
6
  authors:
7
7
  - Jordan Sissel
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-04-16 00:00:00.000000000 Z
13
+ date: 2015-04-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cabin
@@ -312,8 +312,10 @@ files:
312
312
  - lib/logstash/outputs/base.rb
313
313
  - lib/logstash/patches.rb
314
314
  - lib/logstash/patches/bugfix_jruby_2558.rb
315
+ - lib/logstash/patches/bundler.rb
315
316
  - lib/logstash/patches/cabin.rb
316
317
  - lib/logstash/patches/profile_require_calls.rb
318
+ - lib/logstash/patches/rubygems.rb
317
319
  - lib/logstash/pipeline.rb
318
320
  - lib/logstash/plugin.rb
319
321
  - lib/logstash/pluginmanager.rb
@@ -363,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
365
  version: 1.3.1
364
366
  requirements: []
365
367
  rubyforge_project:
366
- rubygems_version: 2.4.5
368
+ rubygems_version: 2.2.2
367
369
  signing_key:
368
370
  specification_version: 4
369
371
  summary: logstash-core - The core components of logstash