metasploit-model 0.27.2-java → 0.27.3-java

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: c46dce723315fb4a86dcd57d2801f925142d73c8
4
- data.tar.gz: 89af4916b2791506fa3173e1084c938fc3f0310c
3
+ metadata.gz: 8f169ffc2ee698dff8714d1756150bee02cafc92
4
+ data.tar.gz: 543fe4f1899063a7384934f7d0d9234b094fb78c
5
5
  SHA512:
6
- metadata.gz: 1f3769e90062bc8b63bbffe3ad8cd214eb626d800013db1ff1b95d711c90520a40e048d6c5f889b105da6c63712c5e3f53edf7e6d660502d1c5b6b2e8a1bd666
7
- data.tar.gz: ef110769de258bf7fd1ab25dd66894a3de53b6585a2b02849a4fbcc708e2a84a5d02709bc1819f34c7575e1397673bc7982d296621174269c9dbe009f99566c5
6
+ metadata.gz: 044a7b6c43b7c04dee098f4e83ef1eea639cb2fe4aeeb773b0cdc2497622b60f5db6406e1d65532d4c435862350ca51d1b0201c6503e321fed43a63dc8a0e816
7
+ data.tar.gz: 046c15aadb40c580c3a022ab92eafec39a86dd4841b198322999fef1f09cfe20716624459bbe4549bc66eb5e2700687f4c166e41d388fc4154e9ee954827f7f5
@@ -3,4 +3,7 @@ rvm:
3
3
  - '1.9.3'
4
4
  - '2.0'
5
5
  - '2.1'
6
+ # < 1.7.14
7
+ - 'jruby-1.7.13'
8
+ # >= 1.7.14
6
9
  - 'jruby-19mode'
@@ -1,49 +1,47 @@
1
- if RUBY_PLATFORM =~ /java/
1
+ require 'metasploit/model'
2
+
3
+ if RUBY_PLATFORM =~ /java/ && Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('1.7.14')
2
4
  require 'java'
3
- end
4
5
 
5
- module Metasploit
6
- module Model
7
- # Re-implement methods on ruby's File that are buggy in JRuby so that the platform specific logic can be in this
8
- # module instead of everywhere these methods are used.
9
- module File
10
- if RUBY_PLATFORM =~ /java/
11
- # On JRuby, File.realpath does not resolve symlinks, so need to drop to Java to get the real path.
12
- #
13
- # @param path [String] a path that may contain `'.'`, `'..'`, or symlinks
14
- # @return [String] canonical path
15
- # @see https://github.com/jruby/jruby/issues/538
16
- def self.realpath(path)
17
- file = java.io.File.new(path)
6
+ # Re-implement methods on ruby's File that are buggy in JRuby so that the platform specific logic can be in this
7
+ # module instead of everywhere these methods are used.
8
+ module Metasploit::Model::File
9
+ # On JRuby (< 1.7.14), File.realpath does not resolve symlinks, so need to drop to Java to get the real path.
10
+ #
11
+ # @param path [String] a path that may contain `'.'`, `'..'`, or symlinks
12
+ # @return [String] canonical path
13
+ # @see https://github.com/jruby/jruby/issues/538
14
+ def self.realpath(path)
15
+ file = java.io.File.new(path)
18
16
 
19
- file.canonical_path
20
- end
21
- end
17
+ file.canonical_path
18
+ end
22
19
 
23
- class << self
24
- # Delegates to `::File` if `::File` supports the method when {Metasploit::Model::File} does not implement an
25
- # override to fix different platform incompatibilities.
26
- #
27
- # @param method_name [Symbol] name of method.
28
- # @param args [Array] arguments passed to method with name `method_name`.
29
- # @param block [Proc] block to pass after `args` to method with name `method_name`.
30
- def method_missing(method_name, *args, &block)
31
- if ::File.respond_to?(method_name)
32
- ::File.public_send(method_name, *args, &block)
33
- else
34
- super
35
- end
20
+ class << self
21
+ # Delegates to `::File` if `::File` supports the method when {Metasploit::Model::File} does not implement an
22
+ # override to fix different platform incompatibilities.
23
+ #
24
+ # @param method_name [Symbol] name of method.
25
+ # @param args [Array] arguments passed to method with name `method_name`.
26
+ # @param block [Proc] block to pass after `args` to method with name `method_name`.
27
+ def method_missing(method_name, *args, &block)
28
+ if ::File.respond_to?(method_name)
29
+ ::File.public_send(method_name, *args, &block)
30
+ else
31
+ super
36
32
  end
33
+ end
37
34
 
38
- # Whether this module or `::File` responds to `method_name`.
39
- #
40
- # @param method_name [Symbol] name of method.
41
- # @param include_private [Boolean] whether to include private methods.
42
- # @return [Boolean]
43
- def respond_to?(method_name, include_private=false)
44
- ::File.respond_to?(method_name, include_private) || super
45
- end
35
+ # Whether this module or `::File` responds to `method_name`.
36
+ #
37
+ # @param method_name [Symbol] name of method.
38
+ # @param include_private [Boolean] whether to include private methods.
39
+ # @return [Boolean]
40
+ def respond_to?(method_name, include_private=false)
41
+ ::File.respond_to?(method_name, include_private) || super
46
42
  end
47
43
  end
48
44
  end
49
- end
45
+ else
46
+ Metasploit::Model::File = ::File
47
+ end
@@ -7,7 +7,7 @@ module Metasploit
7
7
  # The minor version number, scoped to the {MAJOR} version number.
8
8
  MINOR = 27
9
9
  # The patch number, scoped to the {MINOR} version number.
10
- PATCH = 2
10
+ PATCH = 3
11
11
 
12
12
  # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
13
13
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
@@ -1,6 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Metasploit::Model::File do
4
+ unless RUBY_PLATFORM =~ /java/ && Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('1.7.14')
5
+ it 'aliases ::File' do
6
+ expect(described_class).to equal(::File)
7
+ end
8
+ end
9
+
4
10
  context 'realpath' do
5
11
  let(:real_basename) do
6
12
  'real'
@@ -30,7 +36,7 @@ describe Metasploit::Model::File do
30
36
  described_class.realpath(symlink_pathname.to_path)
31
37
  end
32
38
 
33
- if RUBY_PLATFORM =~ /java/
39
+ if RUBY_PLATFORM =~ /java/ && Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('1.7.14')
34
40
  it 'should be necessary because File.realpath does not resolve symlinks' do
35
41
  File.realpath(symlink_pathname.to_path).should_not == real_pathname.to_path
36
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.2
4
+ version: 0.27.3
5
5
  platform: java
6
6
  authors:
7
7
  - Luke Imhoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
11
+ date: 2014-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler