Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Awesome chat on fire!
WiserChat only support Rails >= 3.2 with jQuery.
The following items are required:
User
model should be available and it should have a name
method that returns the user name for the chat.current_user
method should be available.Include the following lines in your Gemfile
:
gem 'redis', '3.2.0'
gem 'websocket-rails', '~> 0.7.0'
gem 'wiser_chat', '~> 0.1.4'
Then run:
bundle install
After installing the gems, you're now ready to install WiserChat by running this command:
bundle exec rails generate wiser_chat:install
The install command will generate the necessary files as well as the migration for the database. Now, run the migration to create the database table:
bundle exec rake db:migrate
Lastly, remove the Rack::Lock middleware by adding this line at the end of your development.rb
file:
config.middleware.delete Rack::Lock
WiserChat will use websocket and redis, you need to start the websocket server:
bundle exec rake websocket_rails:start_server
The websocket logs will be available at log/websocket_rails.log
and log/websocket_rails_server.log
.
You can always use this helper method in your view:
= wiser_chat(@channel_name)
You need to specify the @channel_name
to group the chat conversations. You can have different channels in different pages, but you cannot have multiple channels in a single page.
Channel name is very sensitive, use alpha-numeric characters only. In other words, do not use any special characters in your channel name.
Include the wiser_chat
stylesheet into your app/assets/stylesheets/application.css
:
*= require wiser_chat
By default, the chat box will be hidden and you need to toggle the #wiser-chat
element to display it. But you can create a link with toggle_chat
class to add a display control for the chat box.
= link_to "Chat", "#", class: "toggle_chat"
However, you can always customize it or event create your own appearance by editing the app/assets/stylesheets/wiser_chat.css
.
You need to run the websocket in your server and adding the codes below will make it easier for you to do it using the capistrano commands. Append this in your deploy.rb
file:
set :stage, lambda{ config_name.split(':').last }
namespace :websocket do
desc 'Stop websocket deamon'
task :stop do
on roles(:app), in: :sequence, wait: 5 do
within current_path do
websocket_pid = current_path.join('tmp/pids/websocket_rails.pid')
if test("[ -f #{websocket_pid} ]") then
with rails_env: fetch(:stage) do
rake 'websocket_rails:stop_server'
end
else
info "WebsocketRails is not running, not need to be stopped."
end
end
end
end
desc 'Start websocket deamon'
task :start do
on roles(:app), in: :sequence, wait: 5 do
within current_path do
with rails_env: fetch(:stage) do
info 'Start WebsocketRails server'
rake 'websocket_rails:start_server'
end
end
end
end
end
After that, these capistrano commands will do the work:
bundle exec cap production websocket:start
You can also kill the websocket using this capistrano command:
bundle exec cap production websocket:stop
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Open an issue in https://github.com/kennethjohnbalgos/wiser_chat if you need further support or want to report a bug.
The MIT License (MIT) Copyright (c) 2015 iKennOnline
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 wiser_chat 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.