From 708bd0ed878d4cac04f21c4fae5b3e01dba590c2 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sun, 4 Aug 2024 00:26:31 -0700 Subject: [PATCH] Switched to using `require_relative` for loading local files (closes #96). --- lib/ronin/web/cli.rb | 3 ++- lib/ronin/web/cli/browser_shell.rb | 3 ++- lib/ronin/web/cli/command.rb | 4 ++-- lib/ronin/web/cli/commands/browser.rb | 8 ++++---- lib/ronin/web/cli/commands/completion.rb | 3 ++- lib/ronin/web/cli/commands/diff.rb | 4 ++-- lib/ronin/web/cli/commands/html.rb | 4 ++-- lib/ronin/web/cli/commands/irb.rb | 4 ++-- lib/ronin/web/cli/commands/new.rb | 3 ++- lib/ronin/web/cli/commands/new/app.rb | 4 ++-- lib/ronin/web/cli/commands/new/nokogiri.rb | 4 ++-- lib/ronin/web/cli/commands/new/server.rb | 4 ++-- lib/ronin/web/cli/commands/new/spider.rb | 4 ++-- lib/ronin/web/cli/commands/reverse_proxy.rb | 3 ++- lib/ronin/web/cli/commands/screenshot.rb | 4 ++-- lib/ronin/web/cli/commands/server.rb | 3 ++- lib/ronin/web/cli/commands/session_cookie.rb | 3 ++- lib/ronin/web/cli/commands/spider.rb | 5 +++-- lib/ronin/web/cli/commands/user_agent.rb | 3 ++- lib/ronin/web/cli/commands/vulns.rb | 5 +++-- lib/ronin/web/cli/commands/wordlist.rb | 6 +++--- lib/ronin/web/cli/commands/xml.rb | 4 ++-- 22 files changed, 49 insertions(+), 39 deletions(-) diff --git a/lib/ronin/web/cli.rb b/lib/ronin/web/cli.rb index 9e6952f6..5776fc58 100644 --- a/lib/ronin/web/cli.rb +++ b/lib/ronin/web/cli.rb @@ -18,13 +18,14 @@ # along with ronin-web. If not, see . # -require 'ronin/web/version' require 'ronin/core/cli/help/banner' require 'command_kit/commands' require 'command_kit/commands/auto_load' require 'command_kit/options/version' +require_relative 'version' + module Ronin module Web # diff --git a/lib/ronin/web/cli/browser_shell.rb b/lib/ronin/web/cli/browser_shell.rb index 09d9efdf..5870051b 100644 --- a/lib/ronin/web/cli/browser_shell.rb +++ b/lib/ronin/web/cli/browser_shell.rb @@ -19,9 +19,10 @@ # require 'ronin/core/cli/command_shell' -require 'ronin/web/cli/js_shell' require 'ronin/web/browser' +require_relative 'js_shell' + module Ronin module Web class CLI diff --git a/lib/ronin/web/cli/command.rb b/lib/ronin/web/cli/command.rb index 2145009a..ffaa4a1d 100644 --- a/lib/ronin/web/cli/command.rb +++ b/lib/ronin/web/cli/command.rb @@ -18,10 +18,10 @@ # along with ronin-web. If not, see . # -require 'ronin/web/root' - require 'ronin/core/cli/command' +require_relative '../root' + module Ronin module Web class CLI diff --git a/lib/ronin/web/cli/commands/browser.rb b/lib/ronin/web/cli/commands/browser.rb index 1f52a86a..d38ca005 100644 --- a/lib/ronin/web/cli/commands/browser.rb +++ b/lib/ronin/web/cli/commands/browser.rb @@ -18,10 +18,10 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/browser_options' -require 'ronin/web/cli/browser_shell' -require 'ronin/web/cli/js_shell' +require_relative '../command' +require_relative '../browser_options' +require_relative '../browser_shell' +require_relative '../js_shell' require 'command_kit/colors' diff --git a/lib/ronin/web/cli/commands/completion.rb b/lib/ronin/web/cli/commands/completion.rb index 9d0e451a..a0259cd1 100644 --- a/lib/ronin/web/cli/commands/completion.rb +++ b/lib/ronin/web/cli/commands/completion.rb @@ -18,9 +18,10 @@ # along with ronin-web. If not, see . # -require 'ronin/web/root' require 'ronin/core/cli/completion_command' +require_relative '../../root' + module Ronin module Web class CLI diff --git a/lib/ronin/web/cli/commands/diff.rb b/lib/ronin/web/cli/commands/diff.rb index ab16c64e..696fff5c 100644 --- a/lib/ronin/web/cli/commands/diff.rb +++ b/lib/ronin/web/cli/commands/diff.rb @@ -18,9 +18,9 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/support/network/http' +require_relative '../command' +require 'ronin/support/network/http' require 'command_kit/colors' require 'nokogiri/diff' diff --git a/lib/ronin/web/cli/commands/html.rb b/lib/ronin/web/cli/commands/html.rb index 577e3c4e..1861e3f1 100644 --- a/lib/ronin/web/cli/commands/html.rb +++ b/lib/ronin/web/cli/commands/html.rb @@ -18,9 +18,9 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/commands/xml' -require 'ronin/support/network/http' +require_relative 'xml' +require 'ronin/support/network/http' require 'nokogiri' module Ronin diff --git a/lib/ronin/web/cli/commands/irb.rb b/lib/ronin/web/cli/commands/irb.rb index 4126a30b..30b7d4d2 100644 --- a/lib/ronin/web/cli/commands/irb.rb +++ b/lib/ronin/web/cli/commands/irb.rb @@ -18,8 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/ruby_shell' +require_relative '../command' +require_relative '../ruby_shell' module Ronin module Web diff --git a/lib/ronin/web/cli/commands/new.rb b/lib/ronin/web/cli/commands/new.rb index a16236f8..18c3677d 100644 --- a/lib/ronin/web/cli/commands/new.rb +++ b/lib/ronin/web/cli/commands/new.rb @@ -16,7 +16,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' +require_relative '../command' + require 'command_kit/commands/auto_load' module Ronin diff --git a/lib/ronin/web/cli/commands/new/app.rb b/lib/ronin/web/cli/commands/new/app.rb index 14d4c496..1431805d 100644 --- a/lib/ronin/web/cli/commands/new/app.rb +++ b/lib/ronin/web/cli/commands/new/app.rb @@ -16,8 +16,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/root' +require_relative '../../command' +require_relative '../../../root' require 'ronin/core/cli/generator' diff --git a/lib/ronin/web/cli/commands/new/nokogiri.rb b/lib/ronin/web/cli/commands/new/nokogiri.rb index 887cb0f7..909510b9 100644 --- a/lib/ronin/web/cli/commands/new/nokogiri.rb +++ b/lib/ronin/web/cli/commands/new/nokogiri.rb @@ -16,8 +16,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/root' +require_relative '../../command' +require_relative '../../../root' require 'ronin/core/cli/generator' diff --git a/lib/ronin/web/cli/commands/new/server.rb b/lib/ronin/web/cli/commands/new/server.rb index 1d129d34..71417702 100644 --- a/lib/ronin/web/cli/commands/new/server.rb +++ b/lib/ronin/web/cli/commands/new/server.rb @@ -16,8 +16,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/root' +require_relative '../../command' +require_relative '../../../root' require 'ronin/core/cli/generator' diff --git a/lib/ronin/web/cli/commands/new/spider.rb b/lib/ronin/web/cli/commands/new/spider.rb index 22003fbf..30f17cbb 100644 --- a/lib/ronin/web/cli/commands/new/spider.rb +++ b/lib/ronin/web/cli/commands/new/spider.rb @@ -16,8 +16,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/root' +require_relative '../../command' +require_relative '../../../root' require 'ronin/core/cli/generator' diff --git a/lib/ronin/web/cli/commands/reverse_proxy.rb b/lib/ronin/web/cli/commands/reverse_proxy.rb index f98d05f1..ffe305c6 100644 --- a/lib/ronin/web/cli/commands/reverse_proxy.rb +++ b/lib/ronin/web/cli/commands/reverse_proxy.rb @@ -18,7 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' +require_relative '../command' + require 'ronin/core/cli/logging' require 'ronin/web/server/reverse_proxy' diff --git a/lib/ronin/web/cli/commands/screenshot.rb b/lib/ronin/web/cli/commands/screenshot.rb index df00ce58..591e31f4 100644 --- a/lib/ronin/web/cli/commands/screenshot.rb +++ b/lib/ronin/web/cli/commands/screenshot.rb @@ -18,8 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/browser_options' +require_relative '../command' +require_relative '../browser_options' require 'ronin/core/cli/logging' diff --git a/lib/ronin/web/cli/commands/server.rb b/lib/ronin/web/cli/commands/server.rb index 392b2df8..4d451d6e 100644 --- a/lib/ronin/web/cli/commands/server.rb +++ b/lib/ronin/web/cli/commands/server.rb @@ -18,7 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' +require_relative '../command' + require 'ronin/core/cli/logging' require 'ronin/web/server' diff --git a/lib/ronin/web/cli/commands/session_cookie.rb b/lib/ronin/web/cli/commands/session_cookie.rb index 30397294..19c523be 100644 --- a/lib/ronin/web/cli/commands/session_cookie.rb +++ b/lib/ronin/web/cli/commands/session_cookie.rb @@ -18,7 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' +require_relative '../command' + require 'ronin/web/session_cookie' require 'ronin/support/network/http' require 'ronin/support/encoding/hex' diff --git a/lib/ronin/web/cli/commands/spider.rb b/lib/ronin/web/cli/commands/spider.rb index 5130395f..b19b9da4 100644 --- a/lib/ronin/web/cli/commands/spider.rb +++ b/lib/ronin/web/cli/commands/spider.rb @@ -18,8 +18,9 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/spider_options' +require_relative '../command' +require_relative '../spider_options' + require 'ronin/web/spider/archive' require 'ronin/web/spider/git_archive' require 'ronin/support/network/http/user_agents' diff --git a/lib/ronin/web/cli/commands/user_agent.rb b/lib/ronin/web/cli/commands/user_agent.rb index a85cdc24..bf0cd2a7 100644 --- a/lib/ronin/web/cli/commands/user_agent.rb +++ b/lib/ronin/web/cli/commands/user_agent.rb @@ -18,7 +18,8 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' +require_relative '../command' + require 'ronin/web/user_agents' module Ronin diff --git a/lib/ronin/web/cli/commands/vulns.rb b/lib/ronin/web/cli/commands/vulns.rb index 53520a53..8cd33f33 100644 --- a/lib/ronin/web/cli/commands/vulns.rb +++ b/lib/ronin/web/cli/commands/vulns.rb @@ -18,8 +18,9 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/spider_options' +require_relative '../command' +require_relative '../spider_options' + require 'ronin/core/cli/logging' require 'ronin/vulns/url_scanner' require 'ronin/vulns/cli/printing' diff --git a/lib/ronin/web/cli/commands/wordlist.rb b/lib/ronin/web/cli/commands/wordlist.rb index 44fa0446..5890d749 100644 --- a/lib/ronin/web/cli/commands/wordlist.rb +++ b/lib/ronin/web/cli/commands/wordlist.rb @@ -18,10 +18,10 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/web/cli/spider_options' -require 'ronin/core/cli/logging' +require_relative '../command' +require_relative '../spider_options' +require 'ronin/core/cli/logging' require 'wordlist/builder' require 'nokogiri' diff --git a/lib/ronin/web/cli/commands/xml.rb b/lib/ronin/web/cli/commands/xml.rb index af5da882..90a6cfe2 100644 --- a/lib/ronin/web/cli/commands/xml.rb +++ b/lib/ronin/web/cli/commands/xml.rb @@ -18,9 +18,9 @@ # along with ronin-web. If not, see . # -require 'ronin/web/cli/command' -require 'ronin/support/network/http' +require_relative '../command' +require 'ronin/support/network/http' require 'nokogiri' module Ronin