diff options
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/CHANGELOG.md | 5 | ||||
-rw-r--r-- | actioncable/README.md | 2 | ||||
-rw-r--r-- | actioncable/actioncable.gemspec | 2 | ||||
-rw-r--r-- | actioncable/app/assets/javascripts/action_cable.js | 7 | ||||
-rw-r--r-- | actioncable/app/javascript/action_cable/index.js | 8 | ||||
-rw-r--r-- | actioncable/lib/action_cable/gem_version.rb | 2 | ||||
-rw-r--r-- | actioncable/package.json | 2 | ||||
-rw-r--r-- | actioncable/test/javascript/src/unit/action_cable_test.js | 8 |
8 files changed, 26 insertions, 10 deletions
diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index aa72cec9cb..9f312f8806 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -1,3 +1,8 @@ +## Rails 6.0.0.beta3 (March 11, 2019) ## + +* No changes. + + ## Rails 6.0.0.beta2 (February 25, 2019) ## * PostgreSQL subscription adapters now support `channel_prefix` option in cable.yml diff --git a/actioncable/README.md b/actioncable/README.md index 60c879e1f4..38eb251f42 100644 --- a/actioncable/README.md +++ b/actioncable/README.md @@ -13,7 +13,7 @@ You can read more about Action Cable in the [Action Cable Overview](https://edge API documentation is at: -* http://api.rubyonrails.org +* https://api.rubyonrails.org Bug reports for the Ruby on Rails project can be filed here: diff --git a/actioncable/actioncable.gemspec b/actioncable/actioncable.gemspec index 29836f012f..7aefb67c51 100644 --- a/actioncable/actioncable.gemspec +++ b/actioncable/actioncable.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.author = ["Pratik Naik", "David Heinemeier Hansson"] s.email = ["pratiknaik@gmail.com", "david@loudthinking.com"] - s.homepage = "http://rubyonrails.org" + s.homepage = "https://rubyonrails.org" s.files = Dir["CHANGELOG.md", "MIT-LICENSE", "README.md", "lib/**/*", "app/assets/javascripts/action_cable.js"] s.require_path = "lib" diff --git a/actioncable/app/assets/javascripts/action_cable.js b/actioncable/app/assets/javascripts/action_cable.js index 280adbfa83..4efab2ed46 100644 --- a/actioncable/app/assets/javascripts/action_cable.js +++ b/actioncable/app/assets/javascripts/action_cable.js @@ -465,14 +465,15 @@ } } function createWebSocketURL(url) { - if (url && !/^wss?:/i.test(url)) { + var webSocketURL = typeof url === "function" ? url() : url; + if (webSocketURL && !/^wss?:/i.test(webSocketURL)) { var a = document.createElement("a"); - a.href = url; + a.href = webSocketURL; a.href = a.href; a.protocol = a.protocol.replace("http", "ws"); return a.href; } else { - return url; + return webSocketURL; } } exports.Connection = Connection; diff --git a/actioncable/app/javascript/action_cable/index.js b/actioncable/app/javascript/action_cable/index.js index 659418396f..e679745fd7 100644 --- a/actioncable/app/javascript/action_cable/index.js +++ b/actioncable/app/javascript/action_cable/index.js @@ -30,14 +30,16 @@ export function getConfig(name) { } export function createWebSocketURL(url) { - if (url && !/^wss?:/i.test(url)) { + const webSocketURL = typeof url === "function" ? url() : url + + if (webSocketURL && !/^wss?:/i.test(webSocketURL)) { const a = document.createElement("a") - a.href = url + a.href = webSocketURL // Fix populating Location properties in IE. Otherwise, protocol will be blank. a.href = a.href a.protocol = a.protocol.replace("http", "ws") return a.href } else { - return url + return webSocketURL } } diff --git a/actioncable/lib/action_cable/gem_version.rb b/actioncable/lib/action_cable/gem_version.rb index 728b3e90cb..2be81736c6 100644 --- a/actioncable/lib/action_cable/gem_version.rb +++ b/actioncable/lib/action_cable/gem_version.rb @@ -10,7 +10,7 @@ module ActionCable MAJOR = 6 MINOR = 0 TINY = 0 - PRE = "beta2" + PRE = "beta3" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end diff --git a/actioncable/package.json b/actioncable/package.json index f6691e10d1..4451afd17f 100644 --- a/actioncable/package.json +++ b/actioncable/package.json @@ -1,6 +1,6 @@ { "name": "@rails/actioncable", - "version": "6.0.0-beta2", + "version": "6.0.0-beta3", "description": "WebSocket framework for Ruby on Rails.", "main": "app/assets/javascripts/action_cable.js", "files": [ diff --git a/actioncable/test/javascript/src/unit/action_cable_test.js b/actioncable/test/javascript/src/unit/action_cable_test.js index 83426fa32e..c9d34abc6d 100644 --- a/actioncable/test/javascript/src/unit/action_cable_test.js +++ b/actioncable/test/javascript/src/unit/action_cable_test.js @@ -41,5 +41,13 @@ module("ActionCable", () => { assert.equal(consumer.url, testURL) }) + + test("uses function to generate URL", assert => { + const generateURL = () => { + return testURL + } + const consumer = ActionCable.createConsumer(generateURL) + assert.equal(consumer.url, testURL) + }) }) }) |