README.md in litecable-0.6.0 vs README.md in litecable-0.7.0

- old
+ new

@@ -1,6 +1,7 @@ -[![Gem Version](https://badge.fury.io/rb/litecable.svg)](https://rubygems.org/gems/litecable) [![Build Status](https://travis-ci.org/palkan/litecable.svg?branch=master)](https://travis-ci.org/palkan/litecable) +[![Gem Version](https://badge.fury.io/rb/litecable.svg)](https://rubygems.org/gems/litecable) +[![Build](https://github.com/palkan/litecable/workflows/Build/badge.svg)](https://github.com/palkan/litecable/actions) # Lite Cable Lightweight ActionCable implementation. @@ -23,21 +24,15 @@ ```ruby gem "litecable" ``` -And then execute: +And run `bundle install`. - $ bundle - -Or install it yourself as: - - $ gem install litecable - ## Usage -Please, checkout [Action Cable guides](http://guides.rubyonrails.org/action_cable_overview.html) for general information. Lite Cable aims to be compatible with Action Cable as much as possible without the loss of simplicity and _ligthness_. +Please, checkout [Action Cable guides](http://guides.rubyonrails.org/action_cable_overview.html) for general information. Lite Cable aims to be compatible with Action Cable as much as possible without the loss of simplicity and _lightness_. You can use Action Cable javascript client without any change (precompiled version can be found [here](https://github.com/palkan/litecable/tree/master/examples/sinatra/assets/cable.js)). Here are the differences: @@ -81,28 +76,36 @@ end ``` ### Using with AnyCable -Lite Cable is AnyCable-compatible out-of-the-box. You should write a simple server script: +Lite Cable is AnyCable-compatible out-of-the-box: +- Set broadcast adapter to AnyCable: + ```ruby -#!/usr/bin/env ruby +LiteCable.broadcast_adapter = :any_cable +``` -require "my_app" -require "rack" -require "anycable" +You can also do this via configuration, e.g., env var (`LITECABLE_BROADCAST_ADAPTER=any_cable`) or `broadcast_adapter: any_cable` in a YAML config. -# Turn AnyCable compatibility mode -LiteCable.anycable! +- Configure connection factory: -Anycable.connection_factory = MyApp::Connection +```ruby +AnyCable.connection_factory = MyApp::Connection +``` -Anycable::Server.start +Then run AnyCable along with the app: + +```sh +bundle exec anycable + +# add -r option to load the app if it's not ./config/anycable.rb or ./config/environment.rb +bundle exec anycable -r ./my_app.rb ``` -And then run this script along with your application. See [Sinatra example](https://github.com/palkan/litecable/tree/master/examples/sinatra) for more. +See [Sinatra example](https://github.com/palkan/litecable/tree/master/examples/sinatra) for more. ### Configuration Lite Cable uses [anyway_config](https://github.com/palkan/anyway_config) for configuration. @@ -118,11 +121,10 @@ - Remote connections. ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/anycable/litecable. +Bug reports and pull requests are welcome on GitHub at [https://github.com/palkan/litecable](https://github.com/palkan/litecable). ## License -The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). - +The gem is available as open source under the terms of the [MIT License](./LICENSE.txt).