rsence-pre 2.1.0.6.pre → 2.1.0.7.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0.6.pre
1
+ 2.1.0.7.pre
@@ -21,11 +21,13 @@ HPropertyListEditor = HControl.extend({
21
21
  keyDown: function(chr){
22
22
  if(chr===38){
23
23
  this.parent.parent.editPrevItem();
24
+ return true;
24
25
  }
25
26
  else if(chr===40){
26
27
  this.parent.parent.editNextItem();
28
+ return true;
27
29
  }
28
- return true;
30
+ return false;
29
31
  },
30
32
 
31
33
  refreshValue: function(){
@@ -55,6 +57,13 @@ HPropertyListEditor = HControl.extend({
55
57
  this.resizeKeyColumn();
56
58
  },
57
59
 
60
+ lostActiveStatus: function(newActive){
61
+ this.base();
62
+ if(newActive && ((newActive === this) || (newActive.parents.indexOf(this) !== -1)) ){
63
+ return;
64
+ }
65
+ this.hide();
66
+ },
58
67
 
59
68
  resizeKeyColumn: function(){
60
69
 
@@ -105,6 +114,10 @@ HPropertyListEditor = HControl.extend({
105
114
 
106
115
  this.nameEditor = HTextControl.extend({
107
116
  boldTypes: ['a','h'],
117
+ lostActiveStatus: function(newActive){
118
+ this.parent.lostActiveStatus(newActive);
119
+ this.base();
120
+ },
108
121
  refreshValue: function(){
109
122
  if(this.drawn){
110
123
  if(this.boldTypes.indexOf(this.parent.value.type)!==-1){
@@ -130,7 +143,12 @@ HPropertyListEditor = HControl.extend({
130
143
  height = this.nameEditor.rect.height;
131
144
 
132
145
  if(!opts.hideTypeColumn){
133
- this.typeEditor = HMiniMenu.nu(
146
+ this.typeEditor = HMiniMenu.extend({
147
+ lostActiveStatus: function(newActive){
148
+ this.parent.lostActiveStatus(newActive);
149
+ this.base();
150
+ }
151
+ }).nu(
134
152
  [0,1,1,height],
135
153
  this, {
136
154
  value: 'a',
@@ -152,6 +170,10 @@ HPropertyListEditor = HControl.extend({
152
170
  }
153
171
 
154
172
  this.stringEditor = HTextArea.extend({
173
+ lostActiveStatus: function(newActive){
174
+ this.parent.lostActiveStatus(newActive);
175
+ this.base();
176
+ }
155
177
  }).nu(
156
178
  [0,-1,null,height,4,null],
157
179
  this, {
@@ -164,6 +186,10 @@ HPropertyListEditor = HControl.extend({
164
186
  );
165
187
 
166
188
  this.numberEditor = HNumericTextControl.extend({
189
+ lostActiveStatus: function(newActive){
190
+ this.parent.lostActiveStatus(newActive);
191
+ this.base();
192
+ }
167
193
  }).nu(
168
194
  [0,-1,null,height,4,null],
169
195
  this, {
@@ -32,7 +32,8 @@ module RSence
32
32
  :plugin_paths => [ bundle_path('plugins') ],
33
33
  :autoreload => false,
34
34
  :name_prefix => name_with_manager_s.to_sym,
35
- :parent_manager => @plugins
35
+ :parent_manager => @plugins,
36
+ :resolved_deps => [:system]
36
37
  })
37
38
  end
38
39
 
@@ -24,7 +24,8 @@ module RSence
24
24
  attr_reader :transporter, :sessions
25
25
 
26
26
  # Returns the registry data for plugin bundle +plugin_name+
27
- def registry( plugin_name )
27
+ def registry( plugin_name=false )
28
+ return @registry unless plugin_name
28
29
  if @registry.has_key?( plugin_name )
29
30
  return @registry[ plugin_name ]
30
31
  elsif @parent_manager
@@ -71,11 +72,27 @@ module RSence
71
72
  inst.init if inst.respond_to? :init and not inst.inited
72
73
  @registry[ bundle_name ] = inst
73
74
  if inst.respond_to?( :match ) and ( inst.respond_to?( :get ) or inst.respond_to?( :post ) )
74
- @servlets.push( bundle_name )
75
+ add_servlet( bundle_name )
75
76
  end
76
77
  end
77
78
  end
78
79
 
80
+ def add_servlet( bundle_name )
81
+ if @parent_manager
82
+ sub_name = "#{@name_prefix.to_s}:#{bundle_name.to_s}"
83
+ @parent_manager.add_servlet( sub_name )
84
+ end
85
+ @servlets.push( bundle_name )
86
+ end
87
+
88
+ def del_servlet( bundle_name )
89
+ if @parent_manager
90
+ sub_name = "#{@name_prefix.to_s}:#{bundle_name.to_s}"
91
+ @parent_manager.del_servlet( sub_name )
92
+ end
93
+ @servlets.delete( bundle_name )
94
+ end
95
+
79
96
  def callable?( plugin_name, method_name )
80
97
  return false if @deps.category?( plugin_name )
81
98
  return false unless @registry.has_key?( plugin_name )
@@ -87,6 +104,7 @@ module RSence
87
104
  # Calls the method +method_name+ with args +args+ of the plugin +plugin_name+.
88
105
  # Returns false, if no such plugin or method exists.
89
106
  def call( plugin_name, method_name, *args )
107
+ puts "#{plugin_name}.#{method_name}" if RSence.args[:trace_delegate]
90
108
  plugin_name_s = plugin_name.to_s
91
109
  if plugin_name_s.include?(':')
92
110
  colon_index = plugin_name_s.index(':')
@@ -147,21 +165,10 @@ module RSence
147
165
  def match_servlet_uri( uri, req_type=:get )
148
166
  match_score = {}
149
167
  @servlets.each do | servlet_name |
150
- servlet = @registry[ servlet_name ]
151
- next unless servlet.respond_to?( req_type )
152
- begin
153
- if servlet.match( uri, req_type )
154
- score = servlet.score
155
- match_score[ score ] = [] unless match_score.has_key? score
156
- match_score[ score ].push( servlet_name )
157
- end
158
- rescue => e
159
- plugin_error(
160
- e,
161
- "RSence::PluginManager.match_servlet_uri",
162
- "servlet: #{servlet_name.inspect}, req_type: #{req_type.inspect}, uri: #{uri.inspect}",
163
- servlet_name
164
- )
168
+ if call( servlet_name, :match, uri, req_type )
169
+ score = call( servlet_name, :score )
170
+ match_score[ score ] = [] unless match_score.has_key? score
171
+ match_score[ score ].push( servlet_name )
165
172
  end
166
173
  end
167
174
  match_scores = match_score.keys.sort
@@ -193,7 +200,7 @@ module RSence
193
200
  return false unless matches_order
194
201
  matches_order.each do |servlet_name|
195
202
  begin
196
- @registry[servlet_name].send( req_type, req, resp, session )
203
+ call( servlet_name, req_type, req, resp, session )
197
204
  return true
198
205
  rescue => e
199
206
  plugin_error(
@@ -483,7 +490,7 @@ module RSence
483
490
  end
484
491
  end
485
492
  if @servlets.include?( bundle_name )
486
- @servlets.delete( bundle_name )
493
+ del_servlet( bundle_name )
487
494
  end
488
495
  if @info.include?( bundle_name )
489
496
  @info.delete( bundle_name )
@@ -620,11 +627,11 @@ module RSence
620
627
  attr_reader :plugin_paths
621
628
  attr_reader :parent_manager
622
629
 
623
-
624
630
  @@pluginmanager_id = 0
625
631
  # Initialize with a list of directories as plugin_paths.
626
632
  # It's an array containing all plugin directories to scan.
627
633
  def initialize( options )
634
+
628
635
  options = {
629
636
  :plugin_paths => nil,
630
637
  :transporter => nil,
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961916156
4
+ hash: 961916152
5
5
  prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
9
  - 0
10
- - 6
10
+ - 7
11
11
  - pre
12
- version: 2.1.0.6.pre
12
+ version: 2.1.0.7.pre
13
13
  platform: ruby
14
14
  authors:
15
15
  - Riassence Inc.