turbo-rails 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,8 +38,8 @@ module Turbo::Streams::Broadcasts
38
38
  end
39
39
 
40
40
  def broadcast_action_to(*streamables, action:, target: nil, targets: nil, attributes: {}, **rendering)
41
- broadcast_stream_to *streamables, content: turbo_stream_action_tag(
42
- action, target: target, targets: targets, template: render_broadcast_action(rendering), **attributes
41
+ broadcast_stream_to(*streamables, content: turbo_stream_action_tag(
42
+ action, target: target, targets: targets, template: render_broadcast_action(rendering), **attributes)
43
43
  )
44
44
  end
45
45
 
@@ -1,20 +1,23 @@
1
1
  # Turbo is built to work with native navigation principles and present those alongside what's required for the web. When you
2
- # have Turbo Native clients running (see the Turbo iOS and Turbo Android projects for details), you can respond to native
3
- # requests with three dedicated responses: <tt>recede</tt>, <tt>resume</tt>, <tt>refresh</tt>.
2
+ # have Hotwire Native clients running (see the Hotwire Native iOS and Hotwire Native Android projects for details),
3
+ # you can respond to native requests with three dedicated responses: <tt>recede</tt>, <tt>resume</tt>, <tt>refresh</tt>.
4
4
  #
5
- # turbo-android handles these actions automatically. You are required to implement the handling on your own for turbo-ios.
5
+ # Hotwire Native Android and Hotwire Native iOS handle these actions automatically.
6
6
  module Turbo::Native::Navigation
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- helper_method :turbo_native_app?
10
+ helper_method :hotwire_native_app?, :turbo_native_app?
11
11
  end
12
12
 
13
- # Turbo Native applications are identified by having the string "Turbo Native" as part of their user agent.
14
- def turbo_native_app?
15
- request.user_agent.to_s.match?(/Turbo Native/)
13
+ # Hotwire Native applications are identified by having the string "Hotwire Native" as part of their user agent.
14
+ # Legacy Turbo Native applications use the "Turbo Native" string.
15
+ def hotwire_native_app?
16
+ request.user_agent.to_s.match?(/(Turbo|Hotwire) Native/)
16
17
  end
17
-
18
+
19
+ alias_method :turbo_native_app?, :hotwire_native_app?
20
+
18
21
  # Tell the Turbo Native app to dismiss a modal (if presented) or pop a screen off of the navigation stack. Otherwise redirect to the given URL if Turbo Native is not present.
19
22
  def recede_or_redirect_to(url, **options)
20
23
  turbo_native_action_or_redirect url, :recede, :to, options
data/lib/turbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "2.0.10"
2
+ VERSION = "2.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.10
4
+ version: 2.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-09-22 00:00:00.000000000 Z
13
+ date: 2024-10-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.5.16
113
+ rubygems_version: 3.5.11
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: The speed of a single-page web application without having to write any JavaScript.