Skip to content

Commit

Permalink
Merge pull request #23935 from y-yagi/convert_cable_coffee_to_javascript
Browse files Browse the repository at this point in the history
convert cable.coffee to cable.js
  • Loading branch information
rafaelfranca committed Mar 1, 2016
2 parents 56f3bbc + 861e7d4 commit 998d21a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion actioncable/lib/rails/generators/channel/USAGE
Original file line number Diff line number Diff line change
Expand Up @@ -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:
========
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/rails/app/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def delete_active_record_initializers_skipping_active_record
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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion railties/test/application/rake_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_should_not_eager_load_model_for_rake
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

Expand Down
2 changes: 1 addition & 1 deletion railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def test_generator_if_skip_action_cable_is_given
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)
Expand Down

0 comments on commit 998d21a

Please sign in to comment.