File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
lib/metasploit/framework/command Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,11 @@ def self.require_environment!
49
49
parsed_options . environment!
50
50
ARGV . replace ( parsed_options . positional )
51
51
52
- # @see https://github.com/rails/rails/blob/v3.2.17/railties/lib/rails/commands.rb#L39-L40
53
- require Pathname . new ( __FILE__ ) . parent . parent . parent . parent . parent . join ( 'config' , 'application' )
52
+ # allow other Rails::Applications to use this command
53
+ if !defined? ( Rails ) || Rails . application . nil?
54
+ # @see https://github.com/rails/rails/blob/v3.2.17/railties/lib/rails/commands.rb#L39-L40
55
+ require Pathname . new ( __FILE__ ) . parent . parent . parent . parent . parent . join ( 'config' , 'application' )
56
+ end
54
57
55
58
# have to configure before requiring environment because
56
59
# config/environment.rb calls initialize! and the initializers will use
You can’t perform that action at this time.
0 commit comments