tool-shed 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Gemfile +9 -0
  2. data/LICENSE +20 -0
  3. data/README.md +52 -0
  4. data/bin/as-asset-detector +16 -0
  5. data/bin/as-class-detector +16 -0
  6. data/bin/as-docp +16 -0
  7. data/bin/as-manifest +16 -0
  8. data/bin/as-style-detector +16 -0
  9. data/coverage/unit/index.html +330 -0
  10. data/coverage/unit/jquery-1.3.2.min.js +19 -0
  11. data/coverage/unit/jquery.tablesorter.min.js +15 -0
  12. data/coverage/unit/lib-hel-asdoc_package_rb.html +447 -0
  13. data/coverage/unit/lib-hel-manifest_rb.html +555 -0
  14. data/coverage/unit/lib-hel-opts-asdoc_package_opts_rb.html +195 -0
  15. data/coverage/unit/lib-hel-opts-manifest_opts_rb.html +195 -0
  16. data/coverage/unit/lib-hel-opts-tool_opts_rb.html +531 -0
  17. data/coverage/unit/lib-hel-opts-unused_class_opts_rb.html +207 -0
  18. data/coverage/unit/lib-hel-opts-unused_style_opts_rb.html +201 -0
  19. data/coverage/unit/lib-hel-project_tools_rb.html +423 -0
  20. data/coverage/unit/lib-hel-search_rb.html +363 -0
  21. data/coverage/unit/lib-hel-stripper_rb.html +357 -0
  22. data/coverage/unit/lib-hel-tool_rb.html +423 -0
  23. data/coverage/unit/lib-hel-unused_class_rb.html +675 -0
  24. data/coverage/unit/lib-hel-unused_style_rb.html +747 -0
  25. data/coverage/unit/lib-hel-version_rb.html +135 -0
  26. data/coverage/unit/lib-hel_tools_rb.html +165 -0
  27. data/coverage/unit/print.css +12 -0
  28. data/coverage/unit/rcov.js +42 -0
  29. data/coverage/unit/screen.css +270 -0
  30. data/coverage.data +0 -0
  31. data/lib/shed/asdoc_package.rb +64 -0
  32. data/lib/shed/manifest.rb +82 -0
  33. data/lib/shed/opts/asdoc_package_opts.rb +22 -0
  34. data/lib/shed/opts/manifest_opts.rb +22 -0
  35. data/lib/shed/opts/tool_opts.rb +114 -0
  36. data/lib/shed/opts/unused_asset_opts.rb +24 -0
  37. data/lib/shed/opts/unused_class_opts.rb +24 -0
  38. data/lib/shed/opts/unused_style_opts.rb +23 -0
  39. data/lib/shed/project_tools.rb +60 -0
  40. data/lib/shed/search.rb +50 -0
  41. data/lib/shed/stripper.rb +49 -0
  42. data/lib/shed/tool.rb +60 -0
  43. data/lib/shed/unused_asset.rb +68 -0
  44. data/lib/shed/unused_class.rb +102 -0
  45. data/lib/shed/unused_style.rb +114 -0
  46. data/lib/shed/version.rb +12 -0
  47. data/lib/tool_shed.rb +19 -0
  48. data/rakefile.rb +109 -0
  49. data/rdoc/classes/ASDocPackage.html +281 -0
  50. data/rdoc/classes/ASDocPackageOpts.html +204 -0
  51. data/rdoc/classes/Manifest.html +323 -0
  52. data/rdoc/classes/ManifestOpts.html +205 -0
  53. data/rdoc/classes/ProjectTools.html +302 -0
  54. data/rdoc/classes/Search.html +203 -0
  55. data/rdoc/classes/Stripper.html +223 -0
  56. data/rdoc/classes/Tool.html +313 -0
  57. data/rdoc/classes/ToolOpts.html +297 -0
  58. data/rdoc/classes/UnusedClass.html +258 -0
  59. data/rdoc/classes/UnusedClassOpts.html +206 -0
  60. data/rdoc/classes/UnusedStyle.html +277 -0
  61. data/rdoc/classes/UnusedStyleOpts.html +205 -0
  62. data/rdoc/created.rid +1 -0
  63. data/rdoc/files/LICENSE.html +129 -0
  64. data/rdoc/files/README_md.html +138 -0
  65. data/rdoc/files/lib/hel/asdoc_package_rb.html +107 -0
  66. data/rdoc/files/lib/hel/manifest_rb.html +107 -0
  67. data/rdoc/files/lib/hel/opts/asdoc_package_opts_rb.html +107 -0
  68. data/rdoc/files/lib/hel/opts/manifest_opts_rb.html +107 -0
  69. data/rdoc/files/lib/hel/opts/tool_opts_rb.html +114 -0
  70. data/rdoc/files/lib/hel/opts/unused_class_opts_rb.html +107 -0
  71. data/rdoc/files/lib/hel/opts/unused_style_opts_rb.html +107 -0
  72. data/rdoc/files/lib/hel/project_tools_rb.html +107 -0
  73. data/rdoc/files/lib/hel/search_rb.html +114 -0
  74. data/rdoc/files/lib/hel/stripper_rb.html +107 -0
  75. data/rdoc/files/lib/hel/tool_rb.html +107 -0
  76. data/rdoc/files/lib/hel/unused_class_rb.html +107 -0
  77. data/rdoc/files/lib/hel/unused_style_rb.html +107 -0
  78. data/rdoc/files/lib/hel/version_rb.html +107 -0
  79. data/rdoc/files/lib/hel_tools_rb.html +127 -0
  80. data/rdoc/fr_class_index.html +39 -0
  81. data/rdoc/fr_file_index.html +43 -0
  82. data/rdoc/fr_method_index.html +75 -0
  83. data/rdoc/index.html +24 -0
  84. data/rdoc/rdoc-style.css +208 -0
  85. data/test/fixtures/search/App.mxml +0 -0
  86. data/test/fixtures/search/hide/Hidden.as +0 -0
  87. data/test/fixtures/search/org/helvector/Main.as +0 -0
  88. data/test/fixtures/src/org/helvector/Helvector.as +16 -0
  89. data/test/fixtures/src/org/helvector/one/HelOne.as +14 -0
  90. data/test/fixtures/src/org/helvector/one/HelOneTwo.mxml +0 -0
  91. data/test/fixtures/src/org/helvector/one/package.asdoc +1 -0
  92. data/test/fixtures/src/org/helvector/package.asdoc +1 -0
  93. data/test/fixtures/src/org/helvector/three/HelThree.as +14 -0
  94. data/test/fixtures/src/org/helvector/three/package.asdoc +1 -0
  95. data/test/fixtures/src/org/helvector/two/HelTwo.as +14 -0
  96. data/test/fixtures/src/org/helvector/two/package.asdoc +1 -0
  97. data/test/fixtures/unused-asset/assets/css/referenced.css +0 -0
  98. data/test/fixtures/unused-asset/assets/css/un-referenced.css +0 -0
  99. data/test/fixtures/unused-asset/assets/fonts/referenced.otf +0 -0
  100. data/test/fixtures/unused-asset/assets/fonts/un-referenced.otf +0 -0
  101. data/test/fixtures/unused-asset/assets/img/referenced.jpg +0 -0
  102. data/test/fixtures/unused-asset/assets/img/referenced.png +0 -0
  103. data/test/fixtures/unused-asset/assets/img/un-referenced.jpg +0 -0
  104. data/test/fixtures/unused-asset/assets/img/un-referenced.png +0 -0
  105. data/test/fixtures/unused-asset/src/org/helvector/ToolShed.as +30 -0
  106. data/test/fixtures/unused-cla/link-report.xml +17 -0
  107. data/test/fixtures/unused-cla/manifest.xml +6 -0
  108. data/test/fixtures/unused-cla/src/Unused.as +0 -0
  109. data/test/fixtures/unused-cla/src/Used.as +0 -0
  110. data/test/fixtures/unused-css/css/styles.css +2 -0
  111. data/test/fixtures/unused-css/css-multiple/more.css +2 -0
  112. data/test/fixtures/unused-css/css-multiple/styles.css +2 -0
  113. data/test/fixtures/unused-css/css-with-comments/commented.css +6 -0
  114. data/test/fixtures/unused-css/src/CSSApp.mxml +5 -0
  115. data/test/test_helper.rb +9 -0
  116. data/test/unit/test_asdoc_package.rb +72 -0
  117. data/test/unit/test_asdoc_package_opts.rb +28 -0
  118. data/test/unit/test_manifest.rb +53 -0
  119. data/test/unit/test_manifest_opts.rb +28 -0
  120. data/test/unit/test_search.rb +67 -0
  121. data/test/unit/test_source_tools.rb +97 -0
  122. data/test/unit/test_stripper.rb +56 -0
  123. data/test/unit/test_tool.rb +73 -0
  124. data/test/unit/test_tool_opts.rb +81 -0
  125. data/test/unit/test_unused_asset.rb +59 -0
  126. data/test/unit/test_unused_asset_opts.rb +32 -0
  127. data/test/unit/test_unused_class.rb +50 -0
  128. data/test/unit/test_unused_class_opts.rb +32 -0
  129. data/test/unit/test_unused_style.rb +103 -0
  130. data/test/unit/test_unused_style_opts.rb +31 -0
  131. data/tool-shed-0.0.3.gem +0 -0
  132. data/tool-shed.gemspec +41 -0
  133. metadata +265 -0
@@ -0,0 +1,205 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: ManifestOpts</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">ManifestOpts</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/hel/opts/manifest_opts_rb.html">
59
+ lib/hel/opts/manifest_opts.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="ToolOpts.html">
69
+ ToolOpts
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ Manages the command line interface for the AS3 <a
86
+ href="Manifest.html">Manifest</a> File generation tool.
87
+ </p>
88
+
89
+ </div>
90
+
91
+
92
+ </div>
93
+
94
+ <div id="method-list">
95
+ <h3 class="section-bar">Methods</h3>
96
+
97
+ <div class="name-list">
98
+ <a href="#M000036">default_config</a>&nbsp;&nbsp;
99
+ <a href="#M000034">description</a>&nbsp;&nbsp;
100
+ <a href="#M000035">name</a>&nbsp;&nbsp;
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+
106
+
107
+ <!-- if includes -->
108
+
109
+ <div id="section">
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <!-- if method_list -->
119
+ <div id="methods">
120
+ <h3 class="section-bar">Public Class methods</h3>
121
+
122
+ <div id="method-M000036" class="method-detail">
123
+ <a name="M000036"></a>
124
+
125
+ <div class="method-heading">
126
+ <a href="#M000036" class="method-signature">
127
+ <span class="method-name">default_config</span><span class="method-args">()</span>
128
+ </a>
129
+ </div>
130
+
131
+ <div class="method-description">
132
+ <p><a class="source-toggle" href="#"
133
+ onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
134
+ <div class="method-source-code" id="M000036-source">
135
+ <pre>
136
+ <span class="ruby-comment cmt"># File lib/hel/opts/manifest_opts.rb, line 16</span>
137
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_config</span>
138
+ <span class="ruby-identifier">dc</span> = <span class="ruby-identifier">superclass</span>.<span class="ruby-identifier">default_config</span>
139
+ <span class="ruby-identifier">dc</span>[<span class="ruby-identifier">:output</span>] = <span class="ruby-value str">&quot;manifest.xml&quot;</span>
140
+ <span class="ruby-identifier">dc</span>
141
+ <span class="ruby-keyword kw">end</span>
142
+ </pre>
143
+ </div>
144
+ </div>
145
+ </div>
146
+
147
+ <div id="method-M000034" class="method-detail">
148
+ <a name="M000034"></a>
149
+
150
+ <div class="method-heading">
151
+ <a href="#M000034" class="method-signature">
152
+ <span class="method-name">description</span><span class="method-args">()</span>
153
+ </a>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <p><a class="source-toggle" href="#"
158
+ onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
159
+ <div class="method-source-code" id="M000034-source">
160
+ <pre>
161
+ <span class="ruby-comment cmt"># File lib/hel/opts/manifest_opts.rb, line 8</span>
162
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">description</span>
163
+ <span class="ruby-value str">&quot;Helvector ActionScript Manifest Generator Tool&quot;</span>
164
+ <span class="ruby-keyword kw">end</span>
165
+ </pre>
166
+ </div>
167
+ </div>
168
+ </div>
169
+
170
+ <div id="method-M000035" class="method-detail">
171
+ <a name="M000035"></a>
172
+
173
+ <div class="method-heading">
174
+ <a href="#M000035" class="method-signature">
175
+ <span class="method-name">name</span><span class="method-args">()</span>
176
+ </a>
177
+ </div>
178
+
179
+ <div class="method-description">
180
+ <p><a class="source-toggle" href="#"
181
+ onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
182
+ <div class="method-source-code" id="M000035-source">
183
+ <pre>
184
+ <span class="ruby-comment cmt"># File lib/hel/opts/manifest_opts.rb, line 12</span>
185
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>
186
+ <span class="ruby-value str">&quot;hel-manifest&quot;</span>
187
+ <span class="ruby-keyword kw">end</span>
188
+ </pre>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+
194
+ </div>
195
+
196
+
197
+ </div>
198
+
199
+
200
+ <div id="validator-badges">
201
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
202
+ </div>
203
+
204
+ </body>
205
+ </html>
@@ -0,0 +1,302 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: ProjectTools</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">ProjectTools</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/hel/project_tools_rb.html">
59
+ lib/hel/project_tools.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ A collection of utility methods to help working with ActionScript source.
84
+ </p>
85
+
86
+ </div>
87
+
88
+
89
+ </div>
90
+
91
+ <div id="method-list">
92
+ <h3 class="section-bar">Methods</h3>
93
+
94
+ <div class="name-list">
95
+ <a href="#M000028">common_src_dirs</a>&nbsp;&nbsp;
96
+ <a href="#M000033">flex_file_regx</a>&nbsp;&nbsp;
97
+ <a href="#M000032">import</a>&nbsp;&nbsp;
98
+ <a href="#M000031">package</a>&nbsp;&nbsp;
99
+ <a href="#M000030">remove_relative_prefix</a>&nbsp;&nbsp;
100
+ <a href="#M000029">truncate_to_src</a>&nbsp;&nbsp;
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+
106
+
107
+ <!-- if includes -->
108
+
109
+ <div id="section">
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <!-- if method_list -->
119
+ <div id="methods">
120
+ <h3 class="section-bar">Public Class methods</h3>
121
+
122
+ <div id="method-M000028" class="method-detail">
123
+ <a name="M000028"></a>
124
+
125
+ <div class="method-heading">
126
+ <a href="#M000028" class="method-signature">
127
+ <span class="method-name">common_src_dirs</span><span class="method-args">()</span>
128
+ </a>
129
+ </div>
130
+
131
+ <div class="method-description">
132
+ <p>
133
+ Returns an array of directory names that are commonly used as the root
134
+ directory for source files.
135
+ </p>
136
+ <p><a class="source-toggle" href="#"
137
+ onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
138
+ <div class="method-source-code" id="M000028-source">
139
+ <pre>
140
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 12</span>
141
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">common_src_dirs</span>
142
+ [<span class="ruby-value str">'src'</span>,<span class="ruby-value str">'source'</span>,<span class="ruby-value str">'test'</span>,<span class="ruby-value str">'lib'</span>]
143
+ <span class="ruby-keyword kw">end</span>
144
+ </pre>
145
+ </div>
146
+ </div>
147
+ </div>
148
+
149
+ <div id="method-M000033" class="method-detail">
150
+ <a name="M000033"></a>
151
+
152
+ <div class="method-heading">
153
+ <a href="#M000033" class="method-signature">
154
+ <span class="method-name">flex_file_regx</span><span class="method-args">()</span>
155
+ </a>
156
+ </div>
157
+
158
+ <div class="method-description">
159
+ <p>
160
+ Regular expression to match files we expect to find in a ActionScript/Flex
161
+ project.
162
+ </p>
163
+ <p><a class="source-toggle" href="#"
164
+ onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
165
+ <div class="method-source-code" id="M000033-source">
166
+ <pre>
167
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 56</span>
168
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">flex_file_regx</span>
169
+ <span class="ruby-regexp re">/\.(as|mxml|asdoc)$/</span>
170
+ <span class="ruby-keyword kw">end</span>
171
+ </pre>
172
+ </div>
173
+ </div>
174
+ </div>
175
+
176
+ <div id="method-M000032" class="method-detail">
177
+ <a name="M000032"></a>
178
+
179
+ <div class="method-heading">
180
+ <a href="#M000032" class="method-signature">
181
+ <span class="method-name">import</span><span class="method-args">(path)</span>
182
+ </a>
183
+ </div>
184
+
185
+ <div class="method-description">
186
+ <p>
187
+ Takes a file path and converts it to a <a
188
+ href="ProjectTools.html#M000032">import</a> path using conventionally named
189
+ source folders as the root marker.
190
+ </p>
191
+ <p><a class="source-toggle" href="#"
192
+ onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
193
+ <div class="method-source-code" id="M000032-source">
194
+ <pre>
195
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 48</span>
196
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">import</span>(<span class="ruby-identifier">path</span>)
197
+ <span class="ruby-identifier">truncate_to_src</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'/'</span>,<span class="ruby-value str">'.'</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-identifier">flex_file_regx</span>,<span class="ruby-value str">''</span>)
198
+ <span class="ruby-keyword kw">end</span>
199
+ </pre>
200
+ </div>
201
+ </div>
202
+ </div>
203
+
204
+ <div id="method-M000031" class="method-detail">
205
+ <a name="M000031"></a>
206
+
207
+ <div class="method-heading">
208
+ <a href="#M000031" class="method-signature">
209
+ <span class="method-name">package</span><span class="method-args">(path)</span>
210
+ </a>
211
+ </div>
212
+
213
+ <div class="method-description">
214
+ <p>
215
+ Takes a file path and converts it to a <a
216
+ href="ProjectTools.html#M000031">package</a> path using conventionally
217
+ named source folders as the root marker.
218
+ </p>
219
+ <p><a class="source-toggle" href="#"
220
+ onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
221
+ <div class="method-source-code" id="M000031-source">
222
+ <pre>
223
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 38</span>
224
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">package</span>(<span class="ruby-identifier">path</span>)
225
+ <span class="ruby-identifier">path</span> = <span class="ruby-identifier">remove_relative_prefix</span>(<span class="ruby-identifier">path</span>)
226
+ <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">path</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">flex_file_regx</span>
227
+ <span class="ruby-identifier">truncate_to_src</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'/'</span>,<span class="ruby-value str">'.'</span>)
228
+ <span class="ruby-keyword kw">end</span>
229
+ </pre>
230
+ </div>
231
+ </div>
232
+ </div>
233
+
234
+ <div id="method-M000030" class="method-detail">
235
+ <a name="M000030"></a>
236
+
237
+ <div class="method-heading">
238
+ <a href="#M000030" class="method-signature">
239
+ <span class="method-name">remove_relative_prefix</span><span class="method-args">(path)</span>
240
+ </a>
241
+ </div>
242
+
243
+ <div class="method-description">
244
+ <p>
245
+ Removes any relative prefixes found in the provided path.
246
+ </p>
247
+ <p><a class="source-toggle" href="#"
248
+ onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
249
+ <div class="method-source-code" id="M000030-source">
250
+ <pre>
251
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 30</span>
252
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">remove_relative_prefix</span>(<span class="ruby-identifier">path</span>)
253
+ <span class="ruby-identifier">path</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^\W+\b/</span>, <span class="ruby-value str">''</span>)
254
+ <span class="ruby-keyword kw">end</span>
255
+ </pre>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <div id="method-M000029" class="method-detail">
261
+ <a name="M000029"></a>
262
+
263
+ <div class="method-heading">
264
+ <a href="#M000029" class="method-signature">
265
+ <span class="method-name">truncate_to_src</span><span class="method-args">(path)</span>
266
+ </a>
267
+ </div>
268
+
269
+ <div class="method-description">
270
+ <p>
271
+ Takes a file path and truncates it to the last matching conventionally
272
+ named source directory.
273
+ </p>
274
+ <p><a class="source-toggle" href="#"
275
+ onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
276
+ <div class="method-source-code" id="M000029-source">
277
+ <pre>
278
+ <span class="ruby-comment cmt"># File lib/hel/project_tools.rb, line 20</span>
279
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">truncate_to_src</span>(<span class="ruby-identifier">path</span>)
280
+ <span class="ruby-identifier">common_src_dirs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">remove</span><span class="ruby-operator">|</span>
281
+ <span class="ruby-identifier">path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/^.*\b#{remove}\b(\/|$)/</span>, <span class="ruby-value str">''</span>);
282
+ <span class="ruby-keyword kw">end</span>
283
+ <span class="ruby-identifier">path</span>
284
+ <span class="ruby-keyword kw">end</span>
285
+ </pre>
286
+ </div>
287
+ </div>
288
+ </div>
289
+
290
+
291
+ </div>
292
+
293
+
294
+ </div>
295
+
296
+
297
+ <div id="validator-badges">
298
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
299
+ </div>
300
+
301
+ </body>
302
+ </html>