Module: Ronin::Support

Includes:
Network::DNS, Network::ESMTP, Network::FTP, Network::HTTP, Network::IMAP, Network::POP3, Network::SMTP, Network::SSL, Network::TCP, Network::Telnet, Network::UDP, Network::UNIX, UI::Output::Helpers
Defined in:
lib/ronin/support/support.rb,
lib/ronin/support/version.rb,
lib/ronin/support/inflector.rb

Overview

The main namespace for ronin-support.

Constant Summary

VERSION =

ronin-support version

'0.5.2'
INFLECTORS =

The Inflectors supported by ronin-support

{
  :data_mapper => {
    :path => 'dm-core',
    :const => 'DataMapper::Inflector'
  },
  :active_support => {
    :path => 'active_support/inflector',
    :const => 'ActiveSupport::Inflector'
  }
}

Constants included from Network::FTP

Network::FTP::DEFAULT_PORT, Network::FTP::DEFAULT_USER

Constants included from Network::Telnet

Network::Telnet::DEFAULT_PORT, Network::Telnet::DEFAULT_PROMPT, Network::Telnet::DEFAULT_TIMEOUT

Constants included from Network::IMAP

Network::IMAP::DEFAULT_PORT

Constants included from Network::POP3

Network::POP3::DEFAULT_PORT

Constants included from Network::SMTP

Network::SMTP::DEFAULT_PORT

Constants included from Network::SSL

Network::SSL::VERIFY

Class Method Summary (collapse)

Methods included from Network::HTTP

expand_options, expand_url, header_name, headers, #http_connect, #http_copy, #http_delete, #http_get, #http_get_body, #http_get_headers, #http_head, #http_lock, #http_mkcol, #http_move, #http_ok?, #http_options, #http_post, #http_post_body, #http_post_headers, #http_powered_by, #http_prop_find, #http_prop_patch, #http_put, #http_request, #http_server, #http_session, #http_status, #http_trace, #http_unlock, proxy, proxy=, request, user_agent, user_agent=

Methods included from Network::FTP

default_port, default_port=, #ftp_connect, #ftp_session

Methods included from Network::Telnet

default_port, default_port=, default_prompt, default_prompt=, default_timeout, default_timeout=, proxy, proxy=, #telnet_connect, #telnet_session

Methods included from Network::IMAP

default_port, default_port=, #imap_connect, #imap_session

Methods included from Network::POP3

default_port, default_port=, #pop3_connect, #pop3_session

Methods included from Network::ESMTP

#esmtp_connect, #esmtp_message, #esmtp_session

Methods included from Network::SMTP

default_port, default_port=, message, #smtp_connect, #smtp_message, #smtp_send_message, #smtp_session

Methods included from Network::UNIX

#unix_accept, #unix_connect, #unix_connect_and_send, #unix_open?, #unix_send, #unix_server, #unix_server_loop, #unix_server_session, #unix_session

Methods included from Network::SSL

#ssl_connect, #ssl_session

Methods included from Network::TCP

#tcp_accept, #tcp_banner, #tcp_connect, #tcp_connect_and_send, #tcp_open?, #tcp_send, #tcp_server, #tcp_server_loop, #tcp_server_session, #tcp_session, #tcp_single_server

Methods included from Network::UDP

#udp_banner, #udp_connect, #udp_connect_and_send, #udp_open?, #udp_recv, #udp_send, #udp_server, #udp_server_loop, #udp_server_session, #udp_session, #udp_single_server

Methods included from Network::DNS

#dns_lookup, #dns_lookup_all, #dns_resolver, #dns_reverse_lookup, #dns_reverse_lookup_all, nameserver, nameserver=

Methods included from UI::Output::Helpers

format, #print_debug, #print_error, #print_exception, #print_info, #print_warning, #printf, #putc, #puts, #write

Class Method Details

+ (true) load_inflector!(name)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Loads an Inflector library and sets the Ronin::Support::Inflector constant.

Parameters:

  • name (Symbol, String)

    The name of the Inflector library to load. May be either :datamapper or :active_support.

Returns:

  • (true)

    Specifies that the Inflector library was successfully loaded.

Raises:

  • (ArgumentError)

    The Inflector library is not supported.

  • (LoadError)

    The Inflector library could not be loaded.

  • (NameError)

    The constant could not be found.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/ronin/support/inflector.rb', line 56

def Support.load_inflector!(name)
  name = name.to_sym

  unless (inflector = INFLECTORS[name])
    raise(ArgumentError,"unsupported Inflector: #{name}")
  end

  begin
    require inflector[:path]
  rescue Gem::LoadError => e
    raise(e)
  rescue ::LoadError
    raise(LoadError,"unable to load #{inflector[:path]}")
  end

  begin
    const_set('Inflector', eval("::#{inflector[:const]}"))
  rescue NameError
    raise(NameError,"unable to find #{inflector[:const]}")
  end

  return true
end