
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Verbal is a Ruby library that helps to construct difficult regular expressions. It's ported from the awesome JavaScript VerbalExpressions. Detailed documentation is available at rubydoc.
$> gem install verbal
require 'verbal'
Here's a couple of simple examples to give an idea of how Verbal works:
# Create an example of how to test for correctly formed URLs
tester = Verbal.new do
start_of_line
find 'http'
maybe 's'
find '://'
maybe 'www.'
anything_but ' '
end_of_line
end
# Create an example URL
test_url = "https://www.google.com"
# Use it just like a regular Ruby regex:
puts 'Hooray! It works!' if tester.match(test_url)
puts 'This works too!' if tester =~ test_url
# Print the generated regex:
puts tester.source # => /^(?:http)(s)?(?::\/\/)(www\.)?([^\ ]*)$/i
# Create a test string
replace_me = "Replace bird with a duck"
# Create an expression that seeks for word "bird"
expression = Verbal.new { find 'bird' }
# Execute the expression like a normal Regexp object
result = replace_me.gsub( expression, "duck" );
puts result # Outputs "Replace duck with a duck"
# create expression
verbal = Verbal.new do
capture { anything }
find /\sby\s/
capture { anything }
end
# match against test string
data = verbal.match('this is it by michael jackson')
puts data[1] # >> 'this is it'
puts data[2] # >> 'michael jackson'
Thank you to @jehna for coming up with the awesome original idea.
Thank you to @ryan-endacott for the original port.
FAQs
Unknown package
We found that verbal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.