unageanu-jiji 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README +1 -0
  2. data/base/agents/moving_average_agent.rb +78 -0
  3. data/base/shared_lib/moving_average.rb +34 -0
  4. data/bin/jiji +5 -0
  5. data/html/css/default.css +7 -0
  6. data/html/img/button_calendar_over.gif +0 -0
  7. data/html/img/button_cancel.gif +0 -0
  8. data/html/img/button_no.gif +0 -0
  9. data/html/img/button_no_gray.gif +0 -0
  10. data/html/img/button_no_over.gif +0 -0
  11. data/html/img/button_save.gif +0 -0
  12. data/html/img/button_save_gray.gif +0 -0
  13. data/html/img/button_save_over.gif +0 -0
  14. data/html/img/button_update_s.gif +0 -0
  15. data/html/img/button_update_s_gray.gif +0 -0
  16. data/html/img/button_update_s_over.gif +0 -0
  17. data/html/img/button_yes.gif +0 -0
  18. data/html/img/button_yes_gray.gif +0 -0
  19. data/html/img/button_yes_over.gif +0 -0
  20. data/html/index.html +29 -33
  21. data/html/js/agent-editor-page.js +178 -88
  22. data/html/js/agent-selector.js +68 -39
  23. data/html/js/bt-create-page.js +24 -11
  24. data/html/js/dialog.js +43 -34
  25. data/html/js/result-page.js +37 -25
  26. data/html/js/rt-setting-page.js +13 -6
  27. data/html/js/sidebar.js +8 -5
  28. data/html/js/templates.js +37 -3
  29. data/html/js/utils.js +47 -9
  30. data/html/swf/chart.swf +0 -0
  31. data/lib/jiji/agent/agent_manager.rb +2 -2
  32. data/lib/jiji/agent/agent_registry.rb +4 -1
  33. data/lib/jiji/command.rb +6 -0
  34. data/lib/jiji/process.rb +32 -10
  35. data/lib/jiji/process_manager.rb +7 -0
  36. data/lib/jiji/registry.rb +6 -4
  37. data/lib/jiji/server.rb +6 -1
  38. data/lib/jiji/service/output_service.rb +10 -6
  39. data/swf/chart/fx/chart/Chart.as +4 -1
  40. data/swf/chart/fx/chart/ui/Constants.as +3 -3
  41. data/swf/chart/fx/chart/ui/InformationWindow.as +45 -41
  42. data/swf/chart/fx/chart/ui/Pointer.as +6 -4
  43. data/swf/chart/fx/chart/ui/Scroll.as +3 -2
  44. data/swf/chart/fx/chart/ui/Stage.as +3 -3
  45. data/swf/chart/fx/chart/ui/TradeDetailWindow.as +9 -8
  46. data/swf/chart/fx/chart/ui/TradeResult.as +3 -17
  47. data/swf/chart/fx/chart/ui/graph/Graph.as +4 -2
  48. data/swf/chart/fx/chart/ui/graph/GraphManager.as +3 -1
  49. data/swf/chart/fx/chart/ui/resource/fixed.gif +0 -0
  50. data/swf/chart/fx/chart/ui/resource/unfixed.gif +0 -0
  51. data/swf/chart/fx/net/StubFactory.as +3 -3
  52. data/test/all_tests.rb +1 -1
  53. data/test/test_AgentManager.rb +4 -4
  54. data/test/{test_AgentRegistory.rb → test_AgentRegistry.rb} +0 -0
  55. data/test/test_Collector.rb +1 -1
  56. data/test/test_Output_registry.rb +7 -3
  57. data/test/test_Process.rb +5 -5
  58. data/test/test_ProcessManager.rb +120 -68
  59. metadata +20 -14
  60. data/bin/jiji.rb +0 -6
  61. data/html/js/W3CDTF.js +0 -131
@@ -23,6 +23,8 @@ package fx.chart.ui.graph {
23
23
  public function draw( data:Object, colors:Array ):void {
24
24
  main.x = 0;
25
25
  Util.clear( main );
26
+ Util.clear( axis );
27
+ Util.clear( lowAxis );
26
28
 
27
29
  // データ数分のスプライトを作成
28
30
  if ( !data["datas"] || data["datas"].length <= 0 ) { return; }
@@ -103,7 +105,7 @@ package fx.chart.ui.graph {
103
105
  }
104
106
 
105
107
  // 背景線を引く
106
- drawAxis( data, f );
108
+ drawAxis( data, f );
107
109
 
108
110
  // グラフ
109
111
  drawLineGraph( data, f , colors, sprites );
@@ -170,7 +172,7 @@ package fx.chart.ui.graph {
170
172
  var y:int = f(item);
171
173
  lowAxis.graphics.moveTo( rect.left, y);
172
174
  lowAxis.graphics.lineTo( rect.right, y);
173
- createText( String(item), axis, Constants.TEXT_FORMAT_SCALE_Y, 0, y-3, rect.left-5 );
175
+ createText( String(item), axis, Constants.TEXT_FORMAT_SCALE_Y, 0, y-8, rect.left-2 );
174
176
  } );
175
177
  }
176
178
  }
@@ -83,6 +83,7 @@ package fx.chart.ui.graph {
83
83
  } else {
84
84
  // 取得済みであればレイヤーを表示するだけ。
85
85
  target.graph.setVisible(true);
86
+ target.draw();
86
87
  }
87
88
  }
88
89
  }
@@ -92,6 +93,7 @@ package fx.chart.ui.graph {
92
93
  var target:GraphInfo = infos[name[0]][name[1]];
93
94
  target.visible = false;
94
95
  target.graph.setVisible(false);
96
+ target.draw();
95
97
  }
96
98
  }
97
99
  /**
@@ -122,7 +124,7 @@ package fx.chart.ui.graph {
122
124
  if ( names.length <= 0 ) { return; }
123
125
  ctrl.requestOutputDatas( names, function( map:Object ):void {
124
126
  names.forEach( function( item:*,i:int,arr:Array ):void {
125
- if ( map[item[0]][item[1]] ) {
127
+ if ( map[item[0]] && map[item[0]][item[1]] ) {
126
128
  infos[item[0]][item[1]].datas = map[item[0]][item[1]] ;
127
129
  // グラフ表示
128
130
  if ( infos[item[0]][item[1]].visible ) {
@@ -70,7 +70,7 @@ dynamic class Stub extends Proxy {
70
70
  var data:String = JSON.encode({
71
71
  "method":name.toString(), "params":rest, "time":new Date().getTime()
72
72
  });
73
- log(data);
73
+ //log(data);
74
74
  //request.method = URLRequestMethod.POST;
75
75
  var variable:URLVariables = new URLVariables();
76
76
  variable.request = data;
@@ -80,7 +80,7 @@ dynamic class Stub extends Proxy {
80
80
  var loader:URLLoader = new URLLoader();
81
81
  loader.addEventListener(flash.events.Event.COMPLETE, function( ev:flash.events.Event):void {
82
82
  changeRequestCount(-1);
83
- log(ev.target.data);
83
+ //log(ev.target.data);
84
84
  var result:Object = JSON.decode( ev.target.data)[0];
85
85
  if ( result["error"] ) {
86
86
  fail.apply(null, [result["error"]] );
@@ -106,7 +106,7 @@ dynamic class Stub extends Proxy {
106
106
  }
107
107
  private function changeRequestCount( diff:int ):void {
108
108
  requestCount+= diff;
109
- log( "request count : " + String(requestCount) );
109
+ //log( "request count : " + String(requestCount) );
110
110
  sf.listenerSupport.fire( fx.chart.ctrl.Event.REQUEST_COUNT_CHANGED,
111
111
  {"requestCount":requestCount} );
112
112
  }
data/test/all_tests.rb CHANGED
@@ -12,7 +12,7 @@ require "test_SingleClickClient"
12
12
  require "test_BlockToSession"
13
13
  require "test_AgentManager"
14
14
 
15
- require "test_AgentRegistory"
15
+ require "test_AgentRegistry"
16
16
  require "test_Configuration"
17
17
  require "test_CSV"
18
18
  require "test_Operator"
@@ -35,8 +35,8 @@ class AgentManagerTest < RUNIT::TestCase
35
35
  logger = @permitter.proxy( logger, [/^(info|debug|warn|error|fatal)$/] )
36
36
  @client = JIJI::SingleClickClient.new( ACCOUNT, CONF, logger )
37
37
 
38
- @registory_mock = Object.new
39
- class << @registory_mock
38
+ @registry_mock = Object.new
39
+ class << @registry_mock
40
40
  def output( agent_name, dir )
41
41
  output = JIJI::Output.new( agent_name, "#{dir}/out" )
42
42
  output = @permitter.proxy( output, [/^(get|each|put|<<)$/], [/^get$/] )
@@ -46,7 +46,7 @@ class AgentManagerTest < RUNIT::TestCase
46
46
  @permitter = permitter
47
47
  end
48
48
  end
49
- @registory_mock.permitter = @permitter
49
+ @registry_mock.permitter = @permitter
50
50
 
51
51
  operator = JIJI::RmtOperator.new( @client, logger, nil )
52
52
  operator.conf = CONF
@@ -58,7 +58,7 @@ class AgentManagerTest < RUNIT::TestCase
58
58
  @m.conf = CONF
59
59
  @m.trade_result_dao = trade_result_dao
60
60
  @m.client = @client
61
- @m.registory = @registory_mock
61
+ @m.registry = @registry_mock
62
62
  end
63
63
 
64
64
  def teardown
@@ -70,7 +70,7 @@ class CollectorTest < RUNIT::TestCase
70
70
  assert_equals @c.state, :RUNNING
71
71
 
72
72
  # しばらくまって
73
- sleep 15
73
+ sleep 20
74
74
  assert_equals @c.progress, 0 # 進捗は常に0
75
75
  assert_equals @c.state, :RUNNING
76
76
 
@@ -10,12 +10,12 @@ require "logger"
10
10
  require "testutils"
11
11
 
12
12
  # アウトプットのテスト(レジストリから取り出す)
13
- class OutputRegistoryTest < RUNIT::TestCase
13
+ class OutputregistryTest < RUNIT::TestCase
14
14
 
15
15
  include Test::Constants
16
16
 
17
17
  def setup
18
- @dir = File.dirname(__FILE__) + "/OutputRegistoryTest"
18
+ @dir = File.dirname(__FILE__) + "/OutputregistryTest"
19
19
  @registry = JIJI::Registry.new(@dir , nil)
20
20
  @mng = @registry[:process_manager]
21
21
  end
@@ -26,7 +26,11 @@ class OutputRegistoryTest < RUNIT::TestCase
26
26
  begin
27
27
  @registry.permitter.close
28
28
  ensure
29
- @registry.client.close
29
+ begin
30
+ @registry.client.close
31
+ ensure
32
+ @registry.server_logger.close
33
+ end
30
34
  end
31
35
  ensure
32
36
  FileUtils.rm_rf "#{@dir}/logs"
data/test/test_Process.rb CHANGED
@@ -36,14 +36,14 @@ class ProcessTest < RUNIT::TestCase
36
36
  agent_mng.conf = CONF
37
37
  agent_mng.conf.set( [:agent,:safe_level], 0)
38
38
 
39
- registory_mock = Object.new
40
- class << registory_mock
39
+ registry_mock = Object.new
40
+ class << registry_mock
41
41
  def output( agent_name, dir )
42
42
  output = JIJI::Output.new( agent_name, "#{dir}/out" )
43
43
  return output
44
44
  end
45
45
  end
46
- agent_mng.registory = registory_mock
46
+ agent_mng.registry = registry_mock
47
47
 
48
48
  p1 = JIJI::Process.new( "1", @dir, agent_mng, {} )
49
49
  assert_equals p1.id, "1"
@@ -138,7 +138,7 @@ class ProcessTest < RUNIT::TestCase
138
138
 
139
139
 
140
140
  # 再読み込み / ファイルに保存された設定値が読み込まれる。
141
- p1 = JIJI::Process.new( "1", @dir, agent_mng )
141
+ p1 = JIJI::Process.new( "1", @dir, agent_mng, nil, registry_mock )
142
142
  assert_equals p1.id, "1"
143
143
  assert_equals p1.agent_manager, agent_mng
144
144
  assert_equals p1["x"], "xxx"
@@ -150,7 +150,7 @@ class ProcessTest < RUNIT::TestCase
150
150
  assert_equals p1.agent_manager.operator.trade_enable, false
151
151
 
152
152
  # 別のプロセスを作成 / 設定値は別途保持される。
153
- p2 = JIJI::Process.new( "2", @dir, agent_mng, {} )
153
+ p2 = JIJI::Process.new( "2", @dir, agent_mng, {}, registry_mock )
154
154
  assert_equals p2.id, "2"
155
155
  assert_equals p2.agent_manager, agent_mng
156
156
  assert_equals p2["x"], nil
@@ -47,7 +47,11 @@ class ProcessManagerTest < RUNIT::TestCase
47
47
  begin
48
48
  @registry.permitter.close
49
49
  ensure
50
- @registry.client.close
50
+ begin
51
+ @registry.client.close
52
+ ensure
53
+ @registry.server_logger.close
54
+ end
51
55
  end
52
56
  # Thread.list.each {|t|
53
57
  # puts "---#{t}"
@@ -219,72 +223,116 @@ class ProcessManagerTest < RUNIT::TestCase
219
223
  assert_process_not_found(pid3)
220
224
 
221
225
  end
222
- #
223
- # #
224
- # #複数プロセスを同時に起動するテスト。
225
- # #
226
- # def test_multi_process
227
- # @mng.start
228
- # agents = [{
229
- # "name" => "aaa",
230
- # "class" => "MovingAverageAgent@moving_average.rb",
231
- # "id"=> "44c0d256-8994-4240-a6c6-8d9546aef8c4",
232
- # "properties" => {
233
- # "period" => 10,
234
- # "short" => 25,
235
- # "long" => 75
236
- # }
237
- # }]
238
- #
239
- # # プロセスを追加
240
- # pid = @mng.create_back_test( "test", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 21, 3 ).to_i, agents )["id"]
241
- # sleep 10
242
- #
243
- # # プロセスを取得
244
- # process = @mng.get( pid )
245
- # assert_equals process.state, :RUNNING
246
- # assert_not_nil process.progress
247
- # assert_equals process.id, pid
248
- #
249
- # #別のプロセスを追加
250
- # pid2 = @mng.create_back_test( "test2", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 21, 3 ).to_i, agents )["id"]
251
- # sleep 1
252
- #
253
- # #別のプロセスは待機中になる。
254
- # process = @mng.get( pid2 )
255
- # assert_equals process.state, :WAITING
256
- # assert_not_nil process.progress
257
- # assert_equals process.id, pid2
258
- #
259
- # process = @mng.get( pid )
260
- # assert_equals process.state, :RUNNING
261
- # assert_not_nil process.progress
262
- # assert_equals process.id, pid
263
- #
264
- # # 実行完了を待つ
265
- # sleep 1 while @mng.get( pid ).state == :RUNNING
266
- #
267
- # process = @mng.get( pid )
268
- # assert_equals process.state, :FINISHED
269
- # assert_not_nil process.progress
270
- # assert_equals process.id, pid
271
- #
272
- # sleep 1
273
- #
274
- # #別のプロセスが開始される。
275
- # process = @mng.get( pid2 )
276
- # assert_equals process.state, :RUNNING
277
- # assert_not_nil process.progress
278
- # assert_equals process.id, pid2
279
- #
280
- # sleep 1 while @mng.get( pid2 ).state == :RUNNING
281
- #
282
- # process = @mng.get( pid2 )
283
- # assert_equals process.state, :FINISHED
284
- # assert_not_nil process.progress
285
- # assert_equals process.id, pid2
286
- #
287
- # end
226
+
227
+ #
228
+ #複数プロセスを同時に起動するテスト。
229
+ #
230
+ def test_multi_process
231
+ @mng.start
232
+ agents = [{
233
+ "name" => "aaa",
234
+ "class" => "MovingAverageAgent@moving_average.rb",
235
+ "id"=> "44c0d256-8994-4240-a6c6-8d9546aef8c4",
236
+ "properties" => {
237
+ "period" => 10,
238
+ "short" => 25,
239
+ "long" => 75
240
+ }
241
+ }]
242
+
243
+ # プロセスを追加
244
+ pid = @mng.create_back_test( "test", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 22 ).to_i, agents )["id"]
245
+ sleep 1
246
+
247
+ # プロセスを取得
248
+ process = @mng.get( pid )
249
+ assert_equals process.state, :RUNNING
250
+ assert_not_nil process.progress
251
+ assert_equals process.id, pid
252
+
253
+ #別のプロセスを追加
254
+ pid2 = @mng.create_back_test( "test2", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 22 ).to_i, agents )["id"]
255
+ sleep 1
256
+
257
+ #別のプロセスは待機中になる。
258
+ process = @mng.get( pid2 )
259
+ assert_equals process.state, :WAITING
260
+ assert_not_nil process.progress
261
+ assert_equals process.id, pid2
262
+
263
+ process = @mng.get( pid )
264
+ assert_equals process.state, :RUNNING
265
+ assert_not_nil process.progress
266
+ assert_equals process.id, pid
267
+
268
+ # 実行完了を待つ
269
+ sleep 1 while @mng.get( pid ).state == :RUNNING
270
+
271
+ process = @mng.get( pid )
272
+ assert_equals process.state, :FINISHED
273
+ assert_not_nil process.progress
274
+ assert_equals process.id, pid
275
+
276
+ sleep 1
277
+
278
+ #別のプロセスが開始される。
279
+ process = @mng.get( pid2 )
280
+ assert_equals process.state, :RUNNING
281
+ assert_not_nil process.progress
282
+ assert_equals process.id, pid2
283
+
284
+ # 別のプロセスを追加して削除
285
+ pid3 = @mng.create_back_test( "test3", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 22 ).to_i, agents )["id"]
286
+ sleep 1
287
+ process = @mng.get( pid3 )
288
+ assert_equals process.state, :WAITING
289
+ assert_not_nil process.progress
290
+ assert_equals process.id, pid3
291
+
292
+ @mng.delete_back_test( pid3 )
293
+ assert_process_not_found(pid3)
294
+
295
+ sleep 1 while @mng.get( pid2 ).state == :RUNNING
296
+
297
+ process = @mng.get( pid2 )
298
+ assert_equals process.state, :FINISHED
299
+ assert_not_nil process.progress
300
+ assert_equals process.id, pid2
301
+
302
+ sleep 10
303
+
304
+ ## 待機状態のまま再起動
305
+ # プロセスを追加
306
+ pid4 = @mng.create_back_test( "test4", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 22 ).to_i, agents )["id"]
307
+ sleep 10
308
+
309
+ #別のプロセスを追加
310
+ pid5 = @mng.create_back_test( "test5", "memo", Time.gm( 2008, 8, 21 ).to_i, Time.gm( 2008, 8, 22 ).to_i, agents )["id"]
311
+
312
+ process = @mng.get( pid4 )
313
+ assert_equals process.state, :RUNNING
314
+ assert_not_nil process.progress
315
+ assert_equals process.id, pid4
316
+
317
+ process = @mng.get( pid5 )
318
+ assert_equals process.state, :WAITING
319
+ assert_not_nil process.progress
320
+ assert_equals process.id, pid5
321
+
322
+ recreate_registry
323
+ @mng = @registry[:process_manager]
324
+
325
+ # 実行中のものも待機中のものもキャンセル状態になる。
326
+ process = @mng.get( pid4 )
327
+ assert_equals process.state, :CANCELED
328
+ assert_not_nil process.progress
329
+ assert_equals process.id, pid4
330
+
331
+ process = @mng.get( pid5)
332
+ assert_equals process.state, :CANCELED
333
+ assert_not_nil process.progress
334
+ assert_equals process.id, pid5
335
+ end
288
336
 
289
337
  def recreate_registry
290
338
  begin
@@ -292,7 +340,11 @@ class ProcessManagerTest < RUNIT::TestCase
292
340
  begin
293
341
  @registry.permitter.close
294
342
  ensure
295
- @registry.client.close
343
+ begin
344
+ @registry.client.close
345
+ ensure
346
+ @registry.server_logger.close
347
+ end
296
348
  end
297
349
  ensure
298
350
  return @registry = JIJI::Registry.new(@dir , nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unageanu-jiji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaya Yamauchi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-25 00:00:00 -08:00
12
+ date: 2009-03-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -65,7 +65,7 @@ dependencies:
65
65
  description:
66
66
  email: y-masaya@red.hot.co.jp
67
67
  executables:
68
- - jiji.rb
68
+ - jiji
69
69
  extensions: []
70
70
 
71
71
  extra_rdoc_files: []
@@ -73,7 +73,7 @@ extra_rdoc_files: []
73
73
  files:
74
74
  - README
75
75
  - ChangeLog
76
- - bin/jiji.rb
76
+ - bin/jiji
77
77
  - html/css/calendar.css
78
78
  - html/css/datatable.css
79
79
  - html/css/default.css
@@ -102,17 +102,29 @@ files:
102
102
  - html/img/button_close.gif
103
103
  - html/img/button_close_gray.gif
104
104
  - html/img/button_close_over.gif
105
+ - html/img/button_no.gif
106
+ - html/img/button_no_gray.gif
107
+ - html/img/button_no_over.gif
105
108
  - html/img/button_ok.gif
106
109
  - html/img/button_ok_gray.gif
107
110
  - html/img/button_ok_over.gif
108
111
  - html/img/button_remove.gif
109
112
  - html/img/button_remove_gray.gif
110
113
  - html/img/button_remove_over.gif
114
+ - html/img/button_save.gif
115
+ - html/img/button_save_gray.gif
116
+ - html/img/button_save_over.gif
111
117
  - html/img/button_start.gif
112
118
  - html/img/button_start_over.gif
113
119
  - html/img/button_update.gif
114
120
  - html/img/button_update_gray.gif
115
121
  - html/img/button_update_over.gif
122
+ - html/img/button_update_s.gif
123
+ - html/img/button_update_s_gray.gif
124
+ - html/img/button_update_s_over.gif
125
+ - html/img/button_yes.gif
126
+ - html/img/button_yes_gray.gif
127
+ - html/img/button_yes_over.gif
116
128
  - html/img/circle.gif
117
129
  - html/img/delta.gif
118
130
  - html/img/dialog_info.jpg
@@ -411,8 +423,9 @@ files:
411
423
  - html/js/templates.js
412
424
  - html/js/utils.js
413
425
  - html/js/uuid.js
414
- - html/js/W3CDTF.js
415
426
  - html/swf/chart.swf
427
+ - base/agents/moving_average_agent.rb
428
+ - base/shared_lib/moving_average.rb
416
429
  - lib/jiji/agent/agent.rb
417
430
  - lib/jiji/agent/agent_manager.rb
418
431
  - lib/jiji/agent/agent_registry.rb
@@ -441,13 +454,6 @@ files:
441
454
  - lib/jiji/service/system_service.rb
442
455
  - lib/jiji/service/trade_result_service.rb
443
456
  - lib/jiji/single_click_client.rb
444
- - lib/jiji/strategy/bm.rb
445
- - lib/jiji/strategy/bollinger-bands.rb
446
- - lib/jiji/strategy/common.rb
447
- - lib/jiji/strategy/diff.rb
448
- - lib/jiji/strategy/macd.rb
449
- - lib/jiji/strategy/moving-average.rb
450
- - lib/jiji/strategy/vector.rb
451
457
  - lib/jiji/util/block_to_session.rb
452
458
  - lib/jiji/util/cache.rb
453
459
  - lib/jiji/util/csv_append_support.rb
@@ -622,7 +628,7 @@ files:
622
628
  - test/service/test_RateService.rb
623
629
  - test/testutils.rb
624
630
  - test/test_AgentManager.rb
625
- - test/test_AgentRegistory.rb
631
+ - test/test_AgentRegistry.rb
626
632
  - test/test_BackTestCollector.rb
627
633
  - test/test_BlockToSession.rb
628
634
  - test/test_Collector.rb
@@ -729,7 +735,7 @@ test_files:
729
735
  - test/service/test_RateService.rb
730
736
  - test/testutils.rb
731
737
  - test/test_AgentManager.rb
732
- - test/test_AgentRegistory.rb
738
+ - test/test_AgentRegistry.rb
733
739
  - test/test_BackTestCollector.rb
734
740
  - test/test_BlockToSession.rb
735
741
  - test/test_Collector.rb
data/bin/jiji.rb DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << "../lib"
4
-
5
- require 'jiji/command'
6
- JIJI::Command.new.run( ARGV )
data/html/js/W3CDTF.js DELETED
@@ -1,131 +0,0 @@
1
- // Date/W3CDTF.js -- W3C Date and Time Formats
2
-
3
- Date.W3CDTF = function ( dtf ) {
4
- var dd = new Date();
5
- dd.setW3CDTF = Date.W3CDTF.prototype.setW3CDTF;
6
- dd.getW3CDTF = Date.W3CDTF.prototype.getW3CDTF;
7
- if ( dtf ) this.setW3CDTF( dtf );
8
- return dd;
9
- };
10
-
11
- Date.W3CDTF.VERSION = "0.04";
12
-
13
- Date.W3CDTF.prototype.setW3CDTF = function( dtf ) {
14
- var sp = dtf.split( /[^0-9]/ );
15
-
16
- // invalid format
17
- if ( sp.length < 6 || sp.length > 8 ) return;
18
-
19
- // invalid time zone
20
- if ( sp.length == 7 ) {
21
- if ( dtf.charAt( dtf.length-1 ) != "Z" ) return;
22
- }
23
-
24
- // to numeric
25
- for( var i=0; i<sp.length; i++ ) sp[i] = sp[i]-0;
26
-
27
- // invalid range
28
- if ( sp[0] < 1970 || // year
29
- sp[1] < 1 || sp[1] > 12 || // month
30
- sp[2] < 1 || sp[2] > 31 || // day
31
- sp[3] < 0 || sp[3] > 23 || // hour
32
- sp[4] < 0 || sp[4] > 59 || // min
33
- sp[5] < 0 || sp[5] > 60 ) { // sec
34
- return; // invalid date
35
- }
36
-
37
- // get UTC milli-second
38
- var msec = Date.UTC( sp[0], sp[1]-1, sp[2], sp[3], sp[4], sp[5] );
39
-
40
- // time zene offset
41
- if ( sp.length == 8 ) {
42
- if ( dtf.indexOf("+") < 0 ) sp[6] *= -1;
43
- if ( sp[6] < -12 || sp[6] > 13 ) return; // time zone offset hour
44
- if ( sp[7] < 0 || sp[7] > 59 ) return; // time zone offset min
45
- msec -= (sp[6]*60+sp[7]) * 60000;
46
- }
47
-
48
- // set by milli-second;
49
- return this.setTime( msec );
50
- };
51
-
52
- Date.W3CDTF.prototype.getW3CDTF = function() {
53
- var year = this.getFullYear();
54
- var mon = this.getMonth()+1;
55
- var day = this.getDate();
56
- var hour = this.getHours();
57
- var min = this.getMinutes();
58
- var sec = this.getSeconds();
59
-
60
- // time zone
61
- var tzos = this.getTimezoneOffset();
62
- var tzpm = ( tzos > 0 ) ? "-" : "+";
63
- if ( tzos < 0 ) tzos *= -1;
64
- var tzhour = tzos / 60;
65
- var tzmin = tzos % 60;
66
-
67
- // sprintf( "%02d", ... )
68
- if ( mon < 10 ) mon = "0"+mon;
69
- if ( day < 10 ) day = "0"+day;
70
- if ( hour < 10 ) hour = "0"+hour;
71
- if ( min < 10 ) min = "0"+min;
72
- if ( sec < 10 ) sec = "0"+sec;
73
- if ( tzhour < 10 ) tzhour = "0"+tzhour;
74
- if ( tzmin < 10 ) tzmin = "0"+tzmin;
75
- var dtf = year+"-"+mon+"-"+day+"T"+hour+":"+min+":"+sec+tzpm+tzhour+":"+tzmin;
76
- return dtf;
77
- };
78
-
79
- /*
80
-
81
- =head1 NAME
82
-
83
- Date.W3CDTF - W3C Date and Time Formats
84
-
85
- =head1 SYNOPSIS
86
-
87
- var dd = new Date.W3CDTF(); // now
88
- document.write( "getW3CDTF: "+ dd.getW3CDTF() +"\n" );
89
-
90
- dd.setW3CDTF( "2005-04-23T17:20:00+09:00" );
91
- document.write( "toLocaleString: "+ dd.toLocaleString() +"\n" );
92
-
93
- =head1 DESCRIPTION
94
-
95
- This module understands the W3CDTF date/time format, an ISO 8601 profile,
96
- defined by W3C. This format as the native date format of RSS 1.0.
97
- It can be used to parse these formats in order to create the appropriate objects.
98
-
99
- =head1 METHODS
100
-
101
- =head2 new()
102
-
103
- This constructor method creates a new Date object which has
104
- following methods in addition to Date's all native methods.
105
-
106
- =head2 setW3CDTF( "2006-02-15T19:40:00Z" )
107
-
108
- This method parse a W3CDTF datetime string and sets it.
109
-
110
- =head2 getW3CDTF()
111
-
112
- This method returns a W3CDTF datetime string.
113
- Its timezone is always local timezone configured on OS.
114
-
115
- =head1 SEE ALSO
116
-
117
- http://www.w3.org/TR/NOTE-datetime
118
-
119
- =head1 AUTHOR
120
-
121
- Yusuke Kawasaki http://www.kawa.net/
122
-
123
- =head1 COPYRIGHT AND LICENSE
124
-
125
- Copyright (c) 2005-2006 Yusuke Kawasaki. All rights reserved.
126
- This program is free software; you can redistribute it and/or
127
- modify it under the Artistic license. Or whatever license I choose,
128
- which I will do instead of keeping this documentation like it is.
129
-
130
- =cut
131
- */