metasploit-model 0.27.2 → 0.27.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzdiMDBhZGU3ZWU4NDUwOGY1ZDkyNjk0M2RkZWI0MjUzOGQ3ZTI0Zg==
4
+ YjBmNjY2ZGRlNTM3YTU2YzM3NDNkYTNjMzVjZGZhNDQ5NzVmN2JkMQ==
5
5
  data.tar.gz: !binary |-
6
- YjJmNjk5MmI2OTRkNGM1MmIxNThlNDU5OTYzODY1NzJlNzQ4ODExOA==
6
+ NDQxMDVlMzA1NWU5NjdkMjQzZmFmYjc3MjAzZjA3MTY4NTNkZjc5NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWFkODQ0NmJiYmQ0YmE4OTgxZDlhODhlOGM0ZDIzNGFjMTBiMGYwNDE5NzEx
10
- ZDg1OGUxYmEwNWViYWIyOWU1MTA3OWVkMzE3NTlhOWFiNmZmYThlMjc4YzBi
11
- Yjk5YjhkZTQzYjBlNzQzOGJlNDNiNDJiMzE0NzBlNDg2NGFkZTI=
9
+ NmJlNzE4OWFiNTJmYjkwNjQyOGVkZDM0MzI5ZmQzYjAzYTU5ZWVjZWFkYWQx
10
+ OTNlZGNhNWY1MDMwMmJhOWI5NGMzNDYyN2RlYTFlMmUzNzBhN2FiYjc2NDRm
11
+ MjBhOTViYmJlOTRhMDJkZGFlNDNiODQ5ZDgzZDM4MDBiZWVjZDQ=
12
12
  data.tar.gz: !binary |-
13
- MmFiYjM2MGQyMGU5OTkyNDRkMTYxYzM3OGI2MDY4ZTI2MTM3ZGU1NmFmOWM1
14
- NzU2YWM2MGRkNDM5ZWY2ZDc5ZmNmODVmNzRlZmE1YjIzNjQwNWQzMDBiOWZk
15
- N2U1NzkyOTc3OTI2NjVjNjk1OGU1ZGUyMjU4YzJjMzZhMzgyYjA=
13
+ ZTRiMWM4M2Q5YmVhYzIwNDNkMWUxNjVlYTYyMDA1NGYxYWViOTJmNzhmZTAw
14
+ NjJhNDQ3NTQxM2ZhMTM3MmRkNDE4YTViYzJkNTkyY2EwOWFhZjQzYThjNzZl
15
+ OTk4NjIyZjE2MjZkOTM0YjIxMGYyMmY3MjNiOTExMzcxMDJlMTk=
@@ -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: ruby
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