Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Provides a helper for using Google Webfonts with the Ruby programming language.
Add this line to your application's Gemfile:
gem 'google-webfonts'
And then execute:
$ bundle
Or install it yourself as:
$ gem install google-webfonts
include Google::Webfonts::Helper
google_webfonts_link_tag font_name: [weights]
google_webfonts_link_tag droid_sans: [400, 700], yanone_kaffeesatz: [300, 400]
The weights are optional, and do not have to be in an Array if you are only including one. For example:
# Generate a tag for Droid+Sans without specifying the font weight.
google_webfonts_link_tag :droid_sans
# Generate a tag for Droid+Sans with 400 weight.
google_webfonts_link_tag :droid_sans => 400
# Generate a tag for Droid+Sans with 400 and 700 weights.
google_webfonts_link_tag :droid_sans => [400, 700]
In certain cases it will be necessary to use Strings instead of Symbols for the font names. The helper method titleizes the symbols when converting it to a Google Webfonts compatible name. This does not work for every font name. For example:
# If a Symbol was provided here, the "T" would be lower-case, which would
# result in an invalid link.
google_webfonts_link_tag 'PT Sans'
Require the gem like this in your Gemfile when using with Rails:
gem 'google-webfonts', require: 'google/webfonts/rails'
The google_webfonts_link_tag
helper method will automatically be available
to your views. If you need to use it outside of the views, include this module:
include Google::Webfonts::Helper
Here is a simple "Hello World" example for using Google::Webfonts in a Sinatra app:
# app.rb
require 'rubygems'
require 'sinatra'
# This must be required after requiring sinatra.
require 'google/webfonts/sinatra'
get '/' do
erb :index
end
# views/index.erb
<html>
<head>
<%= google_webfonts_link_tag "Droid Sans" %>
</head>
<body>
<p style="font-family: 'Droid+Sans', sans-serif;">
Hello World!
</p>
</body>
</html>
After checking out the repo, run bin/setup
to install dependencies. Then,
run rake test
to run the tests. You can also run bin/console
for an
interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/hi5dev/google-webfonts.
FAQs
Unknown package
We found that google-webfonts 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.