Class: String
- Defined in:
- lib/ext/shell_escape.rb,
lib/inactive_support.rb,
lib/inactive_support/core_ext/blank.rb
Overview
:nodoc:
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#shell_escape ⇒ Object
Transforms this string into an escaped POSIX shell argument.
Methods included from InactiveSupport::CoreExtensions::String::Inflections
#camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, #pluralize, #singularize, #tableize, #titleize, #underscore
Instance Method Details
#blank? ⇒ Boolean
41 42 43 |
# File 'lib/inactive_support/core_ext/blank.rb', line 41 def blank? self !~ /\S/ end |
#shell_escape ⇒ Object
Transforms this string into an escaped POSIX shell argument.
4 5 6 |
# File 'lib/ext/shell_escape.rb', line 4 def shell_escape inspect.gsub(/\\(\d{3})/) {$1.to_i(8).chr} end |