added a check for the version added
This commit is contained in:
6
beef
6
beef
@@ -167,12 +167,16 @@ end
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database:db_file)
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
# Migrate (if required)
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
if context.needs_migration?
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate
|
||||
end
|
||||
|
||||
#
|
||||
# @note Extensions may take a moment to load, thus we print out a please wait message
|
||||
#
|
||||
|
||||
@@ -43,7 +43,11 @@ RSpec.describe 'BeEF API Rate Limit' do
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database: db_file)
|
||||
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
if context.needs_migration?
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate
|
||||
|
||||
@@ -48,7 +48,11 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter: 'sqlite3', database: db_file)
|
||||
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
|
||||
|
||||
@@ -34,7 +34,12 @@ RSpec.describe 'BeEF Extension Requester' do
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database:'beef.db')
|
||||
# Migrate (if required)
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
# Migrate (if required)
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter: 'sqlite3', database: db_file)
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
sleep 2
|
||||
|
||||
@@ -47,7 +47,11 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter: 'sqlite3', database: db_file)
|
||||
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ CONFIG['key'] = ENV['BROWSERSTACK_ACCESS_KEY'] || ''
|
||||
ActiveRecord::Base.logger = nil
|
||||
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
|
||||
OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database:':memory:')
|
||||
# otr-activerecord require you to manually establish the connection with the following line
|
||||
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
|
||||
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('2.0')
|
||||
OTR::ActiveRecord.establish_connection!
|
||||
end
|
||||
ActiveRecord::Schema.verbose = false
|
||||
context = ActiveRecord::Migration.new.migration_context
|
||||
if context.needs_migration?
|
||||
|
||||
Reference in New Issue
Block a user