lookout-jruby 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97fb7c5544b01d106d3995cb395e49c1593ace91
4
- data.tar.gz: 65e8851a9c45f8a909943c397d8d73c228b25fec
3
+ metadata.gz: d2787a5e23b8927d67987b9b33751b54c5a3bf43
4
+ data.tar.gz: c8185a3ef4a80f90abf25f7bc42fa76e13d89900
5
5
  SHA512:
6
- metadata.gz: ef3455175042a0382e9892bb2a62e68e55980b092e0753f746d44a44ed3e102d7264bae1e7e137b3188dae77fab01e37e31f4692ca50ee4c1f8f6d5442e1b7bb
7
- data.tar.gz: 6f8c064aa4db61d3c5a03a1950c8912327df7d4752d535c57537fe0d3c7def6060c389886d047d9d65a60df4080ea953717ba20cc7d1296b127c18951aefb610
6
+ metadata.gz: 2affda2e94e729f07340a9b60e87b509bcacc1718a0ba40c6a966cec6aced5fc0503a4e380d955e1a43672d2b4c8308dc0981fe73901d3072713e9aed9fef264
7
+ data.tar.gz: 7e6fe8e4a25bed4f7959692b6b1aa1c7918f6b9030c6a9ddb3186ef9a506de857dbcb0855f3c53872aed39008118ac3c5a763545cfedd14d75c678b2b6c82df5
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - jruby-1.7.21
4
+ - jruby-9.0.0.0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lookout::Jruby
2
2
 
3
- JRuby hacks/compatibility code for YAML/Configatron
3
+ JRuby hacks/compatibility code for YAML/Configatron and loading yaml files via uri:classloader:/ pseudo-protocol.
4
4
 
5
5
  ## Installation
6
6
 
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task :test => []
4
- task :default => :test
3
+ require "rspec/core/rake_task"
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task :default => :spec
@@ -1,3 +1,23 @@
1
+ # this is workaround for https://github.com/jruby/jruby/issues/3306
2
+
3
+ # jruby-9k just works
4
+ if JRUBY_VERSION.start_with?("1.")
5
+ require 'yaml'
6
+ module YAML
7
+ class << self
8
+ alias :_load_file :load_file
9
+
10
+ def load_file( filename )
11
+ if filename.start_with?("uri:classloader:/")
12
+ self.load(File.read(filename))
13
+ else
14
+ _load_file(filename)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
1
21
  # This hack is required because YAML is all kinds of messed up and incompatible
2
22
  # with our version of Configatron under JRuby
3
23
  module Psych
@@ -1,5 +1,5 @@
1
1
  module Lookout
2
2
  module Jruby
3
- VERSION = "2.1.0"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Ian Smith"]
10
10
  spec.email = ["ian.smith@lookout.com"]
11
11
  spec.summary = %q{JRuby hacks}
12
- spec.description = %q{}
13
- spec.homepage = ""
12
+ spec.description = %q{JRuby hacks for some yaml issues}
13
+ spec.homepage = "https://github.com/lookout/lookout-jruby"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -19,5 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "rake", '~> 10.2'
23
+ spec.add_development_dependency 'rspec', '~> 3.3'
23
24
  end
data/spec/some.yml ADDED
@@ -0,0 +1 @@
1
+ hello: world
data/spec/yaml_spec.rb ADDED
@@ -0,0 +1,33 @@
1
+ unless defined? JRUBY_VERSION
2
+ exit
3
+ end
4
+
5
+ $: << File.expand_path( '../../lib', __FILE__ )
6
+
7
+ $CLASSPATH << File.dirname(__FILE__)
8
+
9
+ require 'lookout/jruby'
10
+ require 'yaml'
11
+
12
+ describe YAML do
13
+
14
+ let( :expected ) { { 'hello' => 'world' } }
15
+
16
+ it 'is not patched for jruby-9k' do
17
+ if JRUBY_VERSION.start_with?('9.')
18
+ expect( YAML.respond_to?(:_load_file) ).to be false
19
+ end
20
+ end
21
+
22
+ it 'loads file from filesystem' do
23
+ data = YAML.load_file(File.expand_path('../some.yml', __FILE__))
24
+ expect( data ).to eq expected
25
+ end
26
+
27
+ it 'loads file from classloader' do
28
+ data = YAML.load_file('uri:classloader:/some.yml')
29
+ expect( data ).to eq expected
30
+ end
31
+
32
+ end
33
+
metadata CHANGED
@@ -1,44 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2015-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '1.5'
14
19
  name: bundler
20
+ prerelease: false
21
+ type: :development
15
22
  version_requirements: !ruby/object:Gem::Requirement
16
23
  requirements:
17
24
  - - ~>
18
25
  - !ruby/object:Gem::Version
19
26
  version: '1.5'
27
+ - !ruby/object:Gem::Dependency
20
28
  requirement: !ruby/object:Gem::Requirement
21
29
  requirements:
22
30
  - - ~>
23
31
  - !ruby/object:Gem::Version
24
- version: '1.5'
32
+ version: '10.2'
33
+ name: rake
25
34
  prerelease: false
26
35
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
36
  version_requirements: !ruby/object:Gem::Requirement
30
37
  requirements:
31
- - - '>='
38
+ - - ~>
32
39
  - !ruby/object:Gem::Version
33
- version: '0'
40
+ version: '10.2'
41
+ - !ruby/object:Gem::Dependency
34
42
  requirement: !ruby/object:Gem::Requirement
35
43
  requirements:
36
- - - '>='
44
+ - - ~>
37
45
  - !ruby/object:Gem::Version
38
- version: '0'
46
+ version: '3.3'
47
+ name: rspec
39
48
  prerelease: false
40
49
  type: :development
41
- description: ''
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '3.3'
55
+ description: JRuby hacks for some yaml issues
42
56
  email:
43
57
  - ian.smith@lookout.com
44
58
  executables: []
@@ -46,6 +60,7 @@ extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
62
  - .gitignore
63
+ - .travis.yml
49
64
  - Gemfile
50
65
  - LICENSE.txt
51
66
  - README.md
@@ -54,7 +69,9 @@ files:
54
69
  - lib/lookout/jruby/psych.rb
55
70
  - lib/lookout/jruby/version.rb
56
71
  - lookout-jruby.gemspec
57
- homepage: ''
72
+ - spec/some.yml
73
+ - spec/yaml_spec.rb
74
+ homepage: https://github.com/lookout/lookout-jruby
58
75
  licenses:
59
76
  - MIT
60
77
  metadata: {}
@@ -78,4 +95,6 @@ rubygems_version: 2.4.5
78
95
  signing_key:
79
96
  specification_version: 4
80
97
  summary: JRuby hacks
81
- test_files: []
98
+ test_files:
99
+ - spec/some.yml
100
+ - spec/yaml_spec.rb