
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Fewer is a Rack endpoint to bundle and cache assets and help you make fewer HTTP requests. Fewer extracts and combines a list of assets encoded in the URL and serves the response with far-future HTTP caching headers.
Using Fewer in your Rails app is easy, just initialize your Fewer apps and add them to your routes then include the helper methods in your ApplicationHelper
with a one-liner.
# Gemfile
gem 'fewer'
gem 'closure-compiler', :group => :production
# config/initializers/fewer.rb
Fewer::App.new(:javascripts,
:engine => Fewer::Engines::Js,
:engine_options => { :min => Rails.env.production? }
:root => Rails.root.join('app', 'javascripts')
)
Fewer::App.new(:stylesheets,
:engine => Fewer::Engines::Css,
:root => Rails.root.join('app', 'stylesheets')
)
# config/routes.rb
match '/javascripts/*data.js', :to => Fewer::App[:javascripts]
match '/stylesheets/*data.css', :to => Fewer::App[:stylesheets]
# app/helpers/application_helper.rb
module ApplicationHelper
include Fewer::RailsHelpers
end
# app/views/layouts/application.html.erb
<%= fewer_javascripts_tag 'long', 'list', 'of/nested', 'js/files' %>
<%= fewer_stylesheets_tag 'some', 'css', 'files' %>
app = Rack::Builder.new do
map '/stylesheets' do
run Fewer::App,
:root => File.dirname(__FILE__)+'/less_css',
:engine => Fewer::Engines::Less
end
map '/' do
run MyApp
end
end
run app
Copyright (c) 2010 Ben Pickles. See LICENSE for details.
FAQs
Unknown package
We found that fewer 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.