mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
convert cable.coffee to cable.js
In order to eliminate the dependecy of CoffeeScript.
This commit is contained in:
parent
65b2cfaddd
commit
861e7d43e3
6 changed files with 17 additions and 13 deletions
|
@ -3,7 +3,7 @@ Description:
|
|||
Stubs out a new cable channel for the server (in Ruby) and client (in CoffeeScript).
|
||||
Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.
|
||||
|
||||
Note: Turn on the cable connection in app/assets/javascript/cable.coffee after generating any channels.
|
||||
Note: Turn on the cable connection in app/assets/javascript/cable.js after generating any channels.
|
||||
|
||||
Example:
|
||||
========
|
||||
|
|
|
@ -332,7 +332,7 @@ module Rails
|
|||
def delete_action_cable_files_skipping_action_cable
|
||||
if options[:skip_action_cable]
|
||||
remove_file 'config/cable.yml'
|
||||
remove_file 'app/assets/javascripts/cable.coffee'
|
||||
remove_file 'app/assets/javascripts/cable.js'
|
||||
remove_dir 'app/channels'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
# You can generate new channels where WebSocket features live using the rails generate channel command.
|
||||
#
|
||||
#= require action_cable
|
||||
#= require_self
|
||||
#= require_tree ./channels
|
||||
|
||||
@App ||= {}
|
||||
App.cable = ActionCable.createConsumer()
|
|
@ -0,0 +1,13 @@
|
|||
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
// You can generate new channels where WebSocket features live using the rails generate channel command.
|
||||
//
|
||||
//= require action_cable
|
||||
//= require_self
|
||||
//= require_tree ./channels
|
||||
|
||||
(function() {
|
||||
this.App || (this.App = {});
|
||||
|
||||
App.cable = ActionCable.createConsumer();
|
||||
|
||||
}).call(this);
|
|
@ -118,7 +118,7 @@ module ApplicationTests
|
|||
end
|
||||
|
||||
def test_code_statistics_sanity
|
||||
assert_match "Code LOC: 16 Test LOC: 0 Code to Test Ratio: 1:0.0",
|
||||
assert_match "Code LOC: 18 Test LOC: 0 Code to Test Ratio: 1:0.0",
|
||||
Dir.chdir(app_path){ `bin/rails stats` }
|
||||
end
|
||||
|
||||
|
|
|
@ -463,7 +463,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator [destination_root, "--skip-action-cable"]
|
||||
assert_file "config/application.rb", /#\s+require\s+["']action_cable\/engine["']/
|
||||
assert_no_file "config/cable.yml"
|
||||
assert_no_file "app/assets/javascripts/cable.coffee"
|
||||
assert_no_file "app/assets/javascripts/cable.js"
|
||||
assert_no_file "app/channels"
|
||||
assert_file "Gemfile" do |content|
|
||||
assert_no_match(/redis/, content)
|
||||
|
|
Loading…
Reference in a new issue