yard 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

@@ -26,6 +26,29 @@ RSpec.describe YARD::Parser::C::CParser do
26
26
  end
27
27
  end
28
28
 
29
+ describe "C++ namespace" do
30
+ before(:all) do
31
+ file = File.join(File.dirname(__FILE__), 'examples', 'namespace.cpp.txt')
32
+ parse(File.read(file))
33
+ end
34
+
35
+ it "parses Rect class" do
36
+ obj = YARD::Registry.at('Rect')
37
+ expect(obj).not_to be nil
38
+ expect(obj.docstring).not_to be_blank
39
+ end
40
+
41
+ it "parses method inside of namespace" do
42
+ obj = YARD::Registry.at('Rect#inspect')
43
+ expect(obj.docstring).not_to be_blank
44
+ end
45
+
46
+ it "parses method after namespace" do
47
+ obj = YARD::Registry.at('Rect#hello_world')
48
+ expect(obj.docstring).not_to be_blank
49
+ end
50
+ end
51
+
29
52
  describe "Source located in extra files" do
30
53
  before(:all) do
31
54
  @multifile = File.join(File.dirname(__FILE__), 'examples', 'multifile.c.txt')
@@ -0,0 +1,68 @@
1
+ VALUE rb_cWXRect;
2
+
3
+ namespace RubyWX {
4
+ namespace Rect {
5
+
6
+ VALUE _alloc(VALUE self)
7
+ {
8
+ return wrap(new wxRect());
9
+ }
10
+
11
+ /*
12
+ * call-seq:
13
+ * inspect -> String
14
+ *
15
+ * Human-readable description.
16
+ * ===Return value
17
+ * String
18
+ */
19
+ VALUE _inspect(VALUE self)
20
+ {
21
+ return rb_sprintf( "%s(%d, %d, %d, %d)",
22
+ rb_obj_classname( self ),
23
+ FIX2INT(_getX(self)),
24
+ FIX2INT(_getY(self)),
25
+ FIX2INT(_getWidth(self)),
26
+ FIX2INT(_getHeight(self)));
27
+ }
28
+
29
+ } // namespace Rect
30
+ } // namespace RubyWX
31
+
32
+
33
+ /*
34
+ * call-seq:
35
+ * hello_world -> String
36
+ *
37
+ * Human-readable description.
38
+ * ===Return value
39
+ * String
40
+ */
41
+ VALUE _hello_world(VALUE self)
42
+ {
43
+ return rb_sprintf( "%s(%d, %d, %d, %d)",
44
+ rb_obj_classname( self ),
45
+ FIX2INT(_getX(self)),
46
+ FIX2INT(_getY(self)),
47
+ FIX2INT(_getWidth(self)),
48
+ FIX2INT(_getHeight(self)));
49
+ }
50
+
51
+ /* Arrays are ordered, integer-indexed collections of any object.
52
+ * Array indexing starts at 0, as in C or Java. A negative index is
53
+ * assumed to be relative to the end of the array---that is, an index of -1
54
+ * indicates the last element of the array, -2 is the next to last
55
+ * element in the array, and so on.
56
+ */
57
+
58
+ void Init_Rect()
59
+ {
60
+ using namespace RubyWX::Rect;
61
+ rb_cWXRect = rb_define_class("Rect",rb_cObject);
62
+
63
+ rb_define_alloc_func(rb_cWXRect,_alloc);
64
+
65
+ rb_define_method(rb_cWXRect,"inspect",RUBY_METHOD_FUNC(_inspect),0);
66
+ rb_define_method(rb_cWXRect,"hello_world",RUBY_METHOD_FUNC(_hello_world),0);
67
+
68
+ }
@@ -224,7 +224,12 @@ function navExpander() {
224
224
  }
225
225
 
226
226
  function mainFocus() {
227
- $('#main')[0].focus();
227
+ var hash = window.location.hash;
228
+ if (hash !== '' && $(hash)[0]) {
229
+ $(hash)[0].scrollIntoView();
230
+ }
231
+
232
+ setTimeout(function() { $('#main').focus(); }, 10);
228
233
  }
229
234
 
230
235
  $(document).ready(function() {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-13 00:00:00.000000000 Z
11
+ date: 2017-04-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  YARD is a documentation generation tool for the Ruby programming language.
@@ -383,6 +383,7 @@ files:
383
383
  - spec/parser/examples/example1.rb.txt
384
384
  - spec/parser/examples/extrafile.c.txt
385
385
  - spec/parser/examples/multifile.c.txt
386
+ - spec/parser/examples/namespace.cpp.txt
386
387
  - spec/parser/examples/override.c.txt
387
388
  - spec/parser/examples/parse_in_order_001.rb.txt
388
389
  - spec/parser/examples/parse_in_order_002.rb.txt