lookout-jruby 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjhhMWZhNjdkNDVjOGQ4YzU0N2VmM2M1NjZkMTE4NjdiN2UwMzg0Nw==
5
+ data.tar.gz: !binary |-
6
+ ZWZkNWZlZmU0ZWE2OWFhZWU2MDVjNTE0ZDE3MjdhYjlkMmNkNGRiNg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OWM0ZjE4ZjIyZTczZmQ0N2QxOGE2ODI4N2YyYTEzYjA3YjYzMzY0NDZjMWQ3
10
+ MjBiMTFhYjM5OTJjMTRlYmVjNDdhMjYwZTFkYjZmMjZhYTJmNmE4OWFjNDk2
11
+ NzYzZGIxMjcyZWI0MjU0ZGUzNjExNzY4YTQ2MGZmYWU3MTE5ODI=
12
+ data.tar.gz: !binary |-
13
+ M2M5M2E3YjI1MzJkYmI3YjkwY2EzNDdjNmRiZGUwODY4MDFlZGNjMzI4MmM2
14
+ MGVmYTg0YzIzYzc4Yjg5ZTliOTNjYmM2NGZkYmU0ZDdjODYyYWEzNWQ2Yzk4
15
+ ZDFlZDhhMjUzOGVlOGFhYTBjYjczNzMyOGU1MWJhNTE0NzU4YTM=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in lookout-jruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,14 @@
1
+ Copyright 2009-2013 Jordan Sissel, Pete Fritchman, and contributors.
2
+ Copyright (c) 2014 Lookout, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Lookout::Jruby
2
+
3
+ JRuby hacks/compatibility code for JRUBY-6970
4
+ (https://jira.codehaus.org/browse/JRUBY-6970, fix taken from the Logstash
5
+ project) and for YAML/Configatron
6
+
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'lookout-jruby'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install lookout-jruby
21
+
22
+ ## Usage
23
+
24
+ require 'lookout/jruby' in your project
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it ( http://github.com/lookout/lookout-jruby/fork )
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :test => []
4
+ task :default => :test
@@ -0,0 +1,16 @@
1
+ require "lookout/jruby/version"
2
+
3
+ module Lookout
4
+ module Jruby
5
+ if RUBY_PLATFORM == 'java'
6
+ require 'java'
7
+
8
+ # JRuby cert/path hack
9
+ require 'lookout/jruby/jruby-6970'
10
+ require 'lookout/jruby/jruby-6970-openssl'
11
+
12
+ # JRuby YAML hack
13
+ require 'lookout/jruby/psych'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # Workaround for JRUBY-6970 (https://jira.codehaus.org/browse/JRUBY-6970)
2
+ # taken from the Logstash project, see:
3
+ # <https://github.com/logstash/logstash/blob/master/lib/logstash/JRUBY-6970-openssl.rb>
4
+ class OpenSSL::SSL::SSLContext
5
+ alias_method :ca_path_JRUBY_6970=, :ca_path=
6
+ alias_method :ca_file_JRUBY_6970=, :ca_file=
7
+
8
+ def ca_file=(arg)
9
+ if arg =~ /^jar:file:\//
10
+ return ca_file_JRUBY_6970=(arg.gsub(/^jar:/, ""))
11
+ end
12
+ return ca_file_JRUBY_6970=(arg)
13
+ end
14
+
15
+ def ca_path=(arg)
16
+ if arg =~ /^jar:file:\//
17
+ return ca_path_JRUBY_6970=(arg.gsub(/^jar:/, ""))
18
+ end
19
+ return ca_path_JRUBY_6970=(arg)
20
+ end
21
+ end
@@ -0,0 +1,78 @@
1
+ # Workaround for JRUBY-6970 (https://jira.codehaus.org/browse/JRUBY-6970)
2
+ # taken from the Logstash project, see:
3
+ # <https://github.com/logstash/logstash/blob/master/lib/logstash/JRUBY-6970.rb>
4
+ #
5
+ # Monkeypatch for JRUBY-6970
6
+ module Kernel
7
+ alias_method :require_JRUBY_6970_hack, :require
8
+
9
+ def require(path)
10
+ # Needed because otherwise we might require faraday/request twice and then
11
+ # we have a superclass mismatch
12
+ # https://groups.google.com/forum/#!msg/jruby-users/-lG4Fc2-3UA/bM0cIR_wRr8J
13
+ if path.include?('faraday/request') && defined?(Faraday::Request)
14
+ return false
15
+ end
16
+
17
+ if path =~ /^jar:file:.+!.+/
18
+ path = path.gsub(/^jar:/, "")
19
+ puts "JRUBY-6970: require(#{path})" if ENV["REQUIRE_DEBUG"] == "1"
20
+ end
21
+
22
+ # JRUBY-7065
23
+ path = File.expand_path(path) if path.include?("/../")
24
+ rc = require_JRUBY_6970_hack(path)
25
+
26
+ # Only monkeypatch openssl after it's been loaded.
27
+ if path == "openssl"
28
+ require "lookout/jruby/jruby-6970-openssl"
29
+ end
30
+ return rc
31
+ end
32
+ end
33
+
34
+ # Work around for a bug in File.expand_path that doesn't account for resources
35
+ # in jar paths.
36
+ #
37
+ # Should solve this error:
38
+ # Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException:
39
+ # (Errno::ENOENT) file:/home/jls/projects/logstash/build/data/unicode.data
40
+ class File
41
+ class << self
42
+ alias_method :expand_path_JRUBY_6970, :expand_path
43
+
44
+ def expand_path(path, dir=nil)
45
+ #p :expand_path => [path, dir]
46
+ if path =~ /(jar:)?file:\/.*\.jar!/
47
+ #p :expand_path_path => [path, dir]
48
+ jar, resource = path.split("!", 2)
49
+ #p :expand_path => [jar, resource]
50
+ if resource.nil? || resource == ""
51
+ # Nothing after the "!", nothing special to handle.
52
+ return expand_path_JRUBY_6970(path, dir)
53
+ else
54
+ resource = expand_path_JRUBY_6970(resource, dir)
55
+ # TODO(sissel): use LogStash::Util::UNAME
56
+ if RbConfig::CONFIG["host_os"] == "mswin32"
57
+ # 'expand_path' on "/" will return "C:/" on windows.
58
+ # So like.. we don't want that because technically this
59
+ # is the root of the jar, not of a disk.
60
+ puts :expand_path => [path, "#{jar}!#{resource.gsub(/^[A-Za-z]:/, "")}"]
61
+ return "#{jar}!#{resource.gsub(/^[A-Za-z]:/, "")}"
62
+ else
63
+ return "#{jar}!#{resource}"
64
+ end
65
+ end
66
+ elsif dir.to_s =~ /(jar:)?file:\/.*\.jar!/
67
+ jar, dir = dir.to_s.split("!", 2)
68
+ if dir.empty?
69
+ # sometimes the original dir is just 'file:/foo.jar!'
70
+ return File.join("#{jar}!", path)
71
+ end
72
+ return "#{jar}!#{expand_path_JRUBY_6970(path, dir)}"
73
+ else
74
+ return expand_path_JRUBY_6970(path, dir)
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,7 @@
1
+ # This hack is required because YAML is all kinds of messed up and incompatible
2
+ # with our version of Configatron under JRuby
3
+ module Psych
4
+ module Yecht
5
+ MergeKey = nil
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Lookout
2
+ module Jruby
3
+ VERSION = "1.2.1"
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'lookout/jruby/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "lookout-jruby"
8
+ spec.version = Lookout::Jruby::VERSION
9
+ spec.authors = ["Ian Smith"]
10
+ spec.email = ["ian.smith@lookout.com"]
11
+ spec.summary = %q{JRuby hacks}
12
+ spec.description = %q{}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lookout-jruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Ian Smith
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: ''
42
+ email:
43
+ - ian.smith@lookout.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/lookout/jruby.rb
54
+ - lib/lookout/jruby/jruby-6970-openssl.rb
55
+ - lib/lookout/jruby/jruby-6970.rb
56
+ - lib/lookout/jruby/psych.rb
57
+ - lib/lookout/jruby/version.rb
58
+ - lookout-jruby.gemspec
59
+ homepage: ''
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.0.5
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: JRuby hacks
83
+ test_files: []
84
+ has_rdoc: