
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
The visitors gem gives you a simple tracking system for use in your Ruby-based web application. Anywhere in your app you can call…
Visitors.increment(1, :show)
…to increment a counter that corresponds to the resource with an identifier of 1.
First off install the gem
gem install visitors
Require the visitors gem in your Rails app via your Gemfile.
gem 'visitors', '~> 0.0.2'
Now add Visitors.increment(@resource.id, :show)
to a show action in
your application.
When RAILS_ROOT
is defined visitors will work based upon the
assumption your using it in combination with Rails. Make sure you have
Redis running and that you have a config.yml file in your Rails config
directory, similar to this:
development:
redis_namespace: visitors_development
redis_config:
host: localhost
production:
redis_namespace: visitors_production
redis_config:
host: redis-cluster.domain.com
Without RAILS_ROOT
visitors will use a local development connection.
Not enough to be really useful! Here's the code that decides where to
load the config from:
if defined?(RAILS_ROOT)
def yaml
@yaml ||= YAML.load_file("#{RAILS_ROOT}/config/visitors.yml")
end
else
def yaml
@yaml ||= YAML.load_file(File.expand_path('../../../config.yml', __FILE__))
end
end
The environment will be selected using the RAILS_ENV
, the
VISITORS_ENV
or default to development
.
This code is likely to change a lot and probably shouldn't be used in your beautiful production app because of this. It's something I put together quickly for use in work as writing all our activity to disk was crippling servers.
Feel free to fork and use the code but take heed, I make no committment to support, maintain or even acknowledge the existence of this small cluster fuck.
FAQs
Unknown package
We found that visitors 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 new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.