rsence-pre 2.2.0.36 → 2.2.0.37

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0.36.pre
1
+ 2.2.0.37.pre
@@ -17,47 +17,58 @@
17
17
  ** +type+:: '[HStringView]'
18
18
  ** +value+:: The string that this string view displays when drawn.
19
19
  ***/
20
- var//RSence.Controls
21
- HStringView = HControl.extend({
20
+ var HStringView, HLabel;
22
21
 
23
- componentName: "stringview",
24
-
25
- defaultEvents: {
26
- contextMenu: true
27
- },
28
-
29
- /** = Description
30
- * HStringView allows the default contextMenu action.
31
- *
32
- **/
33
- contextMenu: function(){
34
- return true;
35
- },
36
-
37
- /** = Description
38
- * The setStyle method of HStringView applies only to the value
39
- * element (not the whole component).
40
- *
41
- **/
42
- setStyle: function(_name, _value, _cacheOverride) {
43
- if (!this['markupElemIds']||!this.markupElemIds['value']) {
22
+ (function(){
23
+ var _HStringViewInterface = {
24
+
25
+ componentName: "stringview",
26
+
27
+ /** = Description
28
+ * The setStyle method of HStringView applies only to the value
29
+ * element (not the whole component).
30
+ *
31
+ **/
32
+ setStyle: function(_name, _value, _cacheOverride) {
33
+ if (!this['markupElemIds']||!this.markupElemIds['value']) {
34
+ return this;
35
+ }
36
+ this.setStyleOfPart( 'value', _name, _value, _cacheOverride);
44
37
  return this;
45
- }
46
- ELEM.setStyle(this.markupElemIds.value, _name, _value, _cacheOverride);
47
- return this;
48
- },
49
-
50
- /** = Description
51
- * The refreshLabel of HStringView sets a tool tip.
52
- * Applied by the setLabel method and the label attribute of options.
53
- *
54
- **/
55
- refreshLabel: function() {
56
- if(this.markupElemIds) {
57
- if(this.markupElemIds.value) {
58
- ELEM.setAttr(this.markupElemIds.value, 'title', this.label);
38
+ },
39
+
40
+ /** = Description
41
+ * The refreshLabel of HStringView sets a tool tip.
42
+ * Applied by the setLabel method and the label attribute of options.
43
+ *
44
+ **/
45
+ refreshLabel: function() {
46
+ if(this.markupElemIds) {
47
+ if(this.markupElemIds.value) {
48
+ if( this.value !== undefined ){
49
+ this.setAttrOfPart( 'value', 'title', this.label );
50
+ }
51
+ else {
52
+ this.setMarkupOfPart( 'value', this.label );
53
+ }
54
+ }
59
55
  }
60
56
  }
61
- }
62
- });
57
+ };
58
+
59
+ HLabel = HView.extend( _HStringViewInterface );
60
+ HStringView = HControl.extend( _HStringViewInterface ).extend({
61
+ defaultEvents: {
62
+ contextMenu: true
63
+ },
64
+
65
+ /** = Description
66
+ * HStringView allows the default contextMenu action.
67
+ *
68
+ **/
69
+ contextMenu: function(){
70
+ return true;
71
+ }
72
+ });
63
73
 
74
+ })();
@@ -280,6 +280,13 @@ HTab = HControl.extend({
280
280
  var//RSence.Controls
281
281
  HTabItem = {
282
282
  nu: function(_rect, _parent, _options){
283
+ if( _rect.hasAncestor && _rect.hasAncestor( HView ) ){
284
+ _options = _parent;
285
+ _parent = _rect;
286
+ }
287
+ else {
288
+ console.warn && console.warn( "Warning: the rect constructor argument of HTabItem is deprecated." );
289
+ }
283
290
  return _parent.addTab( _options.label, _options.select );
284
291
  }
285
292
  };
@@ -356,6 +363,13 @@ GUITreeTabView = HControl.extend({
356
363
  var//RSence.Controls
357
364
  GUITreeTabItem = {
358
365
  nu: function( _rect, _parent, _options ){
366
+ if( _rect.hasAncestor && _rect.hasAncestor( HView ) ){
367
+ _options = _parent;
368
+ _parent = _rect;
369
+ }
370
+ else {
371
+ console.warn && console.warn( "Warning: the rect constructor argument of GUITreeTabItem is deprecated." );
372
+ }
359
373
  return _parent.addTab( _options.label, _options.select, GUITreeTabView, _options );
360
374
  }
361
375
  };
@@ -68,10 +68,12 @@
68
68
  .tab_bg {
69
69
  position: absolute;
70
70
  top: 24px; left: 0px; right: 0px; bottom: 0px;
71
+ border-radius: 0 0 3px 3px;
71
72
  background-image: #{this.getCssFilePath('tab_border_pattern.png')};
72
73
  }
73
74
  .tab_fg {
74
75
  position: absolute;
75
76
  top: 0px; left: 1px; right: 1px; bottom: 1px;
77
+ border-radius: 0 0 3px 3px;
76
78
  background-image: #{this.getCssFilePath('tab_bg_color.png')};
77
79
  }
@@ -77,7 +77,6 @@ HUploader = HControl.extend
77
77
  @setStyleOfPart( 'form', 'visibility', 'hidden' )
78
78
 
79
79
  setUploadState: (_state, _uploadKey)->
80
- console.log('state:',_state,', uploadKey:',_uploadKey)
81
80
  if _state != @uploadState
82
81
  @uploadState = _state
83
82
  _stateKey = _state.toString()
@@ -129,6 +129,9 @@ HClass.prototype = {
129
129
  } )
130
130
  )( arguments );
131
131
  };
132
+ this.hasAncestor = function( _obj ){
133
+ return this.ancestors.indexOf( _obj ) !== -1;
134
+ };
132
135
  this['new'] = this.nu;
133
136
  return this;
134
137
  },
@@ -190,7 +193,8 @@ HClass.prototype = {
190
193
  HClass.extend = function(_instance, _static) {
191
194
  // reference to HClass's prototype extend method (HClass's class structure extend method)
192
195
  var _extend = HClass.prototype.extend,
193
- _prototype, _constructor, _klass, _object;
196
+ _prototype, _constructor, _klass, _object,
197
+ _ancestors, i=0;
194
198
  // if _instance is undefined,null,"" etc. creates object so that code below works
195
199
  if (!_instance) {
196
200
  _instance = {};
@@ -206,11 +210,13 @@ HClass.extend = function(_instance, _static) {
206
210
  _prototype.constructor = this;
207
211
  delete HClass._prototyping;
208
212
 
213
+ _ancestors = [];
209
214
  _klass = function() {
210
215
  if (!HClass._prototyping) {
211
216
  _constructor.apply(this, arguments);
212
217
  }
213
218
  this.constructor = _klass;
219
+ this.ancestors = _ancestors;
214
220
  };
215
221
  // this is the new class's prototype (class structure)
216
222
  _klass.prototype = _prototype;
@@ -232,8 +238,14 @@ HClass.extend = function(_instance, _static) {
232
238
  if (_object.init instanceof Function) {
233
239
  _object.init();
234
240
  }
241
+ _ancestors.push( _object );
242
+ for( ; i < this.ancestors.length; i++ ){
243
+ _ancestors.push( this.ancestors[i] );
244
+ }
245
+ _object.ancestors = _ancestors;
235
246
  return _object;
236
247
  };
248
+ HClass.ancestors = [ HClass ];
237
249
 
238
250
  /** = Description
239
251
  * Copies the prototype properties and methods from _interface or if it is an object it's properties and functions
@@ -24,7 +24,7 @@
24
24
  //var//RSence.Foundation
25
25
  COMM.JSONRenderer = HClass.extend({
26
26
 
27
- version: 0.9,
27
+ version: 1.0,
28
28
 
29
29
  /** = Description
30
30
  * Renders JSON structured data, see some of the demos for usage examples.
@@ -37,12 +37,49 @@ COMM.JSONRenderer = HClass.extend({
37
37
  if((_data['type'] === 'GUITree') && (this.version >= _data['version'])){
38
38
  this.data = _data;
39
39
  this.parent = _parent;
40
+ this.byId = {};
41
+ this.byName = {};
40
42
  this.render();
43
+ var _rndr = this;
44
+ if( this.view.hasAncestor( HApplication ) ){
45
+ this.view.getViewbyId = function(_id){ return _rndr.getViewById(_id); };
46
+ this.view.getViewsbyName = function(_id){ return _rndr.getViewsByName(_id); };
47
+ }
48
+ else if ( this.view.hasAncestor( HView ) ){
49
+ this.view.app.getViewbyId = function(_id){ return _rndr.getViewById(_id); };
50
+ this.view.app.getViewsbyName = function(_id){ return _rndr.getViewsByName(_id); };
51
+ }
41
52
  }
42
53
  else{
43
54
  throw("JSONRenderer: Only GUITree version "+this.version+" or older data can be handled.");
44
55
  }
45
56
  },
57
+ getViewById: function(_id){
58
+ if( this.byId[_id] !== undefined ){
59
+ return this.byId[_id];
60
+ }
61
+ console.log('JSONRenderer; no such view Id: '+_id);
62
+ return null;
63
+ },
64
+ addViewId: function(_id, _view){
65
+ if( this.byId[_id] !== undefined ){
66
+ console.log('JSONRenderer; already has id: '+_id+' (replacing)');
67
+ }
68
+ this.byId[_id] = _view;
69
+ },
70
+ getViewsByName: function(_name){
71
+ if( this.byName[_id] !== undefined ){
72
+ return this.byName[_name];
73
+ }
74
+ console.log('JSONRenderer; no views named: '+_name);
75
+ return [];
76
+ },
77
+ addViewName: function(_name, _view){
78
+ if( this.byName[_name] === undefined ){
79
+ this.byName[_name] = [];
80
+ }
81
+ this.byName[_name].push(_view);
82
+ },
46
83
  render: function(){
47
84
  this.scopes = [window];
48
85
  this.scopeDepth = 0;
@@ -141,11 +178,41 @@ COMM.JSONRenderer = HClass.extend({
141
178
  return (new _class(_args));
142
179
  }
143
180
  },
181
+ _handleCall: function( _instance, _call ){
182
+ if( _call instanceof Object ){
183
+ var
184
+ _methodName, _arguments;
185
+ for( _methodName in _call ){
186
+ // console.log('methodName:',_methodName);
187
+ if( typeof _instance[_methodName] === 'function' ){
188
+ // console.log('callArguments:',_call[_methodName]);
189
+ try{
190
+ _instance[_methodName].apply( _instance, _call[_methodName] );
191
+ }
192
+ catch(e){
193
+ console.log('JSONRenderer handleCall error:',e.toString()+', method:',_instance[_methodName],', call args:', _call[_methodName],', e:',e);
194
+ }
195
+ }
196
+ else {
197
+ console.log('JSONRenderer handleCall error; undefined method: ',_methodName);
198
+ }
199
+ }
200
+ }
201
+ else {
202
+ console.log('JSONRenderer handleCall error, unable to handle call format: ',_call);
203
+ }
204
+ },
144
205
  renderNode: function( _dataNode, _parent ){
145
206
  var
146
207
  _reserved = [ 'type', 'args', 'version', 'class', 'rect', 'bind', 'extend', 'options', 'subviews', 'define' ],
147
208
  _className, _class, _origNode, _straightParams = false, _rect, _hasRect, _hasSubviews, _subViews,
148
209
  _hasOptions, _options, _hasExtension, _extension, _hasBind, _bind,
210
+ _hasName, _hasId,
211
+ _isAppClass = false, _isViewClass = false,
212
+ _autoOptionItems = [
213
+ 'label', 'style', 'visible', 'theme', 'html',
214
+ 'value', 'enabled', 'events', 'active', 'minValue', 'maxValue'
215
+ ], _autoOptionItem, _hasCall, _call,
149
216
  _hasDefinition, _definition, _instance, i, _subView = null;
150
217
 
151
218
  // The name of the class:
@@ -166,18 +233,35 @@ COMM.JSONRenderer = HClass.extend({
166
233
  }
167
234
 
168
235
  _class = this.findInScope( _className );
236
+
237
+ if (_class['hasAncestor'] !== undefined){
238
+ _isAppClass = _class.hasAncestor( HApplication );
239
+ _isViewClass = _class.hasAncestor( HView );
240
+ }
241
+
242
+ _hasId = ( _dataNode['id'] !== undefined ) && ( typeof _dataNode['id'] === 'string' );
243
+ _hasName = ( _dataNode['name'] !== undefined ) && ( typeof _dataNode['name'] === 'string' );
169
244
 
170
245
  if( _straightParams ){
171
- return this.initStraight( _class, _dataNode );
246
+ _instance = this.initStraight( _class, _dataNode );
172
247
  }
173
248
  else if( _dataNode['args'] !== undefined ){
174
- return this.initStraight( _class, _dataNode['args'] );
249
+ _instance = this.initStraight( _class, _dataNode['args'] );
175
250
  }
176
251
  else if( _origNode && _origNode['args'] !== undefined ){
177
- return this.initStraight( _class, _origNode['args'] );
252
+ _instance = this.initStraight( _class, _origNode['args'] );
253
+ }
254
+ if( _instance ){
255
+ if( _hasId ){
256
+ this.addViewId( _dataNode.id, _instance );
257
+ }
258
+ if( _hasName ){
259
+ this.addViewName( _dataNode.id, _instance );
260
+ }
261
+ return _instance;
178
262
  }
179
263
 
180
- // Currently only HView -derived classes are supported, so
264
+ // Currently only HView -derived classes are supported, so
181
265
  // the rect is mandatory.
182
266
  _rect = _dataNode['rect'];
183
267
  _hasRect = (_rect !== undefined) && (_rect instanceof Array || typeof _rect === 'string');
@@ -185,7 +269,12 @@ COMM.JSONRenderer = HClass.extend({
185
269
  _hasRect = _origNode['rect'] !== undefined;
186
270
  _rect = _hasRect?_origNode['rect']:null;
187
271
  }
188
-
272
+ if( !_isViewClass ){
273
+ if( _hasRect ){
274
+ console.log( "renderNode warning; Supposedly rect-incompatible class supplied: "+_className );
275
+ }
276
+ }
277
+
189
278
  // Checks, if any sub-views are defined.
190
279
  _hasSubviews = _dataNode['subviews'] !== undefined;
191
280
  _subViews = _hasSubviews?_dataNode['subviews']:null;
@@ -201,6 +290,16 @@ COMM.JSONRenderer = HClass.extend({
201
290
  _hasOptions = _origNode['options'] !== undefined;
202
291
  _options = _hasOptions?_origNode['options']:null;
203
292
  }
293
+ for( i=0; i < _autoOptionItems.length; i++ ){
294
+ _autoOptionItem = _autoOptionItems[i];
295
+ if( _dataNode[ _autoOptionItem ] !== undefined ){
296
+ if( !_hasOptions ){
297
+ _hasOptions = true;
298
+ _options = {};
299
+ }
300
+ _options[_autoOptionItem] = _dataNode[ _autoOptionItem ];
301
+ }
302
+ }
204
303
 
205
304
  // JS Extension block
206
305
  _hasExtension = _dataNode['extend'] !== undefined;
@@ -217,6 +316,11 @@ COMM.JSONRenderer = HClass.extend({
217
316
  _hasBind = _origNode['bind'] !== undefined;
218
317
  _bind = _hasBind?_origNode['bind']:null;
219
318
  }
319
+
320
+ _hasCall = _dataNode['call'] !== undefined;
321
+ if( _hasCall ){
322
+ _call = _dataNode['call'];
323
+ }
220
324
 
221
325
  // JS Definition block
222
326
  _hasDefinition = _dataNode['define'] !== undefined;
@@ -225,7 +329,10 @@ COMM.JSONRenderer = HClass.extend({
225
329
  _hasDefinition = _origNode['define'] !== undefined;
226
330
  _definitions = _hasDefinition?_origNode['define']:null;
227
331
  }
228
-
332
+ if( _rect === null && _class['hasAncestor'] && _class.hasAncestor( HView ) ) {
333
+ console.log( 'Ancestors include HView, but no rect defined!' );
334
+ }
335
+
229
336
  // The HView-derived class instance, instance is by default the parent
230
337
  _instance = _parent;
231
338
 
@@ -280,12 +387,34 @@ COMM.JSONRenderer = HClass.extend({
280
387
  }
281
388
  }
282
389
  // For HApplication -derived classes
283
- if(!_hasRect && _hasOptions){
284
- _instance = _class.nu(_options);
390
+ if( _isAppClass ){
391
+ if( _hasOptions ){
392
+ _instance = _class.nu( _options );
393
+ }
394
+ else {
395
+ _instance = _class.nu();
396
+ }
285
397
  }
286
- // For HView and HControl -derived classes
287
- else if(_hasRect){
288
- _instance = _class.nu(_rect,_parent,_options);
398
+ else if ( _isViewClass ){
399
+ _instance = _class.nu( _rect, _parent, _options );
400
+ }
401
+ else {
402
+ if( _hasRect ){
403
+ if( _hasOptions ){
404
+ _instance = _class.nu(_rect,_parent,_options);
405
+ }
406
+ else {
407
+ _instance = _class.nu(_rect,_parent);
408
+ }
409
+ }
410
+ else if ( _hasOptions ){
411
+ // console.log(_className,_parent,_options);
412
+ _instance = _class.nu( _parent, _options );
413
+ }
414
+ else {
415
+ // console.log('renderNode warning; unsure how to construct: '+_className+', rect:',_rect,', options:',_options);
416
+ _instance = _class.nu( _parent );
417
+ }
289
418
  }
290
419
  if(!_hasOptions){
291
420
  if(_hasBind){
@@ -304,8 +433,17 @@ COMM.JSONRenderer = HClass.extend({
304
433
  else if(!(!_class && _hasSubviews)) {
305
434
  console.log('renderNode warning; No such class: '+_className+', node: ',_dataNode);
306
435
  }
436
+ if( _hasId ){
437
+ this.addViewId( _dataNode.id, _instance );
438
+ }
439
+ if( _hasName ){
440
+ this.addViewName( _dataNode.id, _instance );
441
+ }
442
+ if(_hasCall){
443
+ this._handleCall(_instance,_call);
444
+ }
307
445
  }
308
- catch(e){
446
+ catch (e){
309
447
  console.log('renderNode error:',e.toString()+', rect:',_rect,', class:',_dataNode['class'],', options:', _options,', e:',e);
310
448
  }
311
449
  // Iterates recursively through all subviews, if specified.
@@ -13,7 +13,7 @@
13
13
  **
14
14
  ***/
15
15
  var//RSence.Lists
16
- HCheckboxList = HControl.extend({
16
+ HCheckboxList = HListItemControl.extend({
17
17
 
18
18
  /** = Description
19
19
  * Draws borders with 1px and sets 'overflow' to 'auto'.
@@ -21,6 +21,7 @@ HCheckboxList = HControl.extend({
21
21
  **/
22
22
  drawSubviews: function(){
23
23
  this.setStyle('border','1px solid #999');
24
+ this.setStyle('border-radius','3px');
24
25
  this.setStyle('overflow','auto');
25
26
  },
26
27
  listItems: [],
@@ -103,6 +104,7 @@ HCheckboxList = HControl.extend({
103
104
  *
104
105
  **/
105
106
  setListItems: function(_listItems){
107
+ _listItems = this._cleanListItems(_listItems);
106
108
  var _listItem,
107
109
  _value,
108
110
  _label,
@@ -27,6 +27,13 @@ var//RSence.Lists
27
27
  HListItems = HValueResponder.extend({
28
28
 
29
29
  constructor: function( _rect, _parent, _options ){
30
+ if( _rect.hasAncestor && _rect.hasAncestor( HView ) ){
31
+ _options = _parent;
32
+ _parent = _rect;
33
+ }
34
+ else {
35
+ console.warn && console.warn( "Warning: the rect constructor argument of HListItems is deprecated." );
36
+ }
30
37
  this.parent = _parent;
31
38
  if ( this.parent.setListItemResponder ){
32
39
  this.parent.setListItemResponder( this );
@@ -54,10 +61,6 @@ HListItems = HValueResponder.extend({
54
61
  _this.value = null;
55
62
  },
56
63
 
57
- _warningMessage: function(_messageText){
58
- console.log("Warning; HListItems: "+_messageText);
59
- },
60
-
61
64
  /** = Description
62
65
  * Iterates through this.value array and calls
63
66
  * the setListItems function of the parent class.
@@ -65,40 +68,51 @@ HListItems = HValueResponder.extend({
65
68
  **/
66
69
  refresh: function(){
67
70
  if ( this.value instanceof Array ) {
68
- var _listItems = [],
69
- _row, _rowType,
70
- _label, _value,
71
- i = 0;
72
- for ( ; i < this.value.length ; i++ ){
73
- _row = this.value[i];
74
- _rowType = COMM.Values.type( _row );
75
- // console.log('row:',_row,' rowType:',_rowType);
76
- // hashes
77
- if ( _rowType === 'h' ) {
78
- _label = _row.label;
79
- _value = _row.value;
80
- if ( _label === undefined || _value === undefined ){
81
- this._warningMessage( "The value or label of row "+_row+" is undefined (ignored)" );
82
- }
83
- _listItems.push( [_value, _label] );
84
- }
85
- // Arrays as-is
86
- else if ( _rowType == 'a' ){
87
- _listItems.push( _row );
88
- }
89
- // strings and integers
90
- else if ( ['s','n'].indexOf(_rowType) !== -1 ){
91
- _label = _row.toString();
92
- _value = _row;
93
- _listItems.push( [_value, _label] );
94
- }
95
- else {
96
- this._warningMessage( "The row "+_row+" is has unsupported row type: '"+_rowType+"' (ignored)" );
97
- }
98
- }
99
- this.parent.setListItems( _listItems );
71
+ this.parent.setListItems( this.value );
100
72
  }
101
73
  }
102
74
  });
103
75
 
76
+ var
77
+ HListItemControl = HControl.extend({
104
78
 
79
+ _cleanListItems: function(_listItemsIn){
80
+ var _listItems = [],
81
+ _row, _rowType,
82
+ _label, _value,
83
+ i = 0;
84
+ for ( ; i < _listItemsIn.length ; i++ ){
85
+ _row = _listItemsIn[i];
86
+ _rowType = COMM.Values.type( _row );
87
+ // console.log('row:',_row,' rowType:',_rowType);
88
+ // hashes
89
+ if ( _rowType === 'h' ) {
90
+ _label = _row.label;
91
+ _value = _row.value;
92
+ if ( _label === undefined || _value === undefined ){
93
+ console.log( "The value or label of row "+_row+" is undefined (ignored)" );
94
+ }
95
+ _listItems.push( [_value, _label] );
96
+ }
97
+ // Arrays as-is
98
+ else if ( _rowType == 'a' ){
99
+ _listItems.push( _row );
100
+ }
101
+ // strings and integers
102
+ else if ( ['s','n'].indexOf(_rowType) !== -1 ){
103
+ _label = _row.toString();
104
+ _value = _row;
105
+ _listItems.push( [_value, _label] );
106
+ }
107
+ else {
108
+ console.log( "The row "+_row+" has an unsupported row type: '"+_rowType+"' (ignored)" );
109
+ }
110
+ }
111
+ return _listItems;
112
+ },
113
+
114
+ setListItems: function( _listItems ){
115
+ _listItems = this._cleanListItems(_listItems);
116
+ }
117
+
118
+ });
@@ -11,9 +11,10 @@
11
11
  ** The value of the instance is the selected key in the listItems.
12
12
  ***/
13
13
  var//RSence.Lists
14
- HRadioButtonList = HControl.extend({
14
+ HRadioButtonList = HListItemControl.extend({
15
15
  drawSubviews: function(){
16
- this.setStyle('border','1px solid #999');
16
+ this.setStyle('border','1px solid #999999');
17
+ this.setStyle('border-radius','3px');
17
18
  this.setStyle('overflow-y','auto');
18
19
  },
19
20
  listItems: [],
@@ -32,6 +33,7 @@ HRadioButtonList = HControl.extend({
32
33
  *
33
34
  **/
34
35
  setListItems: function(_listItems){
36
+ _listItems = this._cleanListItems(_listItems);
35
37
  var _listItem,
36
38
  _value,
37
39
  _label,
@@ -132,8 +132,8 @@ HMiniMenu = HRadioButtonList.extend({
132
132
  );
133
133
  },
134
134
 
135
- setListItems: function(listItems){
136
- this.base(listItems);
135
+ setListItems: function(_listItems){
136
+ this.base(_listItems);
137
137
  this.valueMatrix = this.menuItemView.valueMatrix;
138
138
  this.refreshValue();
139
139
  if( this.options.initialVisibility ){
@@ -306,7 +306,7 @@ module RSence
306
306
 
307
307
  # System version requirement.
308
308
  # NOTE: Has no effect yet!
309
- :sys_version => '>= 2.0.0',
309
+ :sys_version => '>= 2.2.0',
310
310
 
311
311
  # Dependency, by default the system category (built-in plugins).
312
312
  # A nil ( "~" in yaml ) value means no dependencies.
@@ -380,6 +380,12 @@ module RSence
380
380
 
381
381
  # @private Returns a sanitized copy of a single value item.
382
382
  def sanitize_value_item( value_item_dirty )
383
+ unless value_item_dirty.class == Hash
384
+ value_item_dirty = {
385
+ :value => value_item_dirty,
386
+ :restore_default => false
387
+ }
388
+ end
383
389
  value_item_clean = {}
384
390
  value_item_dirty.each do | key, value |
385
391
  if key.to_sym == :value or key.to_sym == :data
data/lib/rsence.rb CHANGED
@@ -74,7 +74,9 @@ module RSence
74
74
  # +:autoupdate+:: (true or false) True, if the +-a+ or +--auto-update+ command-line option was given. Default is false.
75
75
  # +:latency+:: (Number) Amount of milliseconds to sleep in each request given with the +--latency+ command-line option. Default is 0.
76
76
  # +:say+:: (true or false) True, if the +-S+ or +--say+ command-line option was given. Default is false.
77
- def self.args; @@argv_parser.args; end
77
+ def self.args; @@argv_parser.args; end
78
+
79
+ def self.env_path; @@argv_parser.args[:env_path]; end
78
80
 
79
81
  # @private This accessor enables RSence.startable? method, which returns true if a start-type command was given.
80
82
  def self.startable?; @@argv_parser.startable?; end
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.2.0.36
4
+ version: 2.2.0.37
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsence-deps
17
- requirement: &70324830245020 !ruby/object:Gem::Requirement
17
+ requirement: &70324729769980 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - =
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '966'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70324830245020
25
+ version_requirements: *70324729769980
26
26
  description: ! 'RSence is a different and unique development model and software frameworks
27
27
  designed first-hand for real-time web applications. RSence consists of separate,
28
28
  but tigtly integrated data- and user interface frameworks.