
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Socky is push server for Ruby based on WebSockets. It allows you to break border between your application and client browser by letting the server initialize a connection and push data to the client.
You can try live example or view its source code
Also important information can be found on our google group.
The best way to install Socky Ruby on Rails bindings is via RubyGems:
gem install socky-client-rails
Socky Ruby on Rails bindings require the socky-client gem. It is automatically installed by the gem install command.
You can also build it after clonning(this will require Jeweler gem)
git clone git://github.com/socky/socky-client-rails.git
rake gemspec
rake build
Configuration file is located in application config directory:
config/socky_hosts.yml
If it isn't exists then you will need to generate it. In Rails 3 you can use rake task:
rake socky:install
which also install Socky JS files.
If you are using Rails 2 then you will need to generate rake tasks first(this will be required only once):
script/generate socky
More about configuraton can be found in socky-client-ruby.
Socky Ruby on Rails bindings provide socky
helper for views and :socky javascript expansion.
At first you will need set of javascripts providing bridge between browser and WebSocket connection.
<%= javascript_include_tag :socky %>
This will also load javascripts that will use flash to simulate WebSocket if browser don't support it.
After that you can use @socky@ helper to create connection with Socky server.
<%= socky %>
Helper is accepting following options in hash form:
Option | Value format | Description |
---|---|---|
:host | [string] | IP or hostname of Socky server - at default random server from socky_hosts.yml is taken |
:port | [integer] | Port on with Socky server listens - at default random server from socky_hosts.yml is taken |
:user_id | [string/integer] | Hash by with user will be identified |
:user_secret | [string] | Hash by with user will be authenticated |
:channels | [array] | List of channels to with user will be connected |
Socky Ruby on Rails bindings offers all functionality of socky-client-ruby and additional method to send data via Socky.send
command. You can use block of code and passed object will be standard Rails JavaScript generator.
Socky.send do |page|
page.alert('ok!')
end
Note that you can as usually use old methods and connect them with new method:
Socky.send :users => ["user1", "user2"] do |page|
page.alert('ok!')
end
Also note that if you use block version any data passed as body will be overwritten.
(The MIT License)
Copyright (c) 2010 Bernard Potocki
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that socky-client-rails 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.