naether 0.13.4-java → 0.13.5-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1330 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Naether::Java::Ruby
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (R)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Naether.html" title="Naether (module)">Naether</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Java.html" title="Naether::Java (class)">Java</a></span></span>
36
+ &raquo;
37
+ <span class="title">Ruby</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Naether::Java::Ruby
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Naether::Java::Ruby</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/naether/java/ruby.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#class_loader-instance_method" title="#class_loader (instance method)">- (Object) <strong>class_loader</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Returns the value of attribute class_loader.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ <li class="public ">
139
+ <span class="summary_signature">
140
+
141
+ <a href="#loaded_paths-instance_method" title="#loaded_paths (instance method)">- (Object) <strong>loaded_paths</strong> </a>
142
+
143
+
144
+
145
+ </span>
146
+
147
+
148
+
149
+
150
+ <span class="note title readonly">readonly</span>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <span class="summary_desc"><div class='inline'>
161
+ <p>Returns the value of attribute loaded_paths.</p>
162
+ </div></span>
163
+
164
+ </li>
165
+
166
+
167
+ </ul>
168
+
169
+
170
+
171
+
172
+
173
+ <h2>
174
+ Instance Method Summary
175
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
176
+ </h2>
177
+
178
+ <ul class="summary">
179
+
180
+ <li class="public ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#convert_to_java_list-instance_method" title="#convert_to_java_list (instance method)">- (java.util.ArrayList) <strong>convert_to_java_list</strong>(ruby_array) </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'>
198
+ <p>Convert a Ruby Array to a java.util.ArrayList.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#convert_to_ruby_array-instance_method" title="#convert_to_ruby_array (instance method)">- (Array) <strong>convert_to_ruby_array</strong>(java_array, to_string = false) </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'>
222
+ <p>Convert a java,util.List to a Ruby Array.</p>
223
+ </div></span>
224
+
225
+ </li>
226
+
227
+
228
+ <li class="public ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#convert_to_ruby_hash-instance_method" title="#convert_to_ruby_hash (instance method)">- (Hash) <strong>convert_to_ruby_hash</strong>(java_hash, to_string = false) </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+ <span class="summary_desc"><div class='inline'>
246
+ <p>Convert a java.util.Map to a Ruby Hash.</p>
247
+ </div></span>
248
+
249
+ </li>
250
+
251
+
252
+ <li class="public ">
253
+ <span class="summary_signature">
254
+
255
+ <a href="#create-instance_method" title="#create (instance method)">- (Object) <strong>create</strong>(target_class, *args) </a>
256
+
257
+
258
+
259
+ </span>
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+ <span class="summary_desc"><div class='inline'>
270
+ <p>Create a Java Object from the Naether Class Loader.</p>
271
+ </div></span>
272
+
273
+ </li>
274
+
275
+
276
+ <li class="public ">
277
+ <span class="summary_signature">
278
+
279
+ <a href="#exec_static_method-instance_method" title="#exec_static_method (instance method)">- (Object) <strong>exec_static_method</strong>(target_class, target_method, params, types = nil) </a>
280
+
281
+
282
+
283
+ </span>
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ <span class="summary_desc"><div class='inline'>
294
+ <p>Execute a Staic method on a Java class from the Naether Class Loader.</p>
295
+ </div></span>
296
+
297
+ </li>
298
+
299
+
300
+ <li class="public ">
301
+ <span class="summary_signature">
302
+
303
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Ruby) <strong>initialize</strong> </a>
304
+
305
+
306
+
307
+ </span>
308
+
309
+
310
+ <span class="note title constructor">constructor</span>
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+ <span class="summary_desc"><div class='inline'>
320
+ <p>Creates new instance by loading the Naether jar to the parent ClassLoader
321
+ and creating the internal Naether ClassLoader.</p>
322
+ </div></span>
323
+
324
+ </li>
325
+
326
+
327
+ <li class="public ">
328
+ <span class="summary_signature">
329
+
330
+ <a href="#internal_load_paths-instance_method" title="#internal_load_paths (instance method)">- (Object) <strong>internal_load_paths</strong>(paths) </a>
331
+
332
+
333
+
334
+ </span>
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+ <span class="summary_desc"><div class='inline'>
345
+ <p>Load a path into the internal Naether ClassLoader.</p>
346
+ </div></span>
347
+
348
+ </li>
349
+
350
+
351
+ <li class="public ">
352
+ <span class="summary_signature">
353
+
354
+ <a href="#load_paths-instance_method" title="#load_paths (instance method)">- (Object) <strong>load_paths</strong>(paths) </a>
355
+
356
+
357
+
358
+ </span>
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+ <span class="summary_desc"><div class='inline'>
369
+ <p>Load a path onto the parent ClassLoader.</p>
370
+ </div></span>
371
+
372
+ </li>
373
+
374
+
375
+ </ul>
376
+
377
+
378
+ <div id="constructor_details" class="method_details_list">
379
+ <h2>Constructor Details</h2>
380
+
381
+ <div class="method_details first">
382
+ <h3 class="signature first" id="initialize-instance_method">
383
+
384
+ - (<tt><span class='object_link'><a href="" title="Naether::Java::Ruby (class)">Ruby</a></span></tt>) <strong>initialize</strong>
385
+
386
+
387
+
388
+
389
+
390
+ </h3><div class="docstring">
391
+ <div class="discussion">
392
+
393
+ <p>Creates new instance by loading the Naether jar to the parent ClassLoader
394
+ and creating the internal Naether ClassLoader</p>
395
+
396
+
397
+ </div>
398
+ </div>
399
+ <div class="tags">
400
+
401
+
402
+ </div><table class="source_code">
403
+ <tr>
404
+ <td>
405
+ <pre class="lines">
406
+
407
+
408
+ 19
409
+ 20
410
+ 21
411
+ 22
412
+ 23
413
+ 24
414
+ 25
415
+ 26
416
+ 27
417
+ 28
418
+ 29
419
+ 30
420
+ 31
421
+ 32
422
+ 33
423
+ 34
424
+ 35
425
+ 36
426
+ 37
427
+ 38
428
+ 39
429
+ 40
430
+ 41
431
+ 42
432
+ 43
433
+ 44</pre>
434
+ </td>
435
+ <td>
436
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 19</span>
437
+
438
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
439
+ <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rjb</span><span class='tstring_end'>'</span></span>
440
+
441
+ <span class='id identifier rubyid_naether_jar'>naether_jar</span> <span class='op'>=</span> <span class='const'>Naether</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_naether_jar'>naether_jar</span>
442
+
443
+ <span class='comment'># Call Rjb::load with an empty classpath, incase Rjb::load has already been called
444
+ </span> <span class='id identifier rubyid_java_opts'>java_opts</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>JAVA_OPTS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>JAVA_OPTIONS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span>
445
+
446
+ <span class='kw'>begin</span>
447
+ <span class='const'>Rjb</span><span class='op'>::</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_java_opts'>java_opts</span><span class='rparen'>)</span>
448
+ <span class='kw'>rescue</span> <span class='const'>StandardError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
449
+ <span class='kw'>if</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>can't create Java VM</span><span class='tstring_end'>&quot;</span></span>
450
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RJB was unable to find JVM, try setting JAVA_HOME env</span><span class='tstring_end'>&quot;</span></span>
451
+ <span class='kw'>end</span>
452
+ <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
453
+ <span class='kw'>end</span>
454
+
455
+ <span class='ivar'>@loaded_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
456
+ <span class='id identifier rubyid_load_paths'>load_paths</span><span class='lparen'>(</span> <span class='id identifier rubyid_naether_jar'>naether_jar</span> <span class='rparen'>)</span>
457
+
458
+ <span class='id identifier rubyid_class_loader_class'>class_loader_class</span> <span class='op'>=</span> <span class='const'>Rjb</span><span class='op'>::</span><span class='id identifier rubyid_import'>import</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>com.tobedevoured.naether.PathClassLoader</span><span class='tstring_end'>&quot;</span></span> <span class='rparen'>)</span>
459
+ <span class='ivar'>@class_loader</span> <span class='op'>=</span> <span class='id identifier rubyid_class_loader_class'>class_loader_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
460
+
461
+ <span class='id identifier rubyid_internal_load_paths'>internal_load_paths</span><span class='lparen'>(</span> <span class='id identifier rubyid_naether_jar'>naether_jar</span> <span class='rparen'>)</span>
462
+
463
+ <span class='kw'>end</span></pre>
464
+ </td>
465
+ </tr>
466
+ </table>
467
+ </div>
468
+
469
+ </div>
470
+
471
+ <div id="instance_attr_details" class="attr_details">
472
+ <h2>Instance Attribute Details</h2>
473
+
474
+
475
+ <span id=""></span>
476
+ <div class="method_details first">
477
+ <h3 class="signature first" id="class_loader-instance_method">
478
+
479
+ - (<tt>Object</tt>) <strong>class_loader</strong> <span class="extras">(readonly)</span>
480
+
481
+
482
+
483
+
484
+
485
+ </h3><div class="docstring">
486
+ <div class="discussion">
487
+
488
+ <p>Returns the value of attribute class_loader</p>
489
+
490
+
491
+ </div>
492
+ </div>
493
+ <div class="tags">
494
+
495
+
496
+ </div><table class="source_code">
497
+ <tr>
498
+ <td>
499
+ <pre class="lines">
500
+
501
+
502
+ 13
503
+ 14
504
+ 15</pre>
505
+ </td>
506
+ <td>
507
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 13</span>
508
+
509
+ <span class='kw'>def</span> <span class='id identifier rubyid_class_loader'>class_loader</span>
510
+ <span class='ivar'>@class_loader</span>
511
+ <span class='kw'>end</span></pre>
512
+ </td>
513
+ </tr>
514
+ </table>
515
+ </div>
516
+
517
+
518
+ <span id=""></span>
519
+ <div class="method_details ">
520
+ <h3 class="signature " id="loaded_paths-instance_method">
521
+
522
+ - (<tt>Object</tt>) <strong>loaded_paths</strong> <span class="extras">(readonly)</span>
523
+
524
+
525
+
526
+
527
+
528
+ </h3><div class="docstring">
529
+ <div class="discussion">
530
+
531
+ <p>Returns the value of attribute loaded_paths</p>
532
+
533
+
534
+ </div>
535
+ </div>
536
+ <div class="tags">
537
+
538
+
539
+ </div><table class="source_code">
540
+ <tr>
541
+ <td>
542
+ <pre class="lines">
543
+
544
+
545
+ 13
546
+ 14
547
+ 15</pre>
548
+ </td>
549
+ <td>
550
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 13</span>
551
+
552
+ <span class='kw'>def</span> <span class='id identifier rubyid_loaded_paths'>loaded_paths</span>
553
+ <span class='ivar'>@loaded_paths</span>
554
+ <span class='kw'>end</span></pre>
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+
560
+ </div>
561
+
562
+
563
+ <div id="instance_method_details" class="method_details_list">
564
+ <h2>Instance Method Details</h2>
565
+
566
+
567
+ <div class="method_details first">
568
+ <h3 class="signature first" id="convert_to_java_list-instance_method">
569
+
570
+ - (<tt>java.util.ArrayList</tt>) <strong>convert_to_java_list</strong>(ruby_array)
571
+
572
+
573
+
574
+
575
+
576
+ </h3><div class="docstring">
577
+ <div class="discussion">
578
+
579
+ <p>Convert a Ruby Array to a java.util.ArrayList</p>
580
+
581
+
582
+ </div>
583
+ </div>
584
+ <div class="tags">
585
+ <p class="tag_title">Parameters:</p>
586
+ <ul class="param">
587
+
588
+ <li>
589
+
590
+ <span class='name'>ruby_array</span>
591
+
592
+
593
+ <span class='type'>(<tt>Array</tt>)</span>
594
+
595
+
596
+
597
+ &mdash;
598
+ <div class='inline'>
599
+ <p>Array to convert to Java.util.ArrayList</p>
600
+ </div>
601
+
602
+ </li>
603
+
604
+ </ul>
605
+
606
+ <p class="tag_title">Returns:</p>
607
+ <ul class="return">
608
+
609
+ <li>
610
+
611
+
612
+ <span class='type'>(<tt>java.util.ArrayList</tt>)</span>
613
+
614
+
615
+
616
+ </li>
617
+
618
+ </ul>
619
+
620
+ </div><table class="source_code">
621
+ <tr>
622
+ <td>
623
+ <pre class="lines">
624
+
625
+
626
+ 148
627
+ 149
628
+ 150
629
+ 151
630
+ 152
631
+ 153
632
+ 154
633
+ 155</pre>
634
+ </td>
635
+ <td>
636
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 148</span>
637
+
638
+ <span class='kw'>def</span> <span class='id identifier rubyid_convert_to_java_list'>convert_to_java_list</span><span class='lparen'>(</span> <span class='id identifier rubyid_ruby_array'>ruby_array</span> <span class='rparen'>)</span>
639
+ <span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'>Rjb</span><span class='op'>::</span><span class='id identifier rubyid_import'>import</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>java.util.ArrayList</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
640
+ <span class='id identifier rubyid_ruby_array'>ruby_array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
641
+ <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> <span class='id identifier rubyid_item'>item</span> <span class='rparen'>)</span>
642
+ <span class='kw'>end</span>
643
+
644
+ <span class='id identifier rubyid_list'>list</span>
645
+ <span class='kw'>end</span></pre>
646
+ </td>
647
+ </tr>
648
+ </table>
649
+ </div>
650
+
651
+ <div class="method_details ">
652
+ <h3 class="signature " id="convert_to_ruby_array-instance_method">
653
+
654
+ - (<tt>Array</tt>) <strong>convert_to_ruby_array</strong>(java_array, to_string = false)
655
+
656
+
657
+
658
+
659
+
660
+ </h3><div class="docstring">
661
+ <div class="discussion">
662
+
663
+ <p>Convert a java,util.List to a Ruby Array</p>
664
+
665
+
666
+ </div>
667
+ </div>
668
+ <div class="tags">
669
+ <p class="tag_title">Parameters:</p>
670
+ <ul class="param">
671
+
672
+ <li>
673
+
674
+ <span class='name'>java_array</span>
675
+
676
+
677
+ <span class='type'>(<tt>java.util.ArrayList</tt>)</span>
678
+
679
+
680
+
681
+ </li>
682
+
683
+ <li>
684
+
685
+ <span class='name'>to_string</span>
686
+
687
+
688
+ <span class='type'>(<tt>Boolean</tt>)</span>
689
+
690
+
691
+ <em class="default">(defaults to: <tt>false</tt>)</em>
692
+
693
+
694
+ &mdash;
695
+ <div class='inline'>
696
+ <p>converts each element using toString</p>
697
+ </div>
698
+
699
+ </li>
700
+
701
+ </ul>
702
+
703
+ <p class="tag_title">Returns:</p>
704
+ <ul class="return">
705
+
706
+ <li>
707
+
708
+
709
+ <span class='type'>(<tt>Array</tt>)</span>
710
+
711
+
712
+
713
+ </li>
714
+
715
+ </ul>
716
+
717
+ </div><table class="source_code">
718
+ <tr>
719
+ <td>
720
+ <pre class="lines">
721
+
722
+
723
+ 164
724
+ 165
725
+ 166
726
+ 167
727
+ 168
728
+ 169
729
+ 170
730
+ 171
731
+ 172</pre>
732
+ </td>
733
+ <td>
734
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 164</span>
735
+
736
+ <span class='kw'>def</span> <span class='id identifier rubyid_convert_to_ruby_array'>convert_to_ruby_array</span><span class='lparen'>(</span> <span class='id identifier rubyid_java_array'>java_array</span><span class='comma'>,</span> <span class='id identifier rubyid_to_string'>to_string</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='rparen'>)</span>
737
+ <span class='id identifier rubyid_ruby_array'>ruby_array</span> <span class='op'>=</span> <span class='id identifier rubyid_java_array'>java_array</span><span class='period'>.</span><span class='id identifier rubyid_toArray'>toArray</span><span class='lparen'>(</span><span class='rparen'>)</span>
738
+
739
+ <span class='kw'>if</span> <span class='id identifier rubyid_to_string'>to_string</span>
740
+ <span class='id identifier rubyid_ruby_array'>ruby_array</span> <span class='op'>=</span> <span class='id identifier rubyid_ruby_array'>ruby_array</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rbrace'>}</span>
741
+ <span class='kw'>end</span>
742
+
743
+ <span class='id identifier rubyid_ruby_array'>ruby_array</span>
744
+ <span class='kw'>end</span></pre>
745
+ </td>
746
+ </tr>
747
+ </table>
748
+ </div>
749
+
750
+ <div class="method_details ">
751
+ <h3 class="signature " id="convert_to_ruby_hash-instance_method">
752
+
753
+ - (<tt>Hash</tt>) <strong>convert_to_ruby_hash</strong>(java_hash, to_string = false)
754
+
755
+
756
+
757
+
758
+
759
+ </h3><div class="docstring">
760
+ <div class="discussion">
761
+
762
+ <p>Convert a java.util.Map to a Ruby Hash</p>
763
+
764
+
765
+ </div>
766
+ </div>
767
+ <div class="tags">
768
+ <p class="tag_title">Parameters:</p>
769
+ <ul class="param">
770
+
771
+ <li>
772
+
773
+ <span class='name'>java_hash</span>
774
+
775
+
776
+ <span class='type'>(<tt>java.util.Map</tt>)</span>
777
+
778
+
779
+
780
+ </li>
781
+
782
+ <li>
783
+
784
+ <span class='name'>to_string</span>
785
+
786
+
787
+ <span class='type'>(<tt>Boolean</tt>)</span>
788
+
789
+
790
+ <em class="default">(defaults to: <tt>false</tt>)</em>
791
+
792
+
793
+ &mdash;
794
+ <div class='inline'>
795
+ <p>converts each element using toString</p>
796
+ </div>
797
+
798
+ </li>
799
+
800
+ </ul>
801
+
802
+ <p class="tag_title">Returns:</p>
803
+ <ul class="return">
804
+
805
+ <li>
806
+
807
+
808
+ <span class='type'>(<tt>Hash</tt>)</span>
809
+
810
+
811
+
812
+ </li>
813
+
814
+ </ul>
815
+
816
+ </div><table class="source_code">
817
+ <tr>
818
+ <td>
819
+ <pre class="lines">
820
+
821
+
822
+ 181
823
+ 182
824
+ 183
825
+ 184
826
+ 185
827
+ 186
828
+ 187
829
+ 188
830
+ 189
831
+ 190
832
+ 191
833
+ 192
834
+ 193
835
+ 194
836
+ 195
837
+ 196
838
+ 197
839
+ 198
840
+ 199
841
+ 200
842
+ 201
843
+ 202
844
+ 203
845
+ 204
846
+ 205
847
+ 206
848
+ 207
849
+ 208
850
+ 209
851
+ 210</pre>
852
+ </td>
853
+ <td>
854
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 181</span>
855
+
856
+ <span class='kw'>def</span> <span class='id identifier rubyid_convert_to_ruby_hash'>convert_to_ruby_hash</span><span class='lparen'>(</span> <span class='id identifier rubyid_java_hash'>java_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_to_string'>to_string</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='rparen'>)</span>
857
+
858
+ <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
859
+ <span class='kw'>unless</span> <span class='id identifier rubyid_java_hash'>java_hash</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
860
+ <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_java_hash'>java_hash</span><span class='period'>.</span><span class='id identifier rubyid_keySet'>keySet</span><span class='lparen'>(</span><span class='rparen'>)</span>
861
+ <span class='id identifier rubyid_iterator'>iterator</span> <span class='op'>=</span> <span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_iterator'>iterator</span><span class='lparen'>(</span><span class='rparen'>)</span>
862
+ <span class='kw'>if</span> <span class='id identifier rubyid_to_string'>to_string</span>
863
+ <span class='kw'>while</span> <span class='id identifier rubyid_iterator'>iterator</span><span class='period'>.</span><span class='id identifier rubyid_hasNext'>hasNext</span><span class='lparen'>(</span><span class='rparen'>)</span>
864
+ <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_iterator'>iterator</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span>
865
+ <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_java_hash'>java_hash</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span> <span class='id identifier rubyid_key'>key</span> <span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span>
866
+ <span class='kw'>end</span>
867
+ <span class='kw'>else</span>
868
+ <span class='kw'>while</span> <span class='id identifier rubyid_iterator'>iterator</span><span class='period'>.</span><span class='id identifier rubyid_hasNext'>hasNext</span><span class='lparen'>(</span><span class='rparen'>)</span>
869
+ <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_iterator'>iterator</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='lparen'>(</span><span class='rparen'>)</span>
870
+ <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_java_hash'>java_hash</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span> <span class='id identifier rubyid_key'>key</span> <span class='rparen'>)</span>
871
+ <span class='kw'>end</span>
872
+ <span class='kw'>end</span>
873
+ <span class='kw'>else</span>
874
+ <span class='kw'>if</span> <span class='id identifier rubyid_to_string'>to_string</span>
875
+ <span class='id identifier rubyid_java_hash'>java_hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
876
+ <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span>
877
+ <span class='kw'>end</span>
878
+ <span class='kw'>else</span>
879
+ <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_java_hash'>java_hash</span>
880
+ <span class='kw'>end</span>
881
+ <span class='kw'>end</span>
882
+
883
+ <span class='id identifier rubyid_hash'>hash</span>
884
+
885
+ <span class='kw'>end</span></pre>
886
+ </td>
887
+ </tr>
888
+ </table>
889
+ </div>
890
+
891
+ <div class="method_details ">
892
+ <h3 class="signature " id="create-instance_method">
893
+
894
+ - (<tt>Object</tt>) <strong>create</strong>(target_class, *args)
895
+
896
+
897
+
898
+
899
+
900
+ </h3><div class="docstring">
901
+ <div class="discussion">
902
+
903
+ <p>Create a Java Object from the Naether Class Loader</p>
904
+
905
+
906
+ </div>
907
+ </div>
908
+ <div class="tags">
909
+ <p class="tag_title">Parameters:</p>
910
+ <ul class="param">
911
+
912
+ <li>
913
+
914
+ <span class='name'>target_class</span>
915
+
916
+
917
+ <span class='type'>(<tt>String</tt>)</span>
918
+
919
+
920
+
921
+ &mdash;
922
+ <div class='inline'>
923
+ <p>to create</p>
924
+ </div>
925
+
926
+ </li>
927
+
928
+ <li>
929
+
930
+ <span class='name'>args</span>
931
+
932
+
933
+ <span class='type'>(<tt>Array</tt>)</span>
934
+
935
+
936
+
937
+ &mdash;
938
+ <div class='inline'>
939
+ <p>Array of constructor arguments</p>
940
+ </div>
941
+
942
+ </li>
943
+
944
+ </ul>
945
+
946
+
947
+ </div><table class="source_code">
948
+ <tr>
949
+ <td>
950
+ <pre class="lines">
951
+
952
+
953
+ 51
954
+ 52
955
+ 53
956
+ 54
957
+ 55
958
+ 56
959
+ 57
960
+ 58</pre>
961
+ </td>
962
+ <td>
963
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 51</span>
964
+
965
+ <span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span> <span class='rparen'>)</span>
966
+ <span class='comment'>#@class_loader.newInstance(target_class, *args )
967
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;</span> <span class='int'>0</span>
968
+ <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid__invoke'>_invoke</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>newInstance</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Ljava.lang.String;[Ljava.lang.Object;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='rparen'>)</span>
969
+ <span class='kw'>else</span>
970
+ <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid__invoke'>_invoke</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>newInstance</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Ljava.lang.String;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target_class'>target_class</span> <span class='rparen'>)</span>
971
+ <span class='kw'>end</span>
972
+ <span class='kw'>end</span></pre>
973
+ </td>
974
+ </tr>
975
+ </table>
976
+ </div>
977
+
978
+ <div class="method_details ">
979
+ <h3 class="signature " id="exec_static_method-instance_method">
980
+
981
+ - (<tt>Object</tt>) <strong>exec_static_method</strong>(target_class, target_method, params, types = nil)
982
+
983
+
984
+
985
+
986
+
987
+ </h3><div class="docstring">
988
+ <div class="discussion">
989
+
990
+ <p>Execute a Staic method on a Java class from the Naether Class Loader</p>
991
+
992
+
993
+ </div>
994
+ </div>
995
+ <div class="tags">
996
+ <p class="tag_title">Parameters:</p>
997
+ <ul class="param">
998
+
999
+ <li>
1000
+
1001
+ <span class='name'>target_class</span>
1002
+
1003
+
1004
+ <span class='type'>(<tt>String</tt>)</span>
1005
+
1006
+
1007
+
1008
+ </li>
1009
+
1010
+ <li>
1011
+
1012
+ <span class='name'>target_method</span>
1013
+
1014
+
1015
+ <span class='type'>(<tt>String</tt>)</span>
1016
+
1017
+
1018
+
1019
+ </li>
1020
+
1021
+ <li>
1022
+
1023
+ <span class='name'>params</span>
1024
+
1025
+
1026
+ <span class='type'>(<tt>Array</tt>)</span>
1027
+
1028
+
1029
+
1030
+ &mdash;
1031
+ <div class='inline'>
1032
+ <p>Array of method parameters</p>
1033
+ </div>
1034
+
1035
+ </li>
1036
+
1037
+ <li>
1038
+
1039
+ <span class='name'>types</span>
1040
+
1041
+
1042
+ <span class='type'>(<tt>Array</tt>)</span>
1043
+
1044
+
1045
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1046
+
1047
+
1048
+ &mdash;
1049
+ <div class='inline'>
1050
+ <p>if defined, a Array of String classes of params type that lines up with
1051
+ params one to one.</p>
1052
+ </div>
1053
+
1054
+ </li>
1055
+
1056
+ </ul>
1057
+
1058
+ <p class="tag_title">Returns:</p>
1059
+ <ul class="return">
1060
+
1061
+ <li>
1062
+
1063
+
1064
+ <span class='type'>(<tt>Object</tt>)</span>
1065
+
1066
+
1067
+
1068
+ </li>
1069
+
1070
+ </ul>
1071
+
1072
+ </div><table class="source_code">
1073
+ <tr>
1074
+ <td>
1075
+ <pre class="lines">
1076
+
1077
+
1078
+ 68
1079
+ 69
1080
+ 70
1081
+ 71
1082
+ 72
1083
+ 73
1084
+ 74
1085
+ 75
1086
+ 76
1087
+ 77
1088
+ 78
1089
+ 79
1090
+ 80
1091
+ 81
1092
+ 82
1093
+ 83
1094
+ 84
1095
+ 85
1096
+ 86
1097
+ 87
1098
+ 88
1099
+ 89
1100
+ 90
1101
+ 91
1102
+ 92
1103
+ 93
1104
+ 94
1105
+ 95</pre>
1106
+ </td>
1107
+ <td>
1108
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 68</span>
1109
+
1110
+ <span class='kw'>def</span> <span class='id identifier rubyid_exec_static_method'>exec_static_method</span><span class='lparen'>(</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_target_method'>target_method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='comma'>,</span> <span class='id identifier rubyid_types'>types</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
1111
+ <span class='kw'>unless</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
1112
+ <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_params'>params</span><span class='rbracket'>]</span>
1113
+ <span class='kw'>end</span>
1114
+
1115
+ <span class='kw'>if</span> <span class='id identifier rubyid_types'>types</span>
1116
+ <span class='kw'>unless</span> <span class='id identifier rubyid_types'>types</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
1117
+ <span class='id identifier rubyid_types'>types</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_types'>types</span><span class='rbracket'>]</span>
1118
+ <span class='kw'>end</span>
1119
+ <span class='kw'>end</span>
1120
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='kw'>nil</span>
1121
+ <span class='kw'>if</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1122
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid__invoke'>_invoke</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>execStaticMethod</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Ljava.lang.String;Ljava.lang.String;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_target_method'>target_method</span> <span class='rparen'>)</span>
1123
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_types'>types</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1124
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid__invoke'>_invoke</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>execStaticMethod</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Ljava.lang.String;Ljava.lang.String;Ljava.util.List;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_target_method'>target_method</span><span class='comma'>,</span> <span class='id identifier rubyid_convert_to_java_list'>convert_to_java_list</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span> <span class='rparen'>)</span>
1125
+ <span class='kw'>else</span>
1126
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid__invoke'>_invoke</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>execStaticMethod</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Ljava.lang.String;Ljava.lang.String;Ljava.util.List;Ljava.util.List;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_target_method'>target_method</span><span class='comma'>,</span> <span class='id identifier rubyid_convert_to_java_list'>convert_to_java_list</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_convert_to_java_list'>convert_to_java_list</span><span class='lparen'>(</span><span class='id identifier rubyid_types'>types</span><span class='rparen'>)</span> <span class='rparen'>)</span>
1127
+ <span class='kw'>end</span>
1128
+
1129
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1130
+ <span class='comment'># Force toString on java.lang.String otherwise the result will be a Rjb::Proxy
1131
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_getClass'>getClass</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_getName'>getName</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>java.lang.String</span><span class='tstring_end'>'</span></span>
1132
+ <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_toString'>toString</span><span class='lparen'>(</span><span class='rparen'>)</span>
1133
+ <span class='kw'>else</span>
1134
+ <span class='id identifier rubyid_result'>result</span>
1135
+ <span class='kw'>end</span>
1136
+ <span class='kw'>end</span>
1137
+ <span class='kw'>end</span></pre>
1138
+ </td>
1139
+ </tr>
1140
+ </table>
1141
+ </div>
1142
+
1143
+ <div class="method_details ">
1144
+ <h3 class="signature " id="internal_load_paths-instance_method">
1145
+
1146
+ - (<tt>Object</tt>) <strong>internal_load_paths</strong>(paths)
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+ </h3><div class="docstring">
1153
+ <div class="discussion">
1154
+
1155
+ <p>Load a path into the internal Naether ClassLoader</p>
1156
+
1157
+
1158
+ </div>
1159
+ </div>
1160
+ <div class="tags">
1161
+ <p class="tag_title">Parameters:</p>
1162
+ <ul class="param">
1163
+
1164
+ <li>
1165
+
1166
+ <span class='name'>paths</span>
1167
+
1168
+
1169
+ <span class='type'>(<tt>Array</tt>)</span>
1170
+
1171
+
1172
+
1173
+ &mdash;
1174
+ <div class='inline'>
1175
+ <p>as an Array of String paths or a String path</p>
1176
+ </div>
1177
+
1178
+ </li>
1179
+
1180
+ </ul>
1181
+
1182
+
1183
+ </div><table class="source_code">
1184
+ <tr>
1185
+ <td>
1186
+ <pre class="lines">
1187
+
1188
+
1189
+ 102
1190
+ 103
1191
+ 104
1192
+ 105
1193
+ 106
1194
+ 107
1195
+ 108
1196
+ 109
1197
+ 110
1198
+ 111
1199
+ 112
1200
+ 113
1201
+ 114
1202
+ 115
1203
+ 116
1204
+ 117</pre>
1205
+ </td>
1206
+ <td>
1207
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 102</span>
1208
+
1209
+ <span class='kw'>def</span> <span class='id identifier rubyid_internal_load_paths'>internal_load_paths</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
1210
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1211
+ <span class='kw'>unless</span> <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
1212
+ <span class='id identifier rubyid_paths'>paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_paths'>paths</span><span class='rbracket'>]</span>
1213
+ <span class='kw'>end</span>
1214
+
1215
+ <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
1216
+ <span class='id identifier rubyid_expanded_path'>expanded_path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
1217
+ <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span> <span class='rparen'>)</span>
1218
+ <span class='ivar'>@class_loader</span><span class='period'>.</span><span class='id identifier rubyid_addPath'>addPath</span><span class='lparen'>(</span> <span class='id identifier rubyid_path'>path</span> <span class='rparen'>)</span>
1219
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span>
1220
+ <span class='kw'>end</span>
1221
+ <span class='kw'>end</span>
1222
+
1223
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span>
1224
+ <span class='kw'>end</span></pre>
1225
+ </td>
1226
+ </tr>
1227
+ </table>
1228
+ </div>
1229
+
1230
+ <div class="method_details ">
1231
+ <h3 class="signature " id="load_paths-instance_method">
1232
+
1233
+ - (<tt>Object</tt>) <strong>load_paths</strong>(paths)
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+ </h3><div class="docstring">
1240
+ <div class="discussion">
1241
+
1242
+ <p>Load a path onto the parent ClassLoader</p>
1243
+
1244
+
1245
+ </div>
1246
+ </div>
1247
+ <div class="tags">
1248
+ <p class="tag_title">Parameters:</p>
1249
+ <ul class="param">
1250
+
1251
+ <li>
1252
+
1253
+ <span class='name'>paths</span>
1254
+
1255
+
1256
+ <span class='type'>(<tt>Array</tt>)</span>
1257
+
1258
+
1259
+
1260
+ &mdash;
1261
+ <div class='inline'>
1262
+ <p>as an Array of String paths or a String path</p>
1263
+ </div>
1264
+
1265
+ </li>
1266
+
1267
+ </ul>
1268
+
1269
+
1270
+ </div><table class="source_code">
1271
+ <tr>
1272
+ <td>
1273
+ <pre class="lines">
1274
+
1275
+
1276
+ 124
1277
+ 125
1278
+ 126
1279
+ 127
1280
+ 128
1281
+ 129
1282
+ 130
1283
+ 131
1284
+ 132
1285
+ 133
1286
+ 134
1287
+ 135
1288
+ 136
1289
+ 137
1290
+ 138
1291
+ 139
1292
+ 140</pre>
1293
+ </td>
1294
+ <td>
1295
+ <pre class="code"><span class="info file"># File 'lib/naether/java/ruby.rb', line 124</span>
1296
+
1297
+ <span class='kw'>def</span> <span class='id identifier rubyid_load_paths'>load_paths</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
1298
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1299
+ <span class='kw'>unless</span> <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
1300
+ <span class='id identifier rubyid_paths'>paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_paths'>paths</span><span class='rbracket'>]</span>
1301
+ <span class='kw'>end</span>
1302
+
1303
+ <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
1304
+ <span class='id identifier rubyid_expanded_path'>expanded_path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
1305
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@loaded_paths</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_expanded_path'>expanded_path</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span> <span class='rparen'>)</span>
1306
+ <span class='ivar'>@loaded_paths</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span>
1307
+ <span class='const'>Rjb</span><span class='op'>::</span><span class='id identifier rubyid_add_jar'>add_jar</span><span class='lparen'>(</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span> <span class='rparen'>)</span>
1308
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_expanded_path'>expanded_path</span>
1309
+ <span class='kw'>end</span>
1310
+ <span class='kw'>end</span>
1311
+
1312
+ <span class='id identifier rubyid_loadable_paths'>loadable_paths</span>
1313
+ <span class='kw'>end</span></pre>
1314
+ </td>
1315
+ </tr>
1316
+ </table>
1317
+ </div>
1318
+
1319
+ </div>
1320
+
1321
+ </div>
1322
+
1323
+ <div id="footer">
1324
+ Generated on Thu Mar 6 23:10:13 2014 by
1325
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1326
+ 0.8.7.3 (ruby-1.9.3).
1327
+ </div>
1328
+
1329
+ </body>
1330
+ </html>