File tree Expand file tree Collapse file tree 4 files changed +14
-15
lines changed
Expand file tree Collapse file tree 4 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 2222require_relative '../payload_command'
2323require_relative '../format_option'
2424require_relative '../encoder_methods'
25- require_relative '../payload_type '
25+ require_relative '../text '
2626
2727require 'ronin/core/cli/options/param'
2828
@@ -61,7 +61,7 @@ class Build < PayloadCommand
6161 include FormatOption
6262 include EncoderMethods
6363 include Core ::CLI ::Options ::Param
64- include PayloadType
64+ include Text
6565
6666 option :output , short : '-o' ,
6767 value : {
Original file line number Diff line number Diff line change 2020#
2121
2222require_relative '../payload_command'
23- require_relative '../payload_type '
23+ require_relative '../text '
2424require_relative '../../metadata/arch'
2525require_relative '../../metadata/os'
2626
@@ -59,7 +59,7 @@ class Show < PayloadCommand
5959 include Core ::CLI ::Printing ::OS
6060 include Core ::CLI ::Printing ::Params
6161 include CommandKit ::Printing ::Fields
62- include PayloadType
62+ include Text
6363
6464 description 'Prints information about a payload'
6565
Original file line number Diff line number Diff line change @@ -23,13 +23,12 @@ module Ronin
2323 module Payloads
2424 class CLI
2525 #
26- # Handles converting a payload's {Payload.payload_type payload_type} into
27- # a printable display name.
26+ # Methods for generating display text.
2827 #
2928 # @since 0.3.0
3029 #
31- module PayloadType
32- # Known payload types and their printable names.
30+ module Text
31+ # Known payload types and their display names.
3332 PAYLOAD_TYPES = {
3433 payload : 'Custom' ,
3534
@@ -67,13 +66,13 @@ module PayloadType
6766 }
6867
6968 #
70- # Returns the printable payload type for the payload class.
69+ # Returns the payload type display name for the payload class.
7170 #
7271 # @param [Class<Payload>] payload_class
7372 # The payload class.
7473 #
7574 # @return [String]
76- # The printable payload type (ex: 'ASM' or 'shellcode').
75+ # The payload type display name (ex: 'ASM' or 'shellcode').
7776 #
7877 def payload_type ( payload_class )
7978 PAYLOAD_TYPES . fetch ( payload_class . payload_type , 'Unknown' )
Original file line number Diff line number Diff line change 11require 'spec_helper'
2- require 'ronin/payloads/cli/payload_type '
2+ require 'ronin/payloads/cli/text '
33require 'ronin/payloads/cli/command'
44
55require 'ronin/payloads/binary_payload'
2525require 'ronin/payloads/xml_payload'
2626require 'ronin/payloads/mixins/typescript'
2727
28- describe Ronin ::Payloads ::CLI ::PayloadType do
29- module TestCLIPrinting
28+ describe Ronin ::Payloads ::CLI ::Text do
29+ module TestCLIText
3030 class TestCommand < Ronin ::Payloads ::CLI ::Command
31- include Ronin ::Payloads ::CLI ::PayloadType
31+ include Ronin ::Payloads ::CLI ::Text
3232 end
3333 end
3434
35- let ( :command_class ) { TestCLIPrinting ::TestCommand }
35+ let ( :command_class ) { TestCLIText ::TestCommand }
3636 subject { command_class . new }
3737
3838 describe "#payload_type" do
You can’t perform that action at this time.
0 commit comments