
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
There are a few good geometry gems already available for Ruby (ruby-geometry and geometry), but I need one which is focused on the needs of creating 2D graphical user interfaces.
Add this line to your application's Gemfile:
gem 'gui_geometry'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gui_geometry
Points are represented by X and Y coordinates:
Rectangles consist of two point objects. One specifies the location of the rectangle - it's top-left corner. The other specifies its size in terms of width then height.
require "gui_geometry"
include GuiGeo
# create point x == y == 0
point
# => point(0,0)
# create a point x=3, y=4
my_point = point(3,4)
# => point(3,4)
[my_point.x, my_point.y]
# => [3, 4]
# create a rectangle - x, y, w, h form
rect(4,5,100,80)
# => rect(4,5,100,80)
# create rectangle - location, size form
my_rect = rect point(4,5), point(100,80)
# => rect(4,5,100,80)
# create rectangle - size form (location defaults to 0,0
rect point(30,50)
# => rect(0,0,30,50)
# get loc and size:
[my_rect.loc, my_rect.size]
# => [point(4,5), point(100,80)]
# get x, y, width and height
[my_rect.x, my_rect.y, my_rect.w, my_rect.h]
# => [4, 5, 100, 80]
# get the 4 corners:
[my_rect.tl, my_rect.tr, my_rect.bl, my_rect.br]
# => [point(4,5), point(104,5), point(4,85), point(104,85)]
To get access to min, max, bound, and minmax:
include GuiGeo::Tools
min(4,5)
# => 4
max(4,5)
# => 5
minmax(4,5)
# => [4,5]
bound(5,4,10)
# => 5
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that gui_geometry 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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.