[from now] 2013/09/28 06:50:01

diff --git a/Gemfile b/Gemfile
index c741127..5caebbd 100644
--- a/Gemfile
+++ b/Gemfile
@@ -11,6 +11,8 @@ gem 'therubyracer', platforms: :ruby
 gem 'jquery-rails'
 gem 'turbolinks'
 gem 'jbuilder', '~> 1.2'
+gem 'websocket-rails'
+gem 'kaminari'

 # Use ActiveModel has_secure_password
 # gem 'bcrypt-ruby', '~> 3.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 39740fa..12aedf1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -50,6 +50,7 @@ GEM
     coffee-script-source (1.6.3)
     columnize (0.3.6)
     coolline (0.4.2)
+    daemons (1.1.9)
     database_rewinder (0.0.2)
     debug_inspector (0.0.2)
     debugger (1.6.2)
@@ -59,6 +60,8 @@ GEM
     debugger-linecache (1.2.0)
     debugger-ruby_core_source (1.2.3)
     diff-lcs (1.2.4)
+    em-synchrony (1.0.3)
+      eventmachine (>= 1.0.0.beta.1)
     em-websocket (0.5.0)
       eventmachine (>= 0.12.9)
       http_parser.rb (~> 0.5.3)
@@ -72,6 +75,9 @@ GEM
     factory_girl_rails (4.2.1)
       factory_girl (~> 4.2.0)
       railties (>= 3.0.0)
+    faye-websocket (0.7.0)
+      eventmachine (>= 0.12.0)
+      websocket-driver (>= 0.3.0)
     ffi (1.9.0)
     forgery (0.5.0)
     formatador (0.2.4)
@@ -107,6 +113,7 @@ GEM
     hirb-unicode (0.0.5)
       hirb (~> 0.5)
       unicode-display_width (~> 0.1.1)
+    hiredis (0.4.5)
     hpricot (0.8.6)
     html2haml (1.0.1)
       erubis (~> 2.7.0)
@@ -123,6 +130,9 @@ GEM
       railties (>= 3.0, < 5.0)
       thor (>= 0.14, < 2.0)
     json (1.8.0)
+    kaminari (0.14.1)
+      actionpack (>= 3.0.0)
+      activesupport (>= 3.0.0)
     libv8 (3.16.14.3)
     listen (1.3.1)
       rb-fsevent (>= 0.9.3)
@@ -183,6 +193,7 @@ GEM
       ffi (>= 0.5.0)
     rdoc (3.12.2)
       json (~> 1.4)
+    redis (3.0.4)
     ref (1.0.5)
     rspec-core (2.14.5)
     rspec-expectations (2.14.3)
@@ -223,6 +234,10 @@ GEM
     therubyracer (0.12.0)
       libv8 (~> 3.16.14.0)
       ref
+    thin (1.5.1)
+      daemons (>= 1.0.9)
+      eventmachine (>= 0.12.6)
+      rack (>= 1.0.0)
     thor (0.18.1)
     thread_safe (0.1.3)
       atomic
@@ -237,6 +252,15 @@ GEM
       execjs (>= 0.3.0)
       multi_json (~> 1.0, >= 1.0.2)
     unicode-display_width (0.1.1)
+    websocket-driver (0.3.0)
+    websocket-rails (0.6.2)
+      em-synchrony
+      faye-websocket
+      hiredis
+      rack
+      rails
+      redis
+      thin
     xpath (2.0.0)
       nokogiri (~> 1.3)
     yard (0.8.7.2)
@@ -265,6 +289,7 @@ DEPENDENCIES
   hirb-unicode
   jbuilder (~> 1.2)
   jquery-rails
+  kaminari
   mysql2
   pry-coolline
   pry-doc
@@ -280,3 +305,4 @@ DEPENDENCIES
   therubyracer
   turbolinks
   uglifier (>= 1.3.0)
+  websocket-rails
diff --git a/bin/rspec b/bin/rspec
new file mode 100755
index 0000000..bba8a9e
--- /dev/null
+++ b/bin/rspec
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+exec $(dirname $0)/spring rspec "$@"
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 0000000..531ce49
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+# This is a special way of invoking the spring gem in order to
+# work around the performance issue discussed in
+# https://github.com/rubygems/rubygems/pull/435
+
+glob       = "{#{Gem::Specification.dirs.join(",")}}/spring-*.gemspec"
+candidates = Dir[glob].to_a.sort
+
+spec = Gem::Specification.load(candidates.last)
+
+if spec
+  spec.activate
+  load spec.bin_file("spring")
+else
+  $stderr.puts "Could not find spring gem in #{Gem::Specification.dirs.join(", ")}."
+  exit 1
+end
[from now] 2013/09/28 06:50:30

diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d6925fa..79abaff 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -14,3 +14,5 @@
 //= require jquery_ujs
 //= require turbolinks
 //= require_tree .
+//= require websocket_rails/main
+
diff --git a/config/events.rb b/config/events.rb
new file mode 100644
index 0000000..b40d976
--- /dev/null
+++ b/config/events.rb
@@ -0,0 +1,14 @@
+WebsocketRails::EventMap.describe do
+  # You can use this file to map incoming events to controller actions.
+  # One event can be mapped to any number of controller actions. The
+  # actions will be executed in the order they were subscribed.
+  #
+  # Uncomment and edit the next line to handle the client connected event:
+  #   subscribe :client_connected, :to => Controller, :with_method => :method_name
+  #
+  # Here is an example of mapping namespaced events:
+  #   namespace :product do
+  #     subscribe :new, :to => ProductController, :with_method => :new_product
+  #   end
+  # The above will handle an event triggered on the client like `product.new`.
+end
diff --git a/config/initializers/websocket_rails.rb b/config/initializers/websocket_rails.rb
new file mode 100644
index 0000000..6029bcc
--- /dev/null
+++ b/config/initializers/websocket_rails.rb
@@ -0,0 +1,48 @@
+WebsocketRails.setup do |config|
+
+  # Uncomment to override the default log level. The log level can be
+  # any of the standard Logger log levels. By default it will mirror the
+  # current Rails environment log level.
+  # config.log_level = :debug
+
+  # Uncomment to change the default log file path.
+  # config.log_path = "#{Rails.root}/log/websocket_rails.log"
+
+  # Set to true if you wish to log the internal websocket_rails events
+  # such as the keepalive `websocket_rails.ping` event.
+  # config.log_internal_events = false
+
+  # Change to true to enable standalone server mode
+  # Start the standalone server with rake websocket_rails:start_server
+  # * Requires Redis
+  config.standalone = false
+
+  # Change to true to enable channel synchronization between
+  # multiple server instances.
+  # * Requires Redis.
+  config.synchronize = false
+
+  # Uncomment and edit to point to a different redis instance.
+  # Will not be used unless standalone or synchronization mode
+  # is enabled.
+  # config.redis_options = {:host => 'localhost', :port => '6379'}
+
+  # By default, all subscribers in to a channel will be removed
+  # when that channel is made private. If you don't wish active
+  # subscribers to be removed from a previously public channel
+  # when making it private, set the following to true.
+  # config.keep_subscribers_when_private = false
+
+  # Used as the key for the WebsocketRails.users Hash. This method
+  # will be called on the `current_user` object in your controller
+  # if one exists. If `current_user` does not exist or does not
+  # respond to the identifier, the key will default to `connection.id`
+  # config.user_identifier = :id
+
+  # Uncomment and change this option to override the class associated
+  # with your `current_user` object. This class will be used when
+  # synchronization is enabled and you trigger events from background
+  # jobs using the WebsocketRails.users UserManager.
+  # config.user_class = User
+
+end
[from now] 2013/09/28 06:53:11

diff --git a/config/initializers/websocket_rails.rb b/config/initializers/websocket_rails.rb
index 6029bcc..4963224 100644
--- a/config/initializers/websocket_rails.rb
+++ b/config/initializers/websocket_rails.rb
@@ -15,7 +15,7 @@ WebsocketRails.setup do |config|
   # Change to true to enable standalone server mode
   # Start the standalone server with rake websocket_rails:start_server
   # * Requires Redis
-  config.standalone = false
+  config.standalone = true

   # Change to true to enable channel synchronization between
   # multiple server instances.
@@ -25,7 +25,7 @@ WebsocketRails.setup do |config|
   # Uncomment and edit to point to a different redis instance.
   # Will not be used unless standalone or synchronization mode
   # is enabled.
-  # config.redis_options = {:host => 'localhost', :port => '6379'}
+  config.redis_options = {:host => 'localhost', :port => '6379'}

   # By default, all subscribers in to a channel will be removed
   # when that channel is made private. If you don't wish active