rsence-pre 2.3.0.22 → 2.3.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0.22.pre
1
+ 2.3.0.23.pre
@@ -33,6 +33,9 @@
33
33
  #
34
34
  # Default additional libraries to use:
35
35
  :default_libs: []
36
+ #
37
+ # Default HTML <body> contents
38
+ :body: ''
36
39
  #
37
40
  # The settings for the main plugin
38
41
  :main_plugin:
@@ -666,9 +666,13 @@ ELEM = HClass.extend
666
666
  _id = @_add( _elem )
667
667
  @_initCache( _id )
668
668
  if _options?
669
- if _options.attrs
670
- for _attr in _options.attrs
671
- @setAttr( _id, _attr[0], _attr[1], true )
669
+ if _options.attrs?
670
+ if _options.attrs instanceof Array
671
+ for _attr in _options.attrs
672
+ @setAttr( _id, _attr[0], _attr[1], true )
673
+ else
674
+ for _attrName, _attrValue of _options.attrs
675
+ @setAttr( _id, _attrName, _attrValue, true )
672
676
  if _options.styles
673
677
  @setStyles( _id, _options.styles )
674
678
  @_elements[_targetId].appendChild(_elem)
@@ -84,6 +84,7 @@ HPoint = HClass.extend({
84
84
  else {
85
85
  throw "Invalid number of arguments.";
86
86
  }
87
+ return this;
87
88
  },
88
89
 
89
90
  /** = Description
@@ -109,7 +110,7 @@ HPoint = HClass.extend({
109
110
  if (this.y > _rect.bottom) {
110
111
  this.y = _rect.bottom;
111
112
  }
112
-
113
+ return this;
113
114
  },
114
115
 
115
116
  /** = Description
@@ -188,6 +189,10 @@ HPoint = HClass.extend({
188
189
  **/
189
190
  equals: function(_point) {
190
191
  return ( this.x === _point.x && this.y === _point.y );
192
+ },
193
+
194
+ clone: function(){
195
+ return (new HPoint(this));
191
196
  }
192
197
 
193
198
  });
@@ -100,6 +100,10 @@ HRect = HClass.extend({
100
100
  this.right = _rect.right;
101
101
  },
102
102
 
103
+ clone: function(){
104
+ return (new HRect(this));
105
+ },
106
+
103
107
  toArray: function(){
104
108
  var
105
109
  _arr = new Array(6,null),
@@ -223,6 +227,7 @@ HRect = HClass.extend({
223
227
  this.width = (this.right - this.left);
224
228
  this.height = (this.bottom - this.top);
225
229
  }
230
+ return this;
226
231
  },
227
232
 
228
233
  /** = Description
@@ -259,6 +264,7 @@ HRect = HClass.extend({
259
264
  throw "Invalid number of arguments.";
260
265
  }
261
266
  this.updateSecondaryValues();
267
+ return this;
262
268
  },
263
269
 
264
270
  /** = Description
@@ -271,6 +277,7 @@ HRect = HClass.extend({
271
277
  setLeft: function(_left){
272
278
  this.left = _left;
273
279
  this.updateSecondaryValues();
280
+ return this;
274
281
  },
275
282
 
276
283
  /** = Description
@@ -283,6 +290,7 @@ HRect = HClass.extend({
283
290
  setRight: function(_right){
284
291
  this.right = _right;
285
292
  this.updateSecondaryValues();
293
+ return this;
286
294
  },
287
295
 
288
296
  /** = Description
@@ -295,6 +303,7 @@ HRect = HClass.extend({
295
303
  setTop: function(_top){
296
304
  this.top = _top;
297
305
  this.updateSecondaryValues();
306
+ return this;
298
307
  },
299
308
 
300
309
  /** = Description
@@ -307,6 +316,7 @@ HRect = HClass.extend({
307
316
  setBottom: function(_bottom){
308
317
  this.bottom = _bottom;
309
318
  this.updateSecondaryValues();
319
+ return this;
310
320
  },
311
321
 
312
322
  /** = Description
@@ -321,6 +331,7 @@ HRect = HClass.extend({
321
331
  this.left=_point.x;
322
332
  this.top=_point.y;
323
333
  this.updateSecondaryValues();
334
+ return this;
324
335
  },
325
336
 
326
337
  /** = Description
@@ -335,6 +346,7 @@ HRect = HClass.extend({
335
346
  this.left=_point.x;
336
347
  this.bottom=_point.y;
337
348
  this.updateSecondaryValues();
349
+ return this;
338
350
  },
339
351
 
340
352
  /** = Description
@@ -349,6 +361,7 @@ HRect = HClass.extend({
349
361
  this.right=_point.x;
350
362
  this.top=_point.y;
351
363
  this.updateSecondaryValues();
364
+ return this;
352
365
  },
353
366
 
354
367
  /** = Description
@@ -363,6 +376,7 @@ HRect = HClass.extend({
363
376
  this.right=_point.x;
364
377
  this.bottom=_point.y;
365
378
  this.updateSecondaryValues();
379
+ return this;
366
380
  },
367
381
 
368
382
  /** = Description
@@ -375,6 +389,7 @@ HRect = HClass.extend({
375
389
  setWidth: function(_width){
376
390
  this.right = this.left + _width;
377
391
  this.updateSecondaryValues();
392
+ return this;
378
393
  },
379
394
 
380
395
  /** = Description
@@ -387,6 +402,7 @@ HRect = HClass.extend({
387
402
  setHeight: function(_height){
388
403
  this.bottom = this.top + _height;
389
404
  this.updateSecondaryValues();
405
+ return this;
390
406
  },
391
407
 
392
408
  /** = Description
@@ -417,6 +433,7 @@ HRect = HClass.extend({
417
433
  this.right = this.left + _width;
418
434
  this.bottom = this.top + _height;
419
435
  this.updateSecondaryValues();
436
+ return this;
420
437
  },
421
438
 
422
439
  /** = Description
@@ -509,6 +526,7 @@ HRect = HClass.extend({
509
526
  throw "Invalid number of arguments.";
510
527
  }
511
528
  this.updateSecondaryValues();
529
+ return this;
512
530
  },
513
531
  _insetByPoint: function(_point) {
514
532
  this._insetByXY(_point.x, _point.y);
@@ -543,6 +561,7 @@ HRect = HClass.extend({
543
561
  throw "Invalid number of arguments.";
544
562
  }
545
563
  this.updateSecondaryValues();
564
+ return this;
546
565
  },
547
566
  _offsetByPoint: function(_point) {
548
567
  this._offsetByXY(_point.x, _point.y);
@@ -576,6 +595,7 @@ HRect = HClass.extend({
576
595
  throw "Invalid number of arguments.";
577
596
  }
578
597
  this.updateSecondaryValues();
598
+ return this;
579
599
  },
580
600
  _offsetToPoint: function(_point) {
581
601
  this._offsetToXY(_point.x, _point.y);
@@ -654,6 +674,7 @@ HRect = HClass.extend({
654
674
  this.viewIds.push( _view.viewId );
655
675
  }
656
676
  this._updateFlexibleDimensions();
677
+ return this;
657
678
  },
658
679
 
659
680
  /** = Description
@@ -664,6 +685,7 @@ HRect = HClass.extend({
664
685
  if(~_viewIdx){
665
686
  this.viewIds.splice( _viewIdx, 1 );
666
687
  }
688
+ return this;
667
689
  },
668
690
 
669
691
  /** = Description
@@ -675,6 +697,7 @@ HRect = HClass.extend({
675
697
  **/
676
698
  setValueObj: function(_valueObj){
677
699
  this.valueObj = _valueObj;
700
+ return this;
678
701
  },
679
702
 
680
703
  /** = Description
@@ -695,6 +718,7 @@ HRect = HClass.extend({
695
718
  _viewId = this.viewIds[i];
696
719
  HSystem.views[_viewId].drawRect();
697
720
  }
721
+ return this;
698
722
  },
699
723
 
700
724
  toString: function(){
@@ -184,23 +184,32 @@ HMorphAnimation = HClass.extend({
184
184
  if(_unit){
185
185
  _propNow += _unit;
186
186
  }
187
- ELEM.setStyle( this.elemId, _key, _propNow );
187
+ this._animateStepStyle( _key, _propNow );
188
188
  }
189
189
  }
190
190
  }
191
191
  else {
192
192
  // Animation is done, clear the interval and finalize the animation.
193
193
  for (i = 0; i < _obj.props.length; i++) {
194
- ELEM.setStyle(
195
- this.elemId,
196
- _obj.props[i].prop,
197
- _obj.props[i].to + _obj.props[i].unit);
194
+ this._animateFinalStepStyle(_obj.props[i]);
198
195
  }
199
196
  this._animationDone = true;
200
197
  this.stopAnimation();
201
198
  }
202
199
  return this;
203
200
  },
201
+
202
+ _animateStepStyle: function( _key, _propNow ){
203
+ ELEM.setStyle( this.elemId, _key, _propNow );
204
+ },
205
+
206
+ _animateFinalStepStyle: function(_props){
207
+ ELEM.setStyle(
208
+ this.elemId,
209
+ _props.prop,
210
+ _props.to + _props.unit
211
+ );
212
+ },
204
213
 
205
214
  /** = Description
206
215
  * Extend the onAnimationStart method, if you want to do something special
@@ -30,14 +30,15 @@ class MongoSessionStorage
30
30
  :pool_size => @config[:mongo][:pool_size],
31
31
  :pool_timeout => @config[:mongo][:pool_timeout],
32
32
  :auths => [{
33
- 'username' => conn[:username],
34
- 'password' => conn[:password],
35
- 'db_name' => conn[:db]
33
+ :username => conn[:username],
34
+ :password => conn[:password],
35
+ :db_name => conn[:db]
36
36
  }]
37
37
  } )
38
38
  @conn.apply_saved_authentication
39
39
  @db = @conn.db( conn[:db] )
40
- @db_auth = @db.authenticate( conn[:username], conn[:password], true )
40
+ @db_auth = true # on current versions of Mongo, complains about the pool auths
41
+ # @db_auth = @db.authenticate( conn[:username], conn[:password], true )
41
42
  end
42
43
 
43
44
  # Checks, whether the string can be converted to BSON::ObjectId
@@ -91,6 +91,9 @@ module RSence
91
91
 
92
92
  # user info, map to your own user management code
93
93
  :user_info => {},
94
+
95
+ # sequence number of session, incremented by each restore
96
+ :ses_seq => 0,
94
97
 
95
98
  # valuemanager data
96
99
  :values => {
@@ -132,7 +135,13 @@ module RSence
132
135
 
133
136
  # new time-out
134
137
  ses_data[:timeout] = Time.now.to_i + @config[:timeout_secs]
135
-
138
+
139
+ if ses_data.has_key?(:ses_seq)
140
+ ses_data[:ses_seq] += 1
141
+ else
142
+ ses_data[:ses_seq] = 0
143
+ end
144
+
136
145
  # re-generates the ses_key for each sync
137
146
  if @config[:disposable_keys]
138
147
 
@@ -204,6 +213,7 @@ module RSence
204
213
  ses_data[:plugin_incr] = @plugins.incr
205
214
  ses_id = new_ses_id( cookie_key, ses_key, timeout )
206
215
  ses_data[:ses_id] = ses_id
216
+ ses_data[:ses_seq] = 0
207
217
  @sessions[ ses_id ] = ses_data
208
218
  @session_keys[ ses_sha ] = ses_id
209
219
  @session_cookie_keys.delete( old_data[:cookie_key] )
@@ -240,7 +250,7 @@ module RSence
240
250
 
241
251
  # get the session's data based on its id
242
252
  ses_data = @sessions[ ses_id ]
243
-
253
+
244
254
  if not ses_data.has_key?(:_msg_unused) and @config[:clone_cookie_sessions] and ses_seed
245
255
  clone_ses( msg, ses_data, ses_id, ses_key, ses_seed )
246
256
  return [true, true]
@@ -51,6 +51,19 @@ module RSence
51
51
  @id_counter = 0
52
52
  end
53
53
  @accept_requests = true
54
+ # workaround for the mutexes, would fail in ruby 2.0.0
55
+ @shutdown_save = false
56
+ @shutdown_saved = false
57
+ Thread.new do
58
+ Thread.pass
59
+ until @shutdown_saved
60
+ if @shutdown_save
61
+ store_sessions
62
+ @shutdown_saved = true
63
+ end
64
+ sleep 1
65
+ end
66
+ end
54
67
  end
55
68
  attr_reader :db_avail
56
69
  attr_reader :accept_requests
@@ -189,7 +202,8 @@ module RSence
189
202
  def shutdown
190
203
  @accept_requests = false
191
204
  puts "Session shutdown in progress..." if RSence.args[:verbose]
192
- store_sessions
205
+ @shutdown_save = true
206
+ sleep 1 until @shutdown_saved
193
207
  puts "Session shutdown complete." if RSence.args[:verbose]
194
208
  end
195
209
  end
data/plugins/main/main.rb CHANGED
@@ -73,6 +73,7 @@ class MainPlugin < Plugin
73
73
  index_html.gsub!( '__CLIENT_REV__', client_rev )
74
74
  index_html.gsub!( '__CLIENT_HELLO__', @bconf[:hello] )
75
75
  index_html.gsub!( '__NOSCRIPT__', @conf[:noscript] )
76
+ index_html.gsub!( '__BODY__', @conf[:body] )
76
77
 
77
78
  return index_html
78
79
  end
@@ -191,6 +192,7 @@ class MainPlugin < Plugin
191
192
  # server-side session and reloads the page
192
193
  if virtual_uri == '/sign_out'
193
194
  resp_addr = @conf[:respond_address]
195
+ @plugins.delegate('sign_out',msg)
194
196
  msg.expire_session()
195
197
  msg.reply( [
196
198
  'COMM.Transporter.stop=true;',
@@ -5,4 +5,4 @@
5
5
  <style type="text/css">body{margin:0;padding:0;background-color:#ddd;font-family:Arial,sans-serif;}</style>
6
6
  __SCRIPT_DEPS__
7
7
  <script>function RSenceInit(){RSence.serverConf('__CLIENT_BASE__','__CLIENT_HELLO__');}</script></head>
8
- <body id="body"><noscript>__NOSCRIPT__</noscript></body></html>
8
+ <body id="body"><noscript>__NOSCRIPT__</noscript>__BODY__</body></html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.22
4
+ version: 2.3.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-08 00:00:00.000000000 Z
13
+ date: 2013-04-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsence-deps
@@ -28,53 +28,29 @@ dependencies:
28
28
  - - '='
29
29
  - !ruby/object:Gem::Version
30
30
  version: '971'
31
- description: ! 'RSence is a different and unique development model and software frameworks
32
- designed first-hand for real-time web applications. RSence consists of separate,
33
- but tigtly integrated data- and user interface frameworks.
34
-
31
+ description: |-
32
+ RSence is a different and unique development model and software frameworks designed first-hand for real-time web applications. RSence consists of separate, but tigtly integrated data- and user interface frameworks.
35
33
 
36
34
  RSence could be classified as a thin server - thick client system.
37
35
 
36
+ Applications and submobules are installed as indepenent plugin bundles into the plugins folder of a RSence environment, which in itself is a self-contained bundle. A big part of RSence itself is implemented as shared plugin bundles.
38
37
 
39
- Applications and submobules are installed as indepenent plugin bundles into the
40
- plugins folder of a RSence environment, which in itself is a self-contained bundle.
41
- A big part of RSence itself is implemented as shared plugin bundles.
42
-
43
-
44
- The user interface framework of RSence is implemented in high-level user interface
45
- widget classes. The widget classes share a common foundation API and access the
46
- browser''s native API''s using an abstracted event- and element layer, which provides
47
- exceptional cross-browser compatibility.
48
-
38
+ The user interface framework of RSence is implemented in high-level user interface widget classes. The widget classes share a common foundation API and access the browser's native API's using an abstracted event- and element layer, which provides exceptional cross-browser compatibility.
49
39
 
50
- The data framework of RSence is a event-driven system, which synchronized shared
51
- values between the client and server. It''s like a realtime bidirectional form-submission
52
- engine that handles data changes intelligently. On the client, changed values trigger
53
- events on user interface widgets. On the server, changed values trigger events on
54
- value responder methods of server plugin modules. It doesn''t matter if the change
55
- originates on client or server, it''s all synchronized and propagated automatically.
40
+ The data framework of RSence is a event-driven system, which synchronized shared values between the client and server. It's like a realtime bidirectional form-submission engine that handles data changes intelligently. On the client, changed values trigger events on user interface widgets. On the server, changed values trigger events on value responder methods of server plugin modules. It doesn't matter if the change originates on client or server, it's all synchronized and propagated automatically.
56
41
 
42
+ The server framework is implemented as a high-level, modular data-event-driven system, which handles delegation of tasks impossible to implement using a client-only approach.
43
+ Client sessions are selectively connected to other client sessions and legacy back-ends via the server by using the data framework.
57
44
 
58
- The server framework is implemented as a high-level, modular data-event-driven system,
59
- which handles delegation of tasks impossible to implement using a client-only approach.
60
-
61
- Client sessions are selectively connected to other client sessions and legacy back-ends
62
- via the server by using the data framework.
63
-
64
-
65
- The client is written in Javascript and the server is written in Ruby. The client
66
- also supports CoffeeScript for custom logic. In many cases, no custom client logic
67
- is needed; the user interfaces can be defined in tree-like data models. By default,
68
- the models are parsed from YAML files, and other structured data formats are possible,
69
- including XML, JSON, databases or any custom logic capable of producing similar
70
- objects. The server can connect to custom environments and legacy backends accessible
71
- on the server, including software written in other languages.'
45
+ The client is written in Javascript and the server is written in Ruby. The client also supports CoffeeScript for custom logic. In many cases, no custom client logic is needed; the user interfaces can be defined in tree-like data models. By default, the models are parsed from YAML files, and other structured data formats are possible, including XML, JSON, databases or any custom logic capable of producing similar objects. The server can connect to custom environments and legacy backends accessible on the server, including software written in other languages.
72
46
  email: info@rsence.org
73
47
  executables:
74
48
  - rsence-pre
75
49
  extensions: []
76
50
  extra_rdoc_files: []
77
51
  files:
52
+ - lib/rsence.rb
53
+ - lib/rsence/argv.rb
78
54
  - lib/rsence/argv/argv_util.rb
79
55
  - lib/rsence/argv/env_check.rb
80
56
  - lib/rsence/argv/help_argv.rb
@@ -83,18 +59,18 @@ files:
83
59
  - lib/rsence/argv/startup_argv.rb
84
60
  - lib/rsence/argv/status_argv.rb
85
61
  - lib/rsence/argv/test_port.rb
86
- - lib/rsence/argv.rb
87
62
  - lib/rsence/daemon.rb
88
63
  - lib/rsence/default_config.rb
89
64
  - lib/rsence/dependencies.rb
90
65
  - lib/rsence/gzstring.rb
66
+ - lib/rsence/http.rb
91
67
  - lib/rsence/http/broker.rb
92
68
  - lib/rsence/http/rackup.rb
93
69
  - lib/rsence/http/request.rb
94
70
  - lib/rsence/http/response.rb
95
- - lib/rsence/http.rb
96
71
  - lib/rsence/msg.rb
97
72
  - lib/rsence/pluginmanager.rb
73
+ - lib/rsence/plugins.rb
98
74
  - lib/rsence/plugins/gui_plugin.rb
99
75
  - lib/rsence/plugins/guiparser.rb
100
76
  - lib/rsence/plugins/plugin.rb
@@ -102,7 +78,6 @@ files:
102
78
  - lib/rsence/plugins/plugin_plugins.rb
103
79
  - lib/rsence/plugins/plugin_sqlite_db.rb
104
80
  - lib/rsence/plugins/servlet.rb
105
- - lib/rsence/plugins.rb
106
81
  - lib/rsence/session/mongo_sessionstorage.rb
107
82
  - lib/rsence/session/sequel_sessionstorage.rb
108
83
  - lib/rsence/sessionmanager.rb
@@ -111,7 +86,6 @@ files:
111
86
  - lib/rsence/transporter.rb
112
87
  - lib/rsence/value.rb
113
88
  - lib/rsence/valuemanager.rb
114
- - lib/rsence.rb
115
89
  - setup/welcome/client_pkgs.yaml
116
90
  - setup/welcome/gui.yaml
117
91
  - setup/welcome/info.yaml
@@ -360,13 +334,13 @@ require_paths:
360
334
  required_ruby_version: !ruby/object:Gem::Requirement
361
335
  none: false
362
336
  requirements:
363
- - - ! '>='
337
+ - - '>='
364
338
  - !ruby/object:Gem::Version
365
339
  version: 1.8.7
366
340
  required_rubygems_version: !ruby/object:Gem::Requirement
367
341
  none: false
368
342
  requirements:
369
- - - ! '>'
343
+ - - '>'
370
344
  - !ruby/object:Gem::Version
371
345
  version: 1.3.1
372
346
  requirements: []