isomorfeus-transport 23.9.0.rc8 → 23.9.0.rc9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3f9f6bf67020ca28605db5a6326238e4cecd45a1e7c197322fe34a48827cc2a
4
- data.tar.gz: 9809ee18d90a629c666fff5351a1d052f4699a878f88ad0516968ba0f121ccd1
3
+ metadata.gz: c07ce297d5bea646806d99661803705cc781a10990ff7b711c67a06e5e8efb25
4
+ data.tar.gz: 13b539bde6f466b72f02784bbf5df7f8fff8c3cae524ee62c877e5ca5b2b6357
5
5
  SHA512:
6
- metadata.gz: 67b88b9395bbeb990502363703f76c115ee499968984949b858951cc48a9fc875b3a387a54c5405231a2213aa6f33f6b36078363f04a469536fcff66bb14f448
7
- data.tar.gz: bbb7812baec9c9c43d4012677e4b5f80190edfb2f71695d78d549daae01b7e8b9ea2645d739922d102805873275d4a3206ff10f4687b1f1667f46b41c71a1478
6
+ metadata.gz: c543e3b0da1feff51f4edc320bdfe843de6cfc6b54e6cf85a7bf22d933b43bcacee3525731f755bc9e34b52032354dcf863a35d9d3e5dba8242cc0c6d8d39657
7
+ data.tar.gz: 832f4789fd60cf6b12cca2939e10cefd1a6a3d3570e467c067039fefb9b025afede606791c969410a9a28d365af8f181cd6d133bd9238fc5f77924c5a95cd85f
@@ -99,23 +99,25 @@ module Isomorfeus
99
99
 
100
100
  def insert_middleware_after(existing_middleware, new_middleware)
101
101
  index_of_existing = Isomorfeus.middlewares.index(existing_middleware)
102
- unless Isomorfeus.middlewares.include?(new_middleware)
103
- if index_of_existing
104
- Isomorfeus.middlewares.insert(index_of_existing + 1, new_middleware)
105
- else
106
- Isomorfeus.middlewares.push(new_middleware)
102
+ if index_of_existing
103
+ if Isomorfeus.middlewares.include?(new_middleware)
104
+ Isomorfeus.middlewares.delete(new_middleware)
107
105
  end
106
+ Isomorfeus.middlewares.insert(index_of_existing + 1, new_middleware)
107
+ else
108
+ Isomorfeus.middlewares.push(new_middleware)
108
109
  end
109
110
  end
110
111
 
111
112
  def insert_middleware_before(existing_middleware, new_middleware)
112
113
  index_of_existing = Isomorfeus.middlewares.index(existing_middleware)
113
- unless Isomorfeus.middlewares.include?(new_middleware)
114
- if index_of_existing
115
- Isomorfeus.middlewares.insert(index_of_existing, new_middleware)
116
- else
117
- Isomorfeus.middlewares.push(new_middleware)
114
+ if index_of_existing
115
+ if Isomorfeus.middlewares.include?(new_middleware)
116
+ Isomorfeus.middlewares.delete(new_middleware)
118
117
  end
118
+ Isomorfeus.middlewares.insert(index_of_existing, new_middleware)
119
+ else
120
+ Isomorfeus.middlewares.unshift(new_middleware)
119
121
  end
120
122
  end
121
123
 
@@ -36,7 +36,7 @@ module Isomorfeus
36
36
  when Isomorfeus.api_websocket_path
37
37
  if env['rack.upgrade?'] == :websocket
38
38
  user, session_id = self.class.user_from_env(env)
39
- env['rack.upgrade'] = Isomorfeus::Transport::ServerSocketProcessor.new(user, session_id)
39
+ env['rack.upgrade'] = Isomorfeus::Transport::ServerSocketProcessor.new(user, session_id, env['locale'])
40
40
  end
41
41
  WS_RESPONSE
42
42
  when Isomorfeus.cookie_eater_path
@@ -4,10 +4,11 @@ module Isomorfeus
4
4
  OJ_OBJ_RE = /"(\^c|\^o|\^u)":/
5
5
  include Isomorfeus::Transport::ServerProcessor
6
6
 
7
- def initialize(user, session_id)
7
+ def initialize(user, session_id, locale)
8
8
  @user = user
9
9
  @session_id = session_id
10
10
  @atime = Time.now
11
+ @locale = locale
11
12
  end
12
13
 
13
14
  def on_message(client, data)
@@ -23,6 +24,9 @@ module Isomorfeus
23
24
  end
24
25
  Isomorfeus.init_store
25
26
  Isomorfeus.store.clear!
27
+ if @locale
28
+ Isomorfeus.store.dispatch(type: 'I18N_INIT', data: { locale: @locale, domain: Isomorfeus.i18n_domain })
29
+ end
26
30
  if user.respond_to?(:reload)
27
31
  cu = Thread.current[:isomorfeus_user]
28
32
  Thread.current[:isomorfeus_user] = LocalSystem.new
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Transport
3
- VERSION = '23.9.0.rc8'
3
+ VERSION = '23.9.0.rc9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.9.0.rc8
4
+ version: 23.9.0.rc9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - '='
192
192
  - !ruby/object:Gem::Version
193
- version: 23.9.0.rc8
193
+ version: 23.9.0.rc9
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - '='
199
199
  - !ruby/object:Gem::Version
200
- version: 23.9.0.rc8
200
+ version: 23.9.0.rc9
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: isomorfeus-puppetmaster
203
203
  requirement: !ruby/object:Gem::Requirement