Skip to content

Commit

Permalink
Switched to using require_relative for loading local files (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Aug 4, 2024
1 parent 0c41547 commit 89dc503
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 49 deletions.
16 changes: 8 additions & 8 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
require 'sinatra/reloader'

# configuration
require './config/database'
require './config/sidekiq'
require_relative 'config/database'
require_relative 'config/sidekiq'

# ronin libraries
require 'ronin/repos'
Expand All @@ -49,12 +49,12 @@
require 'ronin/app/helpers/html'

# worker classes
require './workers/install_repo'
require './workers/update_repo'
require './workers/update_repos'
require './workers/remove_repo'
require './workers/purge_repos'
require './workers/import'
require_relative 'workers/install_repo'
require_relative 'workers/update_repo'
require_relative 'workers/update_repos'
require_relative 'workers/remove_repo'
require_relative 'workers/purge_repos'
require_relative 'workers/import'

require 'ronin/app/version'
require 'sidekiq/api'
Expand Down
10 changes: 5 additions & 5 deletions app/scanning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
require 'ronin/app/helpers/html'

# worker classes
require './workers/nmap'
require './workers/masscan'
require './workers/spider'
require './workers/recon'
require './workers/vulns'
require_relative '../workers/nmap'
require_relative '../workers/masscan'
require_relative '../workers/spider'
require_relative '../workers/recon'
require_relative '../workers/vulns'

#
# App class containing routes for scanning.
Expand Down
2 changes: 1 addition & 1 deletion config/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'sidekiq'
require 'redis/namespace'

require_relative '../lib/middleware/sidekiq/active_record_connection_pool'
require 'middleware/sidekiq/active_record_connection_pool'

redis_config = {
url: "redis://#{ENV['REDIS_HOST']}:#{ENV['REDIS_PORT']}"
Expand Down
5 changes: 3 additions & 2 deletions lib/ronin/app/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
require 'ronin/core/cli/command'
require 'ronin/core/cli/logging'
require 'ronin/db/config_file'
require 'ronin/app/root'
require 'ronin/app/version'

require 'command_kit/options/version'
require 'command_kit/open_app'

require_relative 'root'
require_relative 'version'

module Ronin
module App
#
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/app/schemas/params_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry-schema'
require 'ronin/app/types'
require_relative '../types'

require 'dry-schema'
require 'ronin/core/params/types'

module Ronin
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/app/schemas/payloads/build_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry/schema'
require_relative '../params_schema'

require 'ronin/app/schemas/params_schema'
require 'dry/schema'

module Ronin
module App
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/app/schemas/payloads/encoders/encode_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry/schema'
require_relative '../../params_schema'

require 'ronin/app/schemas/params_schema'
require 'dry/schema'

module Ronin
module App
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/app/types/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/app/types'
require_relative '../types'

module Ronin
module App
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/app/types/nmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/app/types'
require_relative '../types'

require 'nmap/command'

Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/app/types/spider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/app/types'
require_relative '../types'

module Ronin
module App
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/app/types/vulns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/app/types'
require_relative '../types'

module Ronin
module App
Expand Down
2 changes: 1 addition & 1 deletion lib/ronin/app/validations/import_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/app/types/import'
require_relative '../types/import'

require 'dry/validation'
require 'set'
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/app/validations/masscan_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry/validation'
require 'ronin/app/types'
require_relative '../types'

require 'dry/validation'
require 'masscan/command'

module Ronin
Expand Down
6 changes: 3 additions & 3 deletions lib/ronin/app/validations/nmap_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry/validation'
require 'ronin/app/types'
require 'ronin/app/types/nmap'
require_relative '../types'
require_relative '../types/nmap'

require 'dry/validation'
require 'nmap/command'

module Ronin
Expand Down
4 changes: 2 additions & 2 deletions lib/ronin/app/validations/recon_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require 'dry/validation'
require 'ronin/app/types'
require_relative '../types'

require 'dry/validation'
require 'ronin/recon/value/parser'

module Ronin
Expand Down
3 changes: 2 additions & 1 deletion lib/ronin/app/validations/spider_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require_relative '../types/spider'

require 'dry/validation'
require 'ronin/app/types/spider'

module Ronin
module App
Expand Down
3 changes: 2 additions & 1 deletion lib/ronin/app/validations/vulns_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# along with ronin-app. If not, see <http://www.gnu.org/licenses/>.
#

require_relative '../types/vulns'

require 'dry/validation'
require 'ronin/app/types/vulns'

module Ronin
module App
Expand Down
26 changes: 13 additions & 13 deletions workers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

$LOAD_PATH.unshift(File.join(__dir__,'lib'))

require './config/sidekiq'
require './config/database'
require_relative 'config/sidekiq'
require_relative 'config/database'

require './workers/install_repo'
require './workers/update_repo'
require './workers/update_repos'
require './workers/remove_repo'
require './workers/purge_repos'
require_relative 'workers/install_repo'
require_relative 'workers/update_repo'
require_relative 'workers/update_repos'
require_relative 'workers/remove_repo'
require_relative 'workers/purge_repos'

require './workers/nmap'
require './workers/masscan'
require './workers/import'
require './workers/spider'
require './workers/recon'
require './workers/vulns'
require_relative 'workers/nmap'
require_relative 'workers/masscan'
require_relative 'workers/import'
require_relative 'workers/spider'
require_relative 'workers/recon'
require_relative 'workers/vulns'

0 comments on commit 89dc503

Please sign in to comment.