metasploit-model 0.27.2-java → 0.27.3-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/lib/metasploit/model/file.rb +38 -40
- data/lib/metasploit/model/version.rb +1 -1
- data/spec/lib/metasploit/model/file_spec.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f169ffc2ee698dff8714d1756150bee02cafc92
|
4
|
+
data.tar.gz: 543fe4f1899063a7384934f7d0d9234b094fb78c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 044a7b6c43b7c04dee098f4e83ef1eea639cb2fe4aeeb773b0cdc2497622b60f5db6406e1d65532d4c435862350ca51d1b0201c6503e321fed43a63dc8a0e816
|
7
|
+
data.tar.gz: 046c15aadb40c580c3a022ab92eafec39a86dd4841b198322999fef1f09cfe20716624459bbe4549bc66eb5e2700687f4c166e41d388fc4154e9ee954827f7f5
|
data/.travis.yml
CHANGED
@@ -1,49 +1,47 @@
|
|
1
|
-
|
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
|
-
|
6
|
-
module
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
20
|
-
|
21
|
-
end
|
17
|
+
file.canonical_path
|
18
|
+
end
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
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 =
|
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.
|
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-
|
11
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|