structured_warnings 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +21 -0
  4. data/History.txt +7 -0
  5. data/README.rdoc +5 -5
  6. data/doc/DeprecatedMethodWarning.html +76 -141
  7. data/doc/DeprecatedSignatureWarning.html +76 -141
  8. data/doc/DeprecationWarning.html +76 -141
  9. data/doc/Dynamic.html +89 -136
  10. data/doc/Object.html +92 -161
  11. data/doc/README_rdoc.html +144 -157
  12. data/doc/StandardWarning.html +76 -141
  13. data/doc/StructuredWarnings.html +95 -157
  14. data/doc/StructuredWarnings/ClassMethods.html +131 -193
  15. data/doc/StructuredWarnings/Kernel.html +146 -198
  16. data/doc/StructuredWarnings/Test.html +71 -150
  17. data/doc/StructuredWarnings/Test/Assertions.html +194 -244
  18. data/doc/StructuredWarnings/Test/Warner.html +138 -201
  19. data/doc/StructuredWarnings/Warner.html +113 -177
  20. data/doc/Test.html +95 -0
  21. data/doc/Test/Unit.html +95 -0
  22. data/doc/Warning.html +276 -338
  23. data/doc/Warning/ClassMethods.html +182 -238
  24. data/doc/created.rid +10 -10
  25. data/doc/css/fonts.css +167 -0
  26. data/doc/css/rdoc.css +590 -0
  27. data/doc/fonts/Lato-Light.ttf +0 -0
  28. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  29. data/doc/fonts/Lato-Regular.ttf +0 -0
  30. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  31. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  32. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  33. data/doc/images/add.png +0 -0
  34. data/doc/images/arrow_up.png +0 -0
  35. data/doc/images/delete.png +0 -0
  36. data/doc/images/tag_blue.png +0 -0
  37. data/doc/images/transparent.png +0 -0
  38. data/doc/index.html +104 -103
  39. data/doc/js/darkfish.js +112 -67
  40. data/doc/js/jquery.js +4 -32
  41. data/doc/js/navigation.js +142 -0
  42. data/doc/js/navigation.js.gz +0 -0
  43. data/doc/js/search.js +109 -0
  44. data/doc/js/search_index.js +1 -0
  45. data/doc/js/search_index.js.gz +0 -0
  46. data/doc/js/searcher.js +228 -0
  47. data/doc/js/searcher.js.gz +0 -0
  48. data/doc/table_of_contents.html +200 -0
  49. data/lib/structured_warnings/dynamic.rb +12 -6
  50. data/lib/structured_warnings/kernel.rb +4 -4
  51. data/structured_warnings.gemspec +5 -1
  52. data/test/structured_warnings_test.rb +63 -9
  53. metadata +84 -43
  54. data/doc/js/quicksearch.js +0 -114
  55. data/doc/js/thickbox-compressed.js +0 -10
  56. data/doc/lib/structured_warnings/dynamic_rb.html +0 -65
  57. data/doc/lib/structured_warnings/kernel_rb.html +0 -52
  58. data/doc/lib/structured_warnings/test/assertions_rb.html +0 -52
  59. data/doc/lib/structured_warnings/test/warner_rb.html +0 -52
  60. data/doc/lib/structured_warnings/test_rb.html +0 -56
  61. data/doc/lib/structured_warnings/warner_rb.html +0 -52
  62. data/doc/lib/structured_warnings/warning_rb.html +0 -64
  63. data/doc/lib/structured_warnings_rb.html +0 -62
  64. data/doc/rdoc.css +0 -763
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/doc/index.html CHANGED
@@ -1,120 +1,121 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1
+ <!DOCTYPE html>
4
2
 
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
+ <html>
6
4
  <head>
7
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ <meta charset="UTF-8">
8
6
 
9
- <title>structured_warnings</title>
7
+ <title>structured_warnings</title>
10
8
 
11
- <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ </script>
12
12
 
13
- <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
14
- <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
15
- <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
16
- <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/jquery.js"></script>
14
+ <script src="./js/darkfish.js"></script>
17
15
 
18
- </head>
19
- <body class="indexpage">
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
20
18
 
21
-
22
- <h1>structured_warnings</h1>
23
19
 
24
-
25
- <p>This is the API documentation for 'structured_warnings'.</p>
26
-
27
20
 
21
+ <body id="top" role="document" class="file">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="./index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="./table_of_contents.html#pages">Pages</a>
31
+ <a href="./table_of_contents.html#classes">Classes</a>
32
+ <a href="./table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+
37
+ <div id="search-section" role="search" class="project-section initially-hidden">
38
+ <form action="#" method="get" accept-charset="utf-8">
39
+ <div id="search-field-wrapper">
40
+ <input id="search-field" role="combobox" aria-label="Search"
41
+ aria-autocomplete="list" aria-controls="search-results"
42
+ type="text" name="search" placeholder="Search" spellcheck="false"
43
+ title="Type to search, Up and Down to navigate, Enter to load">
44
+ </div>
45
+
46
+ <ul id="search-results" aria-label="Search Results"
47
+ aria-busy="false" aria-expanded="false"
48
+ aria-atomic="false" class="initially-hidden"></ul>
49
+ </form>
50
+ </div>
51
+
52
+ </div>
53
+
54
+ <div id="project-metadata">
55
+ <div id="fileindex-section" class="nav-section">
56
+ <h3>Pages</h3>
57
+
58
+ <ul class="link-list">
28
59
 
60
+ <li><a href="./README_rdoc.html">README</a>
29
61
 
30
- <h2>Files</h2>
31
- <ul>
32
-
33
- <li class="file"><a href="README_rdoc.html">README.rdoc</a></li>
34
-
35
62
  </ul>
36
-
63
+ </div>
37
64
 
38
- <h2 id="classes">Classes/Modules</h2>
39
- <ul>
40
-
41
- <li class="module"><a href="StructuredWarnings.html">StructuredWarnings</a></li>
42
-
43
- <li class="module"><a href="StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
44
-
45
- <li class="module"><a href="StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
46
-
47
- <li class="module"><a href="StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
48
-
49
- <li class="module"><a href="StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
50
-
51
- <li class="class"><a href="StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
52
-
53
- <li class="class"><a href="StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
54
-
55
- <li class="class"><a href="Warning.html">Warning</a></li>
56
-
57
- <li class="module"><a href="Warning/ClassMethods.html">Warning::ClassMethods</a></li>
58
-
59
- <li class="class"><a href="DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
60
-
61
- <li class="class"><a href="DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
62
-
63
- <li class="class"><a href="DeprecationWarning.html">DeprecationWarning</a></li>
64
-
65
- <li class="module"><a href="Dynamic.html">Dynamic</a></li>
66
-
67
- <li class="class"><a href="Object.html">Object</a></li>
68
-
69
- <li class="class"><a href="StandardWarning.html">StandardWarning</a></li>
70
-
71
- </ul>
65
+ <div id="classindex-section" class="nav-section">
66
+ <h3>Class and Module Index</h3>
72
67
 
73
- <h2 id="methods">Methods</h2>
74
- <ul>
75
-
76
- <li><a href="Warning.html#method-c-new">::new &mdash; Warning</a></li>
77
-
78
- <li><a href="Warning/ClassMethods.html#method-i-active-3F">#active? &mdash; Warning::ClassMethods</a></li>
79
-
80
- <li><a href="StructuredWarnings/Test/Assertions.html#method-i-assert_no_warn">#assert_no_warn &mdash; StructuredWarnings::Test::Assertions</a></li>
81
-
82
- <li><a href="StructuredWarnings/Test/Assertions.html#method-i-assert_warn">#assert_warn &mdash; StructuredWarnings::Test::Assertions</a></li>
83
-
84
- <li><a href="Warning.html#method-i-backtrace">#backtrace &mdash; Warning</a></li>
85
-
86
- <li><a href="Warning/ClassMethods.html#method-i-disable">#disable &mdash; Warning::ClassMethods</a></li>
87
-
88
- <li><a href="Warning/ClassMethods.html#method-i-enable">#enable &mdash; Warning::ClassMethods</a></li>
89
-
90
- <li><a href="StructuredWarnings/Warner.html#method-i-format">#format &mdash; StructuredWarnings::Warner</a></li>
91
-
92
- <li><a href="StructuredWarnings/Test/Warner.html#method-i-format">#format &mdash; StructuredWarnings::Test::Warner</a></li>
93
-
94
- <li><a href="Warning.html#method-i-inspect">#inspect &mdash; Warning</a></li>
95
-
96
- <li><a href="Warning.html#method-i-message">#message &mdash; Warning</a></li>
97
-
98
- <li><a href="Warning.html#method-i-set_backtrace">#set_backtrace &mdash; Warning</a></li>
99
-
100
- <li><a href="Warning.html#method-i-to_s">#to_s &mdash; Warning</a></li>
101
-
102
- <li><a href="Warning.html#method-i-to_str">#to_str &mdash; Warning</a></li>
103
-
104
- <li><a href="StructuredWarnings/Kernel.html#method-i-warn">#warn &mdash; StructuredWarnings::Kernel</a></li>
105
-
106
- <li><a href="StructuredWarnings/Test/Warner.html#method-i-warned-3F">#warned? &mdash; StructuredWarnings::Test::Warner</a></li>
107
-
108
- <li><a href="StructuredWarnings/ClassMethods.html#method-i-warner">#warner &mdash; StructuredWarnings::ClassMethods</a></li>
109
-
110
- <li><a href="StructuredWarnings/ClassMethods.html#method-i-with_warner">#with_warner &mdash; StructuredWarnings::ClassMethods</a></li>
111
-
68
+ <ul class="link-list">
69
+
70
+ <li><a href="./DeprecatedMethodWarning.html">DeprecatedMethodWarning</a>
71
+
72
+ <li><a href="./DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a>
73
+
74
+ <li><a href="./DeprecationWarning.html">DeprecationWarning</a>
75
+
76
+ <li><a href="./Dynamic.html">Dynamic</a>
77
+
78
+ <li><a href="./Object.html">Object</a>
79
+
80
+ <li><a href="./StandardWarning.html">StandardWarning</a>
81
+
82
+ <li><a href="./StructuredWarnings.html">StructuredWarnings</a>
83
+
84
+ <li><a href="./StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a>
85
+
86
+ <li><a href="./StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a>
87
+
88
+ <li><a href="./StructuredWarnings/Test.html">StructuredWarnings::Test</a>
89
+
90
+ <li><a href="./StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a>
91
+
92
+ <li><a href="./StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a>
93
+
94
+ <li><a href="./StructuredWarnings/Warner.html">StructuredWarnings::Warner</a>
95
+
96
+ <li><a href="./Test.html">Test</a>
97
+
98
+ <li><a href="./Test/Unit.html">Test::Unit</a>
99
+
100
+ <li><a href="./Warning.html">Warning</a>
101
+
102
+ <li><a href="./Warning/ClassMethods.html">Warning::ClassMethods</a>
103
+
112
104
  </ul>
105
+ </div>
113
106
 
114
- <div id="validator-badges">
115
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
116
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
117
- Rdoc Generator</a> 2</small>.</p>
118
107
  </div>
119
- </body>
120
- </html>
108
+ </nav>
109
+
110
+ <main role="main">
111
+ <p>This is the API documentation for structured_warnings.
112
+ </main>
113
+
114
+
115
+
116
+ <footer id="validator-badges" role="contentinfo">
117
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
118
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
119
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
120
+ </footer>
121
+
data/doc/js/darkfish.js CHANGED
@@ -9,12 +9,12 @@
9
9
 
10
10
  /* Provide console simulation for firebug-less environments */
11
11
  if (!("console" in window) || !("firebug" in console)) {
12
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
12
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
13
13
  "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
14
14
 
15
- window.console = {};
16
- for (var i = 0; i < names.length; ++i)
17
- window.console[names[i]] = function() {};
15
+ window.console = {};
16
+ for (var i = 0; i < names.length; ++i)
17
+ window.console[names[i]] = function() {};
18
18
  };
19
19
 
20
20
 
@@ -23,94 +23,139 @@ if (!("console" in window) || !("firebug" in console)) {
23
23
  */
24
24
  $.fn.unwrap = function( expr ) {
25
25
  return this.each( function() {
26
- $(this).parents( expr ).eq( 0 ).after( this ).remove();
26
+ $(this).parents( expr ).eq( 0 ).after( this ).remove();
27
27
  });
28
28
  };
29
29
 
30
30
 
31
31
  function showSource( e ) {
32
- var target = e.target;
33
- var codeSections = $(target).
34
- parents('.method-detail').
35
- find('.method-source-code');
36
-
37
- $(target).
38
- parents('.method-detail').
39
- find('.method-source-code').
40
- slideToggle();
32
+ var target = e.target;
33
+ var codeSections = $(target).
34
+ parents('.method-detail').
35
+ find('.method-source-code');
36
+
37
+ $(target).
38
+ parents('.method-detail').
39
+ find('.method-source-code').
40
+ slideToggle();
41
41
  };
42
42
 
43
43
  function hookSourceViews() {
44
- $('.method-description,.method-heading').click( showSource );
44
+ $('.method-heading').click( showSource );
45
45
  };
46
46
 
47
- function toggleDebuggingSection() {
48
- $('.debugging-section').slideToggle();
49
- };
47
+ function hookSearch() {
48
+ var input = $('#search-field').eq(0);
49
+ var result = $('#search-results').eq(0);
50
+ $(result).show();
50
51
 
51
- function hookDebuggingToggle() {
52
- $('#debugging-toggle img').click( toggleDebuggingSection );
53
- };
52
+ var search_section = $('#search-section').get(0);
53
+ $(search_section).show();
54
+
55
+ var search = new Search(search_data, input, result);
56
+
57
+ search.renderItem = function(result) {
58
+ var li = document.createElement('li');
59
+ var html = '';
60
+
61
+ // TODO add relative path to <script> per-page
62
+ html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
63
+ if (result.params)
64
+ html += '<span class="params">' + result.params + '</span>';
65
+ html += '</a>';
66
+
67
+
68
+ if (result.namespace)
69
+ html += '<p class="search-namespace">' + this.hlt(result.namespace);
70
+
71
+ if (result.snippet)
72
+ html += '<div class="search-snippet">' + result.snippet + '</div>';
54
73
 
55
- function hookQuickSearch() {
56
- $('.quicksearch-field').each( function() {
57
- var searchElems = $(this).parents('.section').find( 'li' );
58
- var toggle = $(this).parents('.section').find('h3 .search-toggle');
59
- // console.debug( "Toggle is: %o", toggle );
60
- var qsbox = $(this).parents('form').get( 0 );
61
-
62
- $(this).quicksearch( this, searchElems, {
63
- noSearchResultsIndicator: 'no-class-search-results',
64
- focusOnLoad: false
65
- });
66
- $(toggle).click( function() {
67
- // console.debug( "Toggling qsbox: %o", qsbox );
68
- $(qsbox).toggle();
69
- });
70
- });
74
+ li.innerHTML = html;
75
+
76
+ return li;
77
+ }
78
+
79
+ search.select = function(result) {
80
+ var result_element = result.get(0);
81
+ window.location.href = result_element.firstChild.firstChild.href;
82
+ }
83
+
84
+ search.scrollIntoView = search.scrollInWindow;
71
85
  };
72
86
 
73
87
  function highlightTarget( anchor ) {
74
- console.debug( "Highlighting target '%s'.", anchor );
75
-
76
- $("a[name=" + anchor + "]").each( function() {
77
- if ( !$(this).parent().parent().hasClass('target-section') ) {
78
- console.debug( "Wrapping the target-section" );
79
- $('div.method-detail').unwrap( 'div.target-section' );
80
- $(this).parent().wrap( '<div class="target-section"></div>' );
81
- } else {
82
- console.debug( "Already wrapped." );
83
- }
84
- });
88
+ console.debug( "Highlighting target '%s'.", anchor );
89
+
90
+ $("a[name]").each( function() {
91
+ if ( $(this).attr("name") == anchor ) {
92
+ if ( !$(this).parent().parent().hasClass('target-section') ) {
93
+ console.debug( "Wrapping the target-section" );
94
+ $('div.method-detail').unwrap( 'div.target-section' );
95
+ $(this).parent().wrap( '<div class="target-section"></div>' );
96
+ } else {
97
+ console.debug( "Already wrapped." );
98
+ }
99
+ }
100
+ });
85
101
  };
86
102
 
87
103
  function highlightLocationTarget() {
88
- console.debug( "Location hash: %s", window.location.hash );
89
- if ( ! window.location.hash || window.location.hash.length == 0 ) return;
104
+ console.debug( "Location hash: %s", window.location.hash );
105
+ if ( ! window.location.hash || window.location.hash.length == 0 ) return;
90
106
 
91
- var anchor = window.location.hash.substring(1);
92
- console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
107
+ var anchor = window.location.hash.substring(1);
108
+ console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
93
109
 
94
- highlightTarget( anchor );
110
+ highlightTarget( anchor );
95
111
  };
96
112
 
97
113
  function highlightClickTarget( event ) {
98
- console.debug( "Highlighting click target for event %o", event.target );
99
- try {
100
- var anchor = $(event.target).attr( 'href' ).substring(1);
101
- console.debug( "Found target anchor: %s", anchor );
102
- highlightTarget( anchor );
103
- } catch ( err ) {
104
- console.error( "Exception while highlighting: %o", err );
105
- };
114
+ console.debug( "Highlighting click target for event %o", event.target );
115
+ try {
116
+ var anchor = $(event.target).attr( 'href' ).substring(1);
117
+ console.debug( "Found target anchor: %s", anchor );
118
+ highlightTarget( anchor );
119
+ } catch ( err ) {
120
+ console.error( "Exception while highlighting: %o", err );
121
+ };
106
122
  };
107
123
 
124
+ function loadAsync(path, success) {
125
+ $.ajax({
126
+ url: rdoc_rel_prefix + path,
127
+ dataType: 'script',
128
+ success: success,
129
+ cache: true
130
+ });
131
+ };
108
132
 
109
133
  $(document).ready( function() {
110
- hookSourceViews();
111
- hookDebuggingToggle();
112
- hookQuickSearch();
113
- highlightLocationTarget();
114
-
115
- $('ul.link-list a').bind( "click", highlightClickTarget );
134
+ hookSourceViews();
135
+ highlightLocationTarget();
136
+ $('ul.link-list a').bind( "click", highlightClickTarget );
137
+
138
+ var search_scripts_loaded = {
139
+ navigation_loaded: false,
140
+ search_loaded: false,
141
+ search_index_loaded: false,
142
+ searcher_loaded: false,
143
+ }
144
+
145
+ var search_success_function = function(variable) {
146
+ return (function (data, status, xhr) {
147
+ search_scripts_loaded[variable] = true;
148
+
149
+ if (search_scripts_loaded['navigation_loaded'] == true &&
150
+ search_scripts_loaded['search_loaded'] == true &&
151
+ search_scripts_loaded['search_index_loaded'] == true &&
152
+ search_scripts_loaded['searcher_loaded'] == true)
153
+ hookSearch();
154
+ });
155
+ }
156
+
157
+ loadAsync('js/navigation.js', search_success_function('navigation_loaded'));
158
+ loadAsync('js/search.js', search_success_function('search_loaded'));
159
+ loadAsync('js/search_index.js', search_success_function('search_index_loaded'));
160
+ loadAsync('js/searcher.js', search_success_function('searcher_loaded'));
116
161
  });