{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/47515924","id":47515924,"diff_hunk":"@@ -0,0 +1,485 @@\n+# Action Cable – Integrated WebSockets for Rails\n+[![Build Status](https://travis-ci.org/rails/actioncable.svg)](https://travis-ci.org/rails/actioncable)\n+\n+Action Cable seamlessly integrates WebSockets with the rest of your Rails application.\n+It allows for real-time features to be written in Ruby in the same style\n+and form as the rest of your Rails application, while still being performant\n+and scalable. It's a full-stack offering that provides both a client-side\n+JavaScript framework and a server-side Ruby framework. You have access to your full\n+domain model written with ActiveRecord or your ORM of choice.\n+\n+\n+## Terminology\n+\n+A single Action Cable server can handle multiple connection instances. It has one\n+connection instance per WebSocket connection. A single user may have multiple\n+WebSockets open to your application if they use multiple browser tabs or devices.\n+The client of a WebSocket connection is called the consumer.\n+\n+Each consumer can in turn subscribe to multiple cable channels. Each channel encapsulates\n+a logical unit of work, similar to what a controller does in a regular MVC setup. For example, you could have a `ChatChannel` and a `AppearancesChannel`, and a consumer could be subscribed to either\n+or to both of these channels. At the very least, a consumer should be subscribed to one channel.\n+\n+When the consumer is subscribed to a channel, they act as a subscriber. The connection between\n+the subscriber and the channel is, surprise-surprise, called a subscription. A consumer\n+can act as a subscriber to a given channel any number of times. For example, a consumer\n+could subscribe to multiple chat rooms at the same time. (And remember that a physical user may\n+have multiple consumers, one per tab/device open to your connection).\n+\n+Each channel can then again be streaming zero or more broadcastings. A broadcasting is a\n+pubsub link where anything transmitted by the broadcaster is sent directly to the channel\n+subscribers who are streaming that named broadcasting.\n+\n+As you can see, this is a fairly deep architectural stack. There's a lot of new terminology\n+to identify the new pieces, and on top of that, you're dealing with both client and server side\n+reflections of each unit.\n+\n+## Examples\n+\n+### A full-stack example\n+\n+The first thing you must do is define your `ApplicationCable::Connection` class in Ruby. This\n+is the place where you authorize the incoming connection, and proceed to establish it\n+if all is well. Here's the simplest example starting with the server-side connection class:\n+\n+```ruby\n+# app/channels/application_cable/connection.rb\n+module ApplicationCable\n+  class Connection < ActionCable::Connection::Base\n+    identified_by :current_user\n+\n+    def connect\n+      self.current_user = find_verified_user\n+    end\n+\n+    protected\n+      def find_verified_user\n+        if current_user = User.find_by(id: cookies.signed[:user_id])\n+          current_user\n+        else\n+          reject_unauthorized_connection\n+        end\n+      end\n+  end\n+end\n+```\n+Here `identified_by` is a connection identifier that can be used to find the specific connection again or later.\n+Note that anything marked as an identifier will automatically create a delegate by the same name on any channel instances created off the connection.\n+\n+Then you should define your `ApplicationCable::Channel` class in Ruby. This is the place where you put\n+shared logic between your channels.\n+\n+```ruby\n+# app/channels/application_cable/channel.rb\n+module ApplicationCable\n+  class Channel < ActionCable::Channel::Base\n+  end\n+end\n+```\n+\n+This relies on the fact that you will already have handled authentication of the user, and\n+that a successful authentication sets a signed cookie with the `user_id`. This cookie is then\n+automatically sent to the connection instance when a new connection is attempted, and you\n+use that to set the `current_user`. By identifying the connection by this same current_user,\n+you're also ensuring that you can later retrieve all open connections by a given user (and\n+potentially disconnect them all if the user is deleted or deauthorized).\n+\n+The client-side needs to setup a consumer instance of this connection. That's done like so:\n+\n+```coffeescript\n+# app/assets/javascripts/application_cable.coffee\n+#= require cable\n+\n+@App = {}\n+App.cable = Cable.createConsumer \"ws://cable.example.com\"\n+```\n+\n+The ws://cable.example.com address must point to your set of Action Cable servers, and it\n+must share a cookie namespace with the rest of the application (which may live under http://example.com).\n+This ensures that the signed cookie will be correctly sent.\n+\n+That's all you need to establish the connection! But of course, this isn't very useful in\n+itself. This just gives you the plumbing. To make stuff happen, you need content. That content\n+is defined by declaring channels on the server and allowing the consumer to subscribe to them.\n+\n+\n+### Channel example 1: User appearances\n+\n+Here's a simple example of a channel that tracks whether a user is online or not and what page they're on.\n+(This is useful for creating presence features like showing a green dot next to a user name if they're online).\n+\n+First you declare the server-side channel:\n+\n+```ruby\n+# app/channels/appearance_channel.rb\n+class AppearanceChannel < ApplicationCable::Channel\n+  def subscribed\n+    current_user.appear\n+  end\n+\n+  def unsubscribed\n+    current_user.disappear\n+  end\n+\n+  def appear(data)\n+    current_user.appear on: data['appearing_on']\n+  end\n+\n+  def away\n+    current_user.away\n+  end\n+end\n+```\n+\n+The `#subscribed` callback is invoked when, as we'll show below, a client-side subscription is initiated. In this case,\n+we take that opportunity to say \"the current user has indeed appeared\". That appear/disappear API could be backed by\n+Redis or a database or whatever else. Here's what the client-side of that looks like:\n+\n+```coffeescript\n+# app/assets/javascripts/cable/subscriptions/appearance.coffee\n+App.cable.subscriptions.create \"AppearanceChannel\",\n+  # Called when the subscription is ready for use on the server\n+  connected: ->\n+    @install()\n+    @appear()\n+\n+  # Called when the WebSocket connection is closed\n+  disconnected: ->\n+    @uninstall()\n+\n+  # Called when the subscription is rejected by the server\n+  rejected: ->\n+    @uninstall()\n+\n+  appear: ->\n+    # Calls `AppearanceChannel#appear(data)` on the server\n+    @perform(\"appear\", appearing_on: $(\"main\").data(\"appearing-on\"))\n+\n+  away: ->\n+    # Calls `AppearanceChannel#away` on the server\n+    @perform(\"away\")\n+\n+\n+  buttonSelector = \"[data-behavior~=appear_away]\"\n+\n+  install: ->\n+    $(document).on \"page:change.appearance\", =>\n+      @appear()\n+\n+    $(document).on \"click.appearance\", buttonSelector, =>\n+      @away()\n+      false\n+\n+    $(buttonSelector).show()\n+\n+  uninstall: ->\n+    $(document).off(\".appearance\")\n+    $(buttonSelector).hide()\n+```\n+\n+Simply calling `App.cable.subscriptions.create` will setup the subscription, which will call `AppearanceChannel#subscribed`,\n+which in turn is linked to original `App.cable` -> `ApplicationCable::Connection` instances.\n+\n+We then link the client-side `appear` method to `AppearanceChannel#appear(data)`. This is possible because the server-side\n+channel instance will automatically expose the public methods declared on the class (minus the callbacks), so that these\n+can be reached as remote procedure calls via a subscription's `perform` method.\n+\n+### Channel example 2: Receiving new web notifications\n+\n+The appearance example was all about exposing server functionality to client-side invocation over the WebSocket connection.\n+But the great thing about WebSockets is that it's a two-way street. So now let's show an example where the server invokes\n+action on the client.\n+\n+This is a web notification channel that allows you to trigger client-side web notifications when you broadcast to the right\n+streams:\n+\n+```ruby\n+# app/channels/web_notifications_channel.rb\n+class WebNotificationsChannel < ApplicationCable::Channel\n+  def subscribed\n+    stream_from \"web_notifications_#{current_user.id}\"\n+  end\n+end\n+```\n+\n+```coffeescript\n+# Client-side which assumes you've already requested the right to send web notifications\n+App.cable.subscriptions.create \"WebNotificationsChannel\",\n+  received: (data) ->\n+    new Notification data[\"title\"], body: data[\"body\"]\n+```\n+\n+```ruby\n+# Somewhere in your app this is called, perhaps from a NewCommentJob\n+ActionCable.server.broadcast \\\n+  \"web_notifications_#{current_user.id}\", { title: 'New things!', body: 'All the news that is fit to print' }\n+```\n+\n+The `ActionCable.server.broadcast` call places a message in the Redis' pubsub queue under a separate broadcasting name for each user. For a user with an ID of 1, the broadcasting name would be `web_notifications_1`.\n+The channel has been instructed to stream everything that arrives at `web_notifications_1` directly to the client by invoking the\n+`#received(data)` callback. The data is the hash sent as the second parameter to the server-side broadcast call, JSON encoded for the trip\n+across the wire, and unpacked for the data argument arriving to `#received`.\n+\n+\n+### Passing Parameters to Channel\n+\n+You can pass parameters from the client side to the server side when creating a subscription. For example:\n+\n+```ruby\n+# app/channels/chat_channel.rb\n+class ChatChannel < ApplicationCable::Channel\n+  def subscribed\n+    stream_from \"chat_#{params[:room]}\"\n+  end\n+end\n+```\n+\n+Pass an object as the first argument to `subscriptions.create`, and that object will become your params hash in your cable channel. The keyword `channel` is required.\n+\n+```coffeescript\n+# Client-side which assumes you've already requested the right to send web notifications\n+App.cable.subscriptions.create { channel: \"ChatChannel\", room: \"Best Room\" },\n+  received: (data) ->\n+    @appendLine(data)\n+\n+  appendLine: (data) ->\n+    html = @createLine(data)\n+    $(\"[data-chat-room='Best Room']\").append(html)\n+\n+  createLine: (data) ->\n+    \"\"\"\n+    <article class=\"chat-line\">\n+      <span class=\"speaker\">#{data[\"sent_by\"]}</span>\n+      <span class=\"body\">#{data[\"body\"]}</span>\n+    </article>\n+    \"\"\"\n+```\n+\n+```ruby\n+# Somewhere in your app this is called, perhaps from a NewCommentJob\n+ActionCable.server.broadcast \\\n+  \"chat_#{room}\", { sent_by: 'Paul', body: 'This is a cool chat app.' }\n+```\n+\n+\n+### Rebroadcasting message\n+\n+A common use case is to rebroadcast a message sent by one client to any other connected clients.\n+\n+```ruby\n+# app/channels/chat_channel.rb\n+class ChatChannel < ApplicationCable::Channel\n+  def subscribed\n+    stream_from \"chat_#{params[:room]}\"\n+  end\n+\n+  def receive(data)\n+    ActionCable.server.broadcast \"chat_#{params[:room]}\", data\n+  end\n+end\n+```\n+\n+```coffeescript\n+# Client-side which assumes you've already requested the right to send web notifications\n+App.chatChannel = App.cable.subscriptions.create { channel: \"ChatChannel\", room: \"Best Room\" },\n+  received: (data) ->\n+    # data => { sent_by: \"Paul\", body: \"This is a cool chat app.\" }\n+\n+App.chatChannel.send({ sent_by: \"Paul\", body: \"This is a cool chat app.\" })\n+```\n+\n+The rebroadcast will be received by all connected clients, _including_ the client that sent the message. Note that params are the same as they were when you subscribed to the channel.\n+\n+\n+### More complete examples\n+\n+See the [rails/actioncable-examples](http://github.com/rails/actioncable-examples) repository for a full example of how to setup Action Cable in a Rails app and adding channels.\n+\n+\n+## Configuration\n+\n+Action Cable has two required configurations: the Redis connection and specifying allowed request origins.\n+\n+### Redis\n+\n+By default, `ActionCable::Server::Base` will look for a configuration file in `Rails.root.join('config/redis/cable.yml')`. The file must follow the following format:\n+\n+```yaml\n+production: &production\n+  :url: redis://10.10.3.153:6381\n+  :host: 10.10.3.153\n+  :port: 6381\n+  :timeout: 1\n+development: &development\n+  :url: redis://localhost:6379\n+  :host: localhost\n+  :port: 6379\n+  :timeout: 1\n+  :inline: true\n+test: *development\n+```\n+\n+This format allows you to specify one configuration per Rails environment. You can also change the location of the Redis config file in\n+a Rails initializer with something like:\n+\n+```ruby\n+ActionCable.server.config.redis_path = Rails.root('somewhere/else/cable.yml')\n+```\n+\n+### Allowed Request Origins\n+\n+Action Cable will only accept requests from specified origins, which are passed to the server config as an array. The origins can be instances of strings or regular expressions, against which a check for match will be performed.\n+\n+```ruby\n+ActionCable.server.config.allowed_request_origins = ['http://rubyonrails.com', /http:\\/\\/ruby.*/]\n+```\n+\n+To disable and allow requests from any origin:\n+\n+```ruby\n+ActionCable.server.config.disable_request_forgery_protection = true\n+```\n+\n+By default, Action Cable allows all requests from localhost:3000 when running in the development environment.\n+\n+### Other Configurations\n+\n+The other common option to configure is the log tags applied to the per-connection logger. Here's close to what we're using in Basecamp:\n+\n+```ruby\n+ActionCable.server.config.log_tags = [\n+  -> request { request.env['bc.account_id'] || \"no-account\" },\n+  :action_cable,\n+  -> request { request.uuid }\n+]\n+```\n+\n+Your websocket url might change between environments. If you host your production server via https, you will need to use the wss scheme\n+for your ActionCable server, but development might remain http and use the ws scheme. You might use localhost in development and your\n+domain in production. In any case, to vary the websocket url between environments, add the following configuration to each environment:\n+\n+```ruby\n+config.action_cable.url = \"ws://example.com:28080\"\n+```\n+\n+Then add the following line to your layout before your JavaScript tag:\n+\n+```erb\n+<%= action_cable_meta_tag %>\n+```\n+\n+And finally, create your consumer like so:\n+\n+```coffeescript\n+App.cable = Cable.createConsumer()\n+```\n+\n+For a full list of all configuration options, see the `ActionCable::Server::Configuration` class.\n+\n+Also note that your server must provide at least the same number of database connections as you have workers. The default worker pool is set to 100, so that means you have to make at least that available. You can change that in `config/database.yml` through the `pool` attribute.\n+\n+\n+## Running the cable server\n+\n+### Standalone\n+The cable server(s) is separated from your normal application server. It's still a rack application, but it is its own rack\n+application. The recommended basic setup is as follows:\n+\n+```ruby\n+# cable/config.ru\n+require ::File.expand_path('../../config/environment', __FILE__)\n+Rails.application.eager_load!\n+\n+require 'action_cable/process/logging'\n+\n+run ActionCable.server\n+```\n+\n+Then you start the server using a binstub in bin/cable ala:\n+```\n+#!/bin/bash\n+bundle exec puma -p 28080 cable/config.ru\n+```\n+\n+The above will start a cable server on port 28080. Remember to point your client-side setup against that using something like:\n+`App.cable.createConsumer('ws://basecamp.dev:28080')`.\n+\n+### In app\n+\n+If you are using a threaded server like Puma or Thin, the current implementation of ActionCable can run side-along with your Rails application. For example, to listen for WebSocket requests on `/websocket`, match requests on that path:\n+\n+```ruby\n+# config/routes.rb\n+Example::Application.routes.draw do\n+  match \"/websocket\", :to => ActionCable.server, via: [:get, :post]\n+end\n+```\n+\n+You can use `App.cable.createConsumer('ws://' + window.location.host + '/websocket')` to connect to the cable server.\n+\n+For every instance of your server you create and for every worker your server spawns, you will also have a new instance of ActionCable, but the use of Redis keeps messages synced across connections.\n+\n+### Notes\n+\n+Beware that currently the cable server will _not_ auto-reload any changes in the framework. As we've discussed, long-running cable connections mean long-running objects. We don't yet have a way of reloading the classes of those objects in a safe manner. So when you change your channels, or the model your channels use, you must restart the cable server.\n+\n+We'll get all this abstracted properly when the framework is integrated into Rails.\n+\n+The WebSocket server doesn't have access to the session, but it has access to the cookies. This can be used when you need to handle authentication. You can see one way of doing that with Devise in this [article](http://www.rubytutorial.io/actioncable-devise-authentication).\n+\n+## Dependencies\n+\n+Action Cable is currently tied to Redis through its use of the pubsub feature to route\n+messages back and forth over the WebSocket cable connection. This dependency may well\n+be alleviated in the future, but for the moment that's what it is. So be sure to have\n+Redis installed and running.\n+\n+The Ruby side of things is built on top of [faye-websocket](https://github.com/faye/faye-websocket-ruby) and [celluloid](https://github.com/celluloid/celluloid).\n+\n+\n+## Deployment\n+\n+Action Cable is powered by a combination of EventMachine and threads. The\n+framework plumbing needed for connection handling is handled in the\n+EventMachine loop, but the actual channel, user-specified, work is handled\n+in a normal Ruby thread. This means you can use all your regular Rails models\n+with no problem, as long as you haven't committed any thread-safety sins.\n+\n+But this also means that Action Cable needs to run in its own server process.\n+So you'll have one set of server processes for your normal web work, and another\n+set of server processes for the Action Cable. The former can be single-threaded,\n+like Unicorn, but the latter must be multi-threaded, like Puma.\n+\n+\n+## Alpha disclaimer","path":"actioncable/README.md","position":454,"original_position":454,"commit_id":"760de782f7a7bfa3e740a0f192aedb6e5688e529","original_commit_id":"760de782f7a7bfa3e740a0f192aedb6e5688e529","user":{"login":"claudiofullscreen","id":7408595,"avatar_url":"https://avatars.githubusercontent.com/u/7408595?v=3","gravatar_id":"","url":"https://api.github.com/users/claudiofullscreen","html_url":"https://github.com/claudiofullscreen","followers_url":"https://api.github.com/users/claudiofullscreen/followers","following_url":"https://api.github.com/users/claudiofullscreen/following{/other_user}","gists_url":"https://api.github.com/users/claudiofullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiofullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiofullscreen/subscriptions","organizations_url":"https://api.github.com/users/claudiofullscreen/orgs","repos_url":"https://api.github.com/users/claudiofullscreen/repos","events_url":"https://api.github.com/users/claudiofullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/claudiofullscreen/received_events","type":"User","site_admin":false},"body":"@dhh Some sections of this README need to be revised for ActionCable to become part of Rails (such as this Alpha disclaimer).\r\n\r\nWould you like me to open a PR **against your branch** with the suggested changes?\r\nShould I also truncate the lines of the README following Rails conventions?","created_at":"2015-12-14T16:06:31Z","updated_at":"2015-12-14T16:06:31Z","html_url":"https://github.com/rails/rails/pull/22585#discussion_r47515924","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/22585","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/47515924"},"html":{"href":"https://github.com/rails/rails/pull/22585#discussion_r47515924"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/22585"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/22585","id":53580438,"html_url":"https://github.com/rails/rails/pull/22585","diff_url":"https://github.com/rails/rails/pull/22585.diff","patch_url":"https://github.com/rails/rails/pull/22585.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/22585","number":22585,"state":"open","locked":false,"title":"Add Action Cable to rails/master","user":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"body":"It Is Time.","created_at":"2015-12-14T15:39:52Z","updated_at":"2015-12-14T16:06:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6eb623c2d2a3dadbe78208005c64aed36a5d334b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/22585/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/22585/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/22585/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/760de782f7a7bfa3e740a0f192aedb6e5688e529","head":{"label":"dhh:master","ref":"master","sha":"760de782f7a7bfa3e740a0f192aedb6e5688e529","user":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"repo":{"id":47981165,"name":"rails","full_name":"dhh/rails","owner":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhh/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/dhh/rails","forks_url":"https://api.github.com/repos/dhh/rails/forks","keys_url":"https://api.github.com/repos/dhh/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhh/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhh/rails/teams","hooks_url":"https://api.github.com/repos/dhh/rails/hooks","issue_events_url":"https://api.github.com/repos/dhh/rails/issues/events{/number}","events_url":"https://api.github.com/repos/dhh/rails/events","assignees_url":"https://api.github.com/repos/dhh/rails/assignees{/user}","branches_url":"https://api.github.com/repos/dhh/rails/branches{/branch}","tags_url":"https://api.github.com/repos/dhh/rails/tags","blobs_url":"https://api.github.com/repos/dhh/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhh/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhh/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhh/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhh/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/dhh/rails/languages","stargazers_url":"https://api.github.com/repos/dhh/rails/stargazers","contributors_url":"https://api.github.com/repos/dhh/rails/contributors","subscribers_url":"https://api.github.com/repos/dhh/rails/subscribers","subscription_url":"https://api.github.com/repos/dhh/rails/subscription","commits_url":"https://api.github.com/repos/dhh/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhh/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhh/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhh/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhh/rails/contents/{+path}","compare_url":"https://api.github.com/repos/dhh/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhh/rails/merges","archive_url":"https://api.github.com/repos/dhh/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhh/rails/downloads","issues_url":"https://api.github.com/repos/dhh/rails/issues{/number}","pulls_url":"https://api.github.com/repos/dhh/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/dhh/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/dhh/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhh/rails/labels{/name}","releases_url":"https://api.github.com/repos/dhh/rails/releases{/id}","created_at":"2015-12-14T14:50:13Z","updated_at":"2015-12-14T14:50:41Z","pushed_at":"2015-12-14T15:38:49Z","git_url":"git://github.com/dhh/rails.git","ssh_url":"git@github.com:dhh/rails.git","clone_url":"https://github.com/dhh/rails.git","svn_url":"https://github.com/dhh/rails","homepage":"http://rubyonrails.org","size":121109,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"4358b0d1f89f5258eec545b2b2d742a12e3eb5bc","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-12-14T15:49:41Z","pushed_at":"2015-12-14T16:02:36Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":322331,"stargazers_count":28710,"watchers_count":28710,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11638,"mirror_url":null,"open_issues_count":882,"forks":11638,"open_issues":882,"watchers":28710,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/22585"},"html":{"href":"https://github.com/rails/rails/pull/22585"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/22585"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/22585/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/22585/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/22585/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/760de782f7a7bfa3e740a0f192aedb6e5688e529"}}}}