metasploit-concern 2.0.4 → 2.0.5

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: afa946a151fe77bfef1769ced349e00755df4128
4
- data.tar.gz: f901fb2bb36b655df6fc34061866ff3bb6ea6566
3
+ metadata.gz: 242cbd2227b9c0bdc0ed60fa1244754dc59bc908
4
+ data.tar.gz: 6896650c9b36ca6d5295df49d92cc5c4d7eae07c
5
5
  SHA512:
6
- metadata.gz: 98a4112031a622d22776d5031bf89d4026d9a9760e30cd451dc805481a811789dec45c89081255d3da2cc4944bdaf9d0aa4399ae7b5f66196428cd1e0e8ac382
7
- data.tar.gz: 15916be82e26ce10aa44c2e5df501a4e48f9895e80192578e0536f42149cc460747c949eafbbf961c2524c2ddede4e586aca4e0ccc3550dba7dd790e56d9884a
6
+ metadata.gz: c14151e64bedb53cae8b56ae5f11366e21d1cabb57e905b9b0c9f833dcb751ac68b663b1ba7c2e0853dafde4bc88870fa66c599498fac5e3ff514adf6476b745
7
+ data.tar.gz: efbf7361210cb0e4e146f09e7cb8981b390edf9be6e4211355d1b3c5d22c113499e05ecd9328a79ad4cdb5481b7b7b308057a15c5b6c143fd7627a722db62ec4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,17 +1,12 @@
1
1
  require 'rails'
2
- require File.expand_path("../support_engines", __FILE__)
3
2
 
4
3
  # Refinement that returns engines method to Rails::Engine::Railties
5
4
  # so that we can access the engines deprecated in Rails 4.1
6
5
 
7
-
8
-
9
6
  module Metasploit
10
7
  module Concern
11
8
  # Rails engine for Metasploit::Concern that sets up an initializer to load the concerns from app/concerns in other
12
9
  # Rails engines.
13
- using SupportEngines
14
- # to apply the refinement
15
10
  class Engine < ::Rails::Engine
16
11
  #
17
12
  # `config`
@@ -30,14 +25,13 @@ module Metasploit
30
25
 
31
26
  initializer 'metasploit_concern.load_concerns' do
32
27
  application = Rails.application
33
- engines = application.railties.engines
28
+ engines = application.railties._all.select{|rt| rt.is_a? Rails::Engine}
34
29
 
35
30
  # application is an engine
36
31
  engines = [application, *engines]
37
32
 
38
33
  engines.each do |engine|
39
34
  concerns_path = engine.paths['app/concerns']
40
-
41
35
  if concerns_path
42
36
  if concerns_path.eager_load?
43
37
  raise Metasploit::Concern::Error::EagerLoad, engine
@@ -3,13 +3,13 @@ class Metasploit::Concern::Error::EagerLoad < Metasploit::Concern::Error::Base
3
3
  # @param engine [Rails::Engine] `Rails::Engine` where `engine.paths['app/concerns'].eager_load?` is `true`.
4
4
  def initialize(engine)
5
5
  @engine = engine
6
-
6
+ engine_name = engine.class.name
7
7
  super(
8
- "#{engine}'s `app/concerns` is marked as `eager_load: true`. This will cause circular dependency " \
8
+ "#{engine_name}'s `app/concerns` is marked as `eager_load: true`. This will cause circular dependency " \
9
9
  "errors when the concerns are loaded. Declare `app/concerns` to stop it from inheriting `eager_load: true` " \
10
10
  "from `app`: \n" \
11
11
  "\n" \
12
- " class #{engine} < Rails::Engine\n" \
12
+ " class #{engine_name} < Rails::Engine\n" \
13
13
  " config.paths.add 'app/concerns', autoload: true\n" \
14
14
  " end\n"
15
15
  )
@@ -3,11 +3,11 @@ class Metasploit::Concern::Error::SkipAutoload < Metasploit::Concern::Error::Bas
3
3
  # @param engine [Rails::Engine] `Rails::Engine` where `engine.paths['app/concerns'].autoload?` is `false`.
4
4
  def initialize(engine)
5
5
  @engine = engine
6
-
6
+ engine_name = engine.class.name
7
7
  super(
8
- "#{engine}'s `app/concerns` is marked as `autoload: false`. Declare `app/concerns` as autoloading:\n" \
8
+ "#{engine_name}'s `app/concerns` is marked as `autoload: false`. Declare `app/concerns` as autoloading:\n" \
9
9
  "\n" \
10
- " class #{engine} < Rails::Engine\n" \
10
+ " class #{engine_name} < Rails::Engine\n" \
11
11
  " config.paths.add 'app/concerns', autoload: true\n" \
12
12
  " end\n"
13
13
  )
@@ -1,7 +1,7 @@
1
1
  module Metasploit
2
2
  module Concern
3
3
  # VERSION is managed by GemRelease
4
- VERSION = '2.0.4'
4
+ VERSION = '2.0.5'
5
5
 
6
6
  # @return [String]
7
7
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-concern
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Imhoff
@@ -88,7 +88,7 @@ cert_chain:
88
88
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
89
89
  8mVuTXnyJOKRJA==
90
90
  -----END CERTIFICATE-----
91
- date: 2017-05-11 00:00:00.000000000 Z
91
+ date: 2017-06-28 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: metasploit-yard
@@ -180,7 +180,6 @@ files:
180
180
  - lib/metasploit/concern/error/base.rb
181
181
  - lib/metasploit/concern/error/eager_load.rb
182
182
  - lib/metasploit/concern/error/skip_autoload.rb
183
- - lib/metasploit/concern/support_engines.rb
184
183
  - lib/metasploit/concern/version.rb
185
184
  - spec/support/shared/examples/metasploit/concern/run.rb
186
185
  homepage: https://github.com/rapid7/metasploit-concern
metadata.gz.sig CHANGED
Binary file
@@ -1,11 +0,0 @@
1
- # Ruby refinement.
2
- module SupportEngines
3
-
4
- refine Rails::Engine::Railties do
5
- # Reimplementing ‘Rails::Application::Railties#Engines since it has been removed.
6
- def engines
7
- # method that returns all current engines
8
- @engines ||= ::Rails::Engine.subclasses.map(&:instance)
9
- end
10
- end
11
- end