Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Anyicon provides Ruby on Rails view helpers for rendering icons from various collections hosted on GitHub.
Anyicon simplifies the process of integrating and using SVG icons from various collections in your Rails application. Here's a breakdown of how it works:
Configuration: You can set up the icon collections you want to use in a Rails initializer (config/initializers/anyicon.rb
) or you can use the already defined collections. Each collection is defined by specifying the GitHub repository, the path within the repository where the icons are located, and the branch to use.
Icon Rendering: When you call the anyicon
helper in your views, it uses the Anyicon::Icon
class to render the SVG content. The helper takes the icon name in the format collection:icon_name
and optionally additional HTML properties.
Fetching Icons: If the requested icon is not already cached locally, the gem will fetch the SVG file from the specified GitHub repository. It uses the configuration settings to construct the URL, download the file, and store it in your application's app/assets/images/icons
directory. Attention to the license agreement of each collection
Caching: Once downloaded, icons are cached locally to avoid repeated network requests. This ensures that your application remains performant and reduces dependency on external network availability.
Helper Methods: The anyicon
helper method simplifies the process of including icons in your views by managing the rendering and fetching process transparently. You can also pass additional HTML attributes to customize the rendered SVG element.
Add this line to your application's Gemfile:
gem 'anyicon'
And then execute:
bundle install
Or install it yourself as:
gem install anyicon
You can just use the anyicon helper in your views:
<%= anyicon icon: 'fontawesome_regular:address-book' %>
You can configure the icon collections in an initializer:
# config/initializers/anyicon.rb
Anyicon.configure do |config|
config.collections = {
my_custom_collection: { repo: 'user/repo', path: 'path/to/icons', branch: 'main' }
}
end
Collection | Github List | Example | Quantity | License |
---|---|---|---|---|
Font-Awesome | fontawesome_regular | fontawesome_regular:address-book | 136 | License |
fontawesome_solid | fontawesome_solid:award | 1,392 | ||
fontawesome_brands | fontawesome_brands:readme | 490 | ||
Heroicons | heroicons_outline | heroicons_outline:check | 296 | MIT |
heroicons_solid | heroicons_solid:cube | 296 | ||
Tabler Icons | tabler_icons_filled | tabler_icons_filled:alarm | 675 | MIT |
tabler_icons_outline | tabler_icons_outline:article | 4,615 | ||
Mage Icons | mage_icons_fill | mage_icons_fill:Book | 449 | Apache 2.0 |
mage_icons_stroke | mage_icons_stroke:Archive | 545 | ||
mage_icons_social_bw | mage_icons_social_bw:Github | 50 | ||
mage_icons_social_color | mage_icons_social_color:Youtube | 50 | ||
Line Awesome | line_awesome | line_awesome:film | 1,554 | MIT/Good Boy License |
@carbon/icons | carbon | carbon:arrow--left | 2,212 | Apache 2.0 |
IonIcons | ionicons | ionicons:add-sharp | 1,356 | MIT |
Feather Icons | feather_icons | feather_icons:airplay | 287 | MIT |
Please, read the license before using any of these collections. This gem does not maintain or keep any of those files in it's repository. However, when you use any of the icons they will be automatically saved in /app/assets/images/icons/
folder.
Fell free to add your own collection to this list.
To get started with development:
git clone https://github.com/arthurmolina/anyicon.git
cd heroicon
bundle install
bundle exec rake test
Anyone is encouraged to help improve this project. Here are a few ways you can help:
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that anyicon demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.