
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Use the barchart
method to print barcharts.
Let's use the
"Q: Where do Rubyists come from / What are the top countries for blogs?"
example from the Planet Ruby page:
require 'barchart'
data = [
['Australia', 3],
['Austria', 1],
['Canada', 1],
['Croatia', 1],
['India', 1],
['Poland', 2],
['Spain', 1],
['Switzerland', 1],
['Ukraine', 1],
['United States', 6],
]
# -or-
data = {
'Australia': 3,
'Austria': 1,
'Canada': 1,
'Croatia': 1,
'India': 1,
'Poland': 2,
'Spain': 1,
'Switzerland': 1,
'Ukraine': 1,
'United States': 6,
}
puts barchart( data, title: 'Location', chars: '*' )
Resulting in:
Location (n=18)
---------------------------------
Australia (16%) | ******** 3
Austria ( 5%) | ** 1
Canada ( 5%) | ** 1
Croatia ( 5%) | ** 1
India ( 5%) | ** 1
Poland (11%) | ***** 2
Spain ( 5%) | ** 1
Switzerland ( 5%) | ** 1
Ukraine ( 5%) | ** 1
United States (33%) | **************** 6
or using Unicode block elements:
puts barchart( data, title: 'Location', chars: '▏▎▍▋▊▉' )
Resulting in:
Location (n=18)
---------------------------------
Australia (16%) | ▉▉▉▉▉▉▉▉▍ 3
Austria ( 5%) | ▉▉▊ 1
Canada ( 5%) | ▉▉▊ 1
Croatia ( 5%) | ▉▉▊ 1
India ( 5%) | ▉▉▊ 1
Poland (11%) | ▉▉▉▉▉▋ 2
Spain ( 5%) | ▉▉▊ 1
Switzerland ( 5%) | ▉▉▊ 1
Ukraine ( 5%) | ▉▉▊ 1
United States (33%) | ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▊ 6
Aside: What are Unicode block elements?
Unicode among other block elements defines:
▏
- U+258F - Left one eighth block▎
- U+258E - Left one quarter block▍
- U+258D - Left three eighths block▋
- U+258B - Left five eighths block▊
- U+258A - Left three quarters block▉
- U+2589 - Left seven eighths blockSee Block Elements @ Wikipedia for more.
sort: true|false
, n: <sample size>
Pass in sort: true
to reverse sort the dataset (highest values first).
Let's use the
"Q: What (web site) publishing tools are in use?" example:
data = [
['Webgen', 1],
['Jekyll', 12],
['WordPress', 3],
['Hugo', 1],
['Ghost', 2],
['Transistor', 1],
['Simplecast', 1],
['?', 30],
]
puts barchart( data, title: 'Generators', sort: true )
Resulting in:
Generators (n=51)
---------------------------------
? (58%) | ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▍ 30
Jekyll (23%) | ▉▉▉▉▉▉▉▉▉▉▉▊ 12
WordPress ( 5%) | ▉▉▉ 3
Ghost ( 3%) | ▉▉ 2
Hugo ( 1%) | ▉ 1
Transistor ( 1%) | ▉ 1
Simplecast ( 1%) | ▉ 1
Webgen ( 1%) | ▉ 1
Pass in n: <sample size>
to use a "custom" sample size
AND to turn off the auto-calculation of the
usage percentage.
Let's use the
"Q: What are the top topics / words in headlines?" example:
data = [
['rails', 13],
['ruby', 12],
['conferences', 6],
['dry', 5],
['rom', 4],
['ml', 2],
]
puts barchart( data, title: 'Top Words in Headlines 2020', n: 47)
resulting in:
Top Words in Headlines 2020 (n=47)
---------------------------------
rails | ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▍ 13
ruby | ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▎ 12
conferences | ▉▉▉▉▉▉▉▏ 6
dry | ▉▉▉▉▉▉ 5
rom | ▉▉▉▉▊ 4
ml | ▉▉▍ 2
That's all for now.
The barcharts
scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
Send them along to the wwwmake Forum/Mailing List. Thanks!
FAQs
Unknown package
We found that barcharts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.