
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Webmate is a fully asynchronous real-time web application framework in Ruby. It is built using EventMachine and WebSockets. Webmate primarily designed for providing full-duplex bi-directional communication.
Webmate provides high-level api to create applications based on Websocket. Instead of separating code to http/websocket, you write one code, which may work using http or websocket (or both).
Sample:
Webmate::Application.define_routes do
resources :tasks, transport: [:http, :WS]
end
This simple route will allow you create, update, delete tasks using ONE websocket connection.
$ gem install webmate
$ webmate server
$ webmate console
$ rake routes
Gemfile
gem 'webmate'
gem 'slim'
gem 'sass'
gem 'rake'
gem 'webmate-sprockets'
gem 'webmate-client'
config.ru
require './config/environment'
if configatron.assets.compile
map '/assets' do
run Sinatra::Sprockets.environment
end
end
run Webmate::Application
config/config.rb
Webmate::Application.configure do |config|
# add directory to application load paths
#config.app.load_paths << ["app/uploaders"]
config.app.cache_classes = true
config.assets.compile = false
config.websockets.namespace = 'api'
config.websockets.enabled = true
config.websockets.port = 9020
end
Webmate::Application.configure(:development) do |config|
config.app.cache_classes = false
config.assets.compile = true
config.websockets.port = 3503
end
config/environment.rb
WEBMATE_ROOT = File.expand_path('.')
require 'webmate'
# app/routes/homepage_routes.rb
Webmate::Application.define_routes do
get '/', to: 'pages#index', transport: [:http]
end
# app/responders/base_reponder.rb
class BaseResponder < Webmate::Responders::Base
# Available options
# before_filter :do_something
rescue_from Webmate::Responders::ActionNotFound do
render_not_found
end
end
# app/responders/pages_reponder.rb
class PagesResponder < BaseResponder
include Webmate::Responders::Templates
def index
slim :index, layout: 'application'
end
end
# app/views/layouts/application.html.slim
div
== yield
# app/views/pages/index.html.slim
Hello World!
# config/mongoid.yml
development:
sessions:
default:
database: deex_example
hosts:
- localhost:27017
# config/initializers/mongoid.rb
Mongoid.load!(File.join(Webmate.root, 'config', 'mongoid.yml'))
# app/models/project.rb
class Project
include Mongoid::Document
field :name
field :description
field :status
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Licenced under MIT.
Hope, you'll enjoy Webmate!
Cheers, Droid Labs.
FAQs
Unknown package
We found that webmate 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.