sycsvpro 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +51 -0
  6. data/LICENSE +20 -0
  7. data/README.md +188 -0
  8. data/README.rdoc +44 -0
  9. data/Rakefile +44 -0
  10. data/bin/sycsvpro +208 -0
  11. data/features/step_definitions/sycsvpro_steps.rb +6 -0
  12. data/features/support/env.rb +15 -0
  13. data/features/sycsvpro.feature +8 -0
  14. data/html/Dsl.html +201 -0
  15. data/html/Object.html +116 -0
  16. data/html/README_rdoc.html +178 -0
  17. data/html/Sycsvpro/Analyzer.html +239 -0
  18. data/html/Sycsvpro/Calculator.html +354 -0
  19. data/html/Sycsvpro/Collector.html +281 -0
  20. data/html/Sycsvpro/ColumnFilter.html +165 -0
  21. data/html/Sycsvpro/Counter.html +397 -0
  22. data/html/Sycsvpro/Extractor.html +269 -0
  23. data/html/Sycsvpro/Filter.html +349 -0
  24. data/html/Sycsvpro/Header.html +228 -0
  25. data/html/Sycsvpro/Mapper.html +288 -0
  26. data/html/Sycsvpro/Profiler.html +234 -0
  27. data/html/Sycsvpro/RowFilter.html +162 -0
  28. data/html/Sycsvpro.html +141 -0
  29. data/html/created.rid +17 -0
  30. data/html/fonts/Lato-Light.ttf +0 -0
  31. data/html/fonts/Lato-LightItalic.ttf +0 -0
  32. data/html/fonts/Lato-Regular.ttf +0 -0
  33. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  34. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  35. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  36. data/html/fonts.css +167 -0
  37. data/html/images/add.png +0 -0
  38. data/html/images/arrow_up.png +0 -0
  39. data/html/images/brick.png +0 -0
  40. data/html/images/brick_link.png +0 -0
  41. data/html/images/bug.png +0 -0
  42. data/html/images/bullet_black.png +0 -0
  43. data/html/images/bullet_toggle_minus.png +0 -0
  44. data/html/images/bullet_toggle_plus.png +0 -0
  45. data/html/images/date.png +0 -0
  46. data/html/images/delete.png +0 -0
  47. data/html/images/find.png +0 -0
  48. data/html/images/loadingAnimation.gif +0 -0
  49. data/html/images/macFFBgHack.png +0 -0
  50. data/html/images/package.png +0 -0
  51. data/html/images/page_green.png +0 -0
  52. data/html/images/page_white_text.png +0 -0
  53. data/html/images/page_white_width.png +0 -0
  54. data/html/images/plugin.png +0 -0
  55. data/html/images/ruby.png +0 -0
  56. data/html/images/tag_blue.png +0 -0
  57. data/html/images/tag_green.png +0 -0
  58. data/html/images/transparent.png +0 -0
  59. data/html/images/wrench.png +0 -0
  60. data/html/images/wrench_orange.png +0 -0
  61. data/html/images/zoom.png +0 -0
  62. data/html/index.html +202 -0
  63. data/html/js/darkfish.js +140 -0
  64. data/html/js/jquery.js +18 -0
  65. data/html/js/navigation.js +142 -0
  66. data/html/js/search.js +109 -0
  67. data/html/js/search_index.js +1 -0
  68. data/html/js/searcher.js +228 -0
  69. data/html/rdoc.css +580 -0
  70. data/html/table_of_contents.html +236 -0
  71. data/lib/sycsvpro/analyzer.rb +40 -0
  72. data/lib/sycsvpro/calculator.rb +94 -0
  73. data/lib/sycsvpro/collector.rb +60 -0
  74. data/lib/sycsvpro/column_filter.rb +23 -0
  75. data/lib/sycsvpro/counter.rb +74 -0
  76. data/lib/sycsvpro/dsl.rb +37 -0
  77. data/lib/sycsvpro/extractor.rb +39 -0
  78. data/lib/sycsvpro/filter.rb +98 -0
  79. data/lib/sycsvpro/header.rb +29 -0
  80. data/lib/sycsvpro/mapper.rb +53 -0
  81. data/lib/sycsvpro/profiler.rb +26 -0
  82. data/lib/sycsvpro/row_filter.rb +20 -0
  83. data/lib/sycsvpro/version.rb +5 -0
  84. data/lib/sycsvpro.rb +9 -0
  85. data/spec/sycsvpro/analyze_spec.rb +23 -0
  86. data/spec/sycsvpro/calculator_spec.rb +45 -0
  87. data/spec/sycsvpro/collector_spec.rb +27 -0
  88. data/spec/sycsvpro/counter_spec.rb +51 -0
  89. data/spec/sycsvpro/extractor_spec.rb +27 -0
  90. data/spec/sycsvpro/files/mappings +6 -0
  91. data/spec/sycsvpro/files/profile.rb +42 -0
  92. data/spec/sycsvpro/mapper_spec.rb +33 -0
  93. data/spec/sycsvpro/profiler_spec.rb +32 -0
  94. data/sycsvpro.gemspec +24 -0
  95. data/sycsvpro.rdoc +29 -0
  96. metadata +215 -0
@@ -0,0 +1,288 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Sycsvpro::Mapper - Your application title</title>
8
+
9
+ <link href="../fonts.css" rel="stylesheet">
10
+ <link href="../rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "../";
14
+ </script>
15
+
16
+ <script src="../js/jquery.js"></script>
17
+ <script src="../js/navigation.js"></script>
18
+ <script src="../js/search_index.js"></script>
19
+ <script src="../js/search.js"></script>
20
+ <script src="../js/searcher.js"></script>
21
+ <script src="../js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" role="document" class="class">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link"><a href="../Object.html">Object</a>
65
+
66
+ </div>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+
76
+ <li ><a href="#method-c-new">::new</a>
77
+
78
+ <li ><a href="#method-i-execute">#execute</a>
79
+
80
+ </ul>
81
+ </div>
82
+
83
+ </div>
84
+ </nav>
85
+
86
+ <main role="main" aria-labelledby="class-Sycsvpro::Mapper">
87
+ <h1 id="class-Sycsvpro::Mapper" class="class">
88
+ class Sycsvpro::Mapper
89
+ </h1>
90
+
91
+ <section class="description">
92
+
93
+ <p>Map values to new values described in a mapping file</p>
94
+
95
+ </section>
96
+
97
+
98
+
99
+
100
+ <section id="5Buntitled-5D" class="documentation-section">
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <section class="attribute-method-details" class="method-section">
109
+ <header>
110
+ <h3>Attributes</h3>
111
+ </header>
112
+
113
+
114
+ <div id="attribute-i-col_filter" class="method-detail">
115
+ <div class="method-heading attribute-method-heading">
116
+ <span class="method-name">col_filter</span><span
117
+ class="attribute-access-type">[R]</span>
118
+ </div>
119
+
120
+ <div class="method-description">
121
+
122
+ <p>filter that is used for columns</p>
123
+
124
+ </div>
125
+ </div>
126
+
127
+ <div id="attribute-i-infile" class="method-detail">
128
+ <div class="method-heading attribute-method-heading">
129
+ <span class="method-name">infile</span><span
130
+ class="attribute-access-type">[R]</span>
131
+ </div>
132
+
133
+ <div class="method-description">
134
+
135
+ <p>infile contains the data that is operated on</p>
136
+
137
+ </div>
138
+ </div>
139
+
140
+ <div id="attribute-i-mapper" class="method-detail">
141
+ <div class="method-heading attribute-method-heading">
142
+ <span class="method-name">mapper</span><span
143
+ class="attribute-access-type">[R]</span>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+
148
+ <p>file that contains the mappings from existing column values to new values</p>
149
+
150
+ </div>
151
+ </div>
152
+
153
+ <div id="attribute-i-outfile" class="method-detail">
154
+ <div class="method-heading attribute-method-heading">
155
+ <span class="method-name">outfile</span><span
156
+ class="attribute-access-type">[R]</span>
157
+ </div>
158
+
159
+ <div class="method-description">
160
+
161
+ <p>outfile is the file where the result is written to</p>
162
+
163
+ </div>
164
+ </div>
165
+
166
+ <div id="attribute-i-row_filter" class="method-detail">
167
+ <div class="method-heading attribute-method-heading">
168
+ <span class="method-name">row_filter</span><span
169
+ class="attribute-access-type">[R]</span>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+
174
+ <p>filter that is used for rows</p>
175
+
176
+ </div>
177
+ </div>
178
+
179
+ </section>
180
+
181
+
182
+
183
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
184
+ <header>
185
+ <h3>Public Class Methods</h3>
186
+ </header>
187
+
188
+
189
+ <div id="method-c-new" class="method-detail ">
190
+
191
+ <div class="method-heading">
192
+ <span class="method-name">new</span><span
193
+ class="method-args">(options={})</span>
194
+
195
+ <span class="method-click-advice">click to toggle source</span>
196
+
197
+ </div>
198
+
199
+
200
+ <div class="method-description">
201
+
202
+ <p>Creates new mapper</p>
203
+
204
+
205
+
206
+
207
+ <div class="method-source-code" id="new-source">
208
+ <pre><span class="ruby-comment"># File lib/sycsvpro/mapper.rb, line 19</span>
209
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>={})
210
+ <span class="ruby-ivar">@infile</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:infile</span>]
211
+ <span class="ruby-ivar">@outfile</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:outfile</span>]
212
+ <span class="ruby-ivar">@row_filter</span> = <span class="ruby-constant">RowFilter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:row_filter</span>])
213
+ <span class="ruby-ivar">@col_filter</span> = <span class="ruby-constant">ColumnFilter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:col_filter</span>])
214
+ <span class="ruby-ivar">@mapper</span> = {}
215
+ <span class="ruby-identifier">init_mapper</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:mapping</span>])
216
+ <span class="ruby-keyword">end</span></pre>
217
+ </div>
218
+
219
+ </div>
220
+
221
+
222
+
223
+
224
+ </div>
225
+
226
+
227
+ </section>
228
+
229
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
230
+ <header>
231
+ <h3>Public Instance Methods</h3>
232
+ </header>
233
+
234
+
235
+ <div id="method-i-execute" class="method-detail ">
236
+
237
+ <div class="method-heading">
238
+ <span class="method-name">execute</span><span
239
+ class="method-args">()</span>
240
+
241
+ <span class="method-click-advice">click to toggle source</span>
242
+
243
+ </div>
244
+
245
+
246
+ <div class="method-description">
247
+
248
+ <p>Executes the mapper</p>
249
+
250
+
251
+
252
+
253
+ <div class="method-source-code" id="execute-source">
254
+ <pre><span class="ruby-comment"># File lib/sycsvpro/mapper.rb, line 29</span>
255
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">execute</span>
256
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">outfile</span>, <span class="ruby-string">&#39;w&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
257
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">infile</span>, <span class="ruby-string">&#39;r&#39;</span>).<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
258
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">col_filter</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">row_filter</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">row</span><span class="ruby-operator">:</span> <span class="ruby-identifier">index</span>))
259
+ <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
260
+ <span class="ruby-identifier">mapper</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span><span class="ruby-operator">|</span>
261
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/(?&lt;=^|;)#{from}(?=;|$)/</span>, <span class="ruby-identifier">to</span>)
262
+ <span class="ruby-keyword">end</span>
263
+ <span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">result</span>
264
+ <span class="ruby-keyword">end</span>
265
+ <span class="ruby-keyword">end</span>
266
+ <span class="ruby-keyword">end</span></pre>
267
+ </div>
268
+
269
+ </div>
270
+
271
+
272
+
273
+
274
+ </div>
275
+
276
+
277
+ </section>
278
+
279
+ </section>
280
+ </main>
281
+
282
+
283
+ <footer id="validator-badges" role="contentinfo">
284
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
285
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
286
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
287
+ </footer>
288
+
@@ -0,0 +1,234 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Sycsvpro::Profiler - Your application title</title>
8
+
9
+ <link href="../fonts.css" rel="stylesheet">
10
+ <link href="../rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "../";
14
+ </script>
15
+
16
+ <script src="../js/jquery.js"></script>
17
+ <script src="../js/navigation.js"></script>
18
+ <script src="../js/search_index.js"></script>
19
+ <script src="../js/search.js"></script>
20
+ <script src="../js/searcher.js"></script>
21
+ <script src="../js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" role="document" class="class">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link"><a href="../Object.html">Object</a>
65
+
66
+ </div>
67
+
68
+ <div id="includes-section" class="nav-section">
69
+ <h3>Included Modules</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+
74
+ <li><a class="include" href="../Dsl.html">Dsl</a>
75
+
76
+
77
+ </ul>
78
+ </div>
79
+
80
+
81
+ <!-- Method Quickref -->
82
+ <div id="method-list-section" class="nav-section">
83
+ <h3>Methods</h3>
84
+
85
+ <ul class="link-list" role="directory">
86
+
87
+ <li ><a href="#method-c-new">::new</a>
88
+
89
+ <li ><a href="#method-i-execute">#execute</a>
90
+
91
+ </ul>
92
+ </div>
93
+
94
+ </div>
95
+ </nav>
96
+
97
+ <main role="main" aria-labelledby="class-Sycsvpro::Profiler">
98
+ <h1 id="class-Sycsvpro::Profiler" class="class">
99
+ class Sycsvpro::Profiler
100
+ </h1>
101
+
102
+ <section class="description">
103
+
104
+ <p>A profiler takes a Ruby script and executes the provided method in the
105
+ script</p>
106
+
107
+ </section>
108
+
109
+
110
+
111
+
112
+ <section id="5Buntitled-5D" class="documentation-section">
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ <section class="attribute-method-details" class="method-section">
121
+ <header>
122
+ <h3>Attributes</h3>
123
+ </header>
124
+
125
+
126
+ <div id="attribute-i-pro_file" class="method-detail">
127
+ <div class="method-heading attribute-method-heading">
128
+ <span class="method-name">pro_file</span><span
129
+ class="attribute-access-type">[R]</span>
130
+ </div>
131
+
132
+ <div class="method-description">
133
+
134
+ <p>Ruby script file</p>
135
+
136
+ </div>
137
+ </div>
138
+
139
+ </section>
140
+
141
+
142
+
143
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
144
+ <header>
145
+ <h3>Public Class Methods</h3>
146
+ </header>
147
+
148
+
149
+ <div id="method-c-new" class="method-detail ">
150
+
151
+ <div class="method-heading">
152
+ <span class="method-name">new</span><span
153
+ class="method-args">(pro_file)</span>
154
+
155
+ <span class="method-click-advice">click to toggle source</span>
156
+
157
+ </div>
158
+
159
+
160
+ <div class="method-description">
161
+
162
+ <p>Creates a new profiler</p>
163
+
164
+
165
+
166
+
167
+ <div class="method-source-code" id="new-source">
168
+ <pre><span class="ruby-comment"># File lib/sycsvpro/profiler.rb, line 15</span>
169
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pro_file</span>)
170
+ <span class="ruby-identifier">require</span> <span class="ruby-identifier">pro_file</span>
171
+ <span class="ruby-keyword">end</span></pre>
172
+ </div>
173
+
174
+ </div>
175
+
176
+
177
+
178
+
179
+ </div>
180
+
181
+
182
+ </section>
183
+
184
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
185
+ <header>
186
+ <h3>Public Instance Methods</h3>
187
+ </header>
188
+
189
+
190
+ <div id="method-i-execute" class="method-detail ">
191
+
192
+ <div class="method-heading">
193
+ <span class="method-name">execute</span><span
194
+ class="method-args">(method)</span>
195
+
196
+ <span class="method-click-advice">click to toggle source</span>
197
+
198
+ </div>
199
+
200
+
201
+ <div class="method-description">
202
+
203
+ <p>Executes the provided method in the Ruby script</p>
204
+
205
+
206
+
207
+
208
+ <div class="method-source-code" id="execute-source">
209
+ <pre><span class="ruby-comment"># File lib/sycsvpro/profiler.rb, line 20</span>
210
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">method</span>)
211
+ <span class="ruby-identifier">send</span>(<span class="ruby-identifier">method</span>)
212
+ <span class="ruby-keyword">end</span></pre>
213
+ </div>
214
+
215
+ </div>
216
+
217
+
218
+
219
+
220
+ </div>
221
+
222
+
223
+ </section>
224
+
225
+ </section>
226
+ </main>
227
+
228
+
229
+ <footer id="validator-badges" role="contentinfo">
230
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
231
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
232
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
233
+ </footer>
234
+
@@ -0,0 +1,162 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Sycsvpro::RowFilter - Your application title</title>
8
+
9
+ <link href="../fonts.css" rel="stylesheet">
10
+ <link href="../rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "../";
14
+ </script>
15
+
16
+ <script src="../js/jquery.js"></script>
17
+ <script src="../js/navigation.js"></script>
18
+ <script src="../js/search_index.js"></script>
19
+ <script src="../js/search.js"></script>
20
+ <script src="../js/searcher.js"></script>
21
+ <script src="../js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" role="document" class="class">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link"><a href="Filter.html">Sycsvpro::Filter</a>
65
+
66
+ </div>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+
76
+ <li ><a href="#method-i-process">#process</a>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+ </div>
82
+ </nav>
83
+
84
+ <main role="main" aria-labelledby="class-Sycsvpro::RowFilter">
85
+ <h1 id="class-Sycsvpro::RowFilter" class="class">
86
+ class Sycsvpro::RowFilter
87
+ </h1>
88
+
89
+ <section class="description">
90
+
91
+ <p>Filters rows based on provided patterns</p>
92
+
93
+ </section>
94
+
95
+
96
+
97
+
98
+ <section id="5Buntitled-5D" class="documentation-section">
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
109
+ <header>
110
+ <h3>Public Instance Methods</h3>
111
+ </header>
112
+
113
+
114
+ <div id="method-i-process" class="method-detail ">
115
+
116
+ <div class="method-heading">
117
+ <span class="method-name">process</span><span
118
+ class="method-args">(object, options={})</span>
119
+
120
+ <span class="method-click-advice">click to toggle source</span>
121
+
122
+ </div>
123
+
124
+
125
+ <div class="method-description">
126
+
127
+ <p>Processes the filter on the given row</p>
128
+
129
+
130
+
131
+
132
+ <div class="method-source-code" id="process-source">
133
+ <pre><span class="ruby-comment"># File lib/sycsvpro/row_filter.rb, line 10</span>
134
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">options</span>={})
135
+ <span class="ruby-identifier">filtered</span> = (<span class="ruby-operator">!</span><span class="ruby-identifier">filter</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:row</span>]).<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">empty?</span>)
136
+ <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
137
+ <span class="ruby-identifier">filtered</span> = (<span class="ruby-identifier">filtered</span> <span class="ruby-keyword">or</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">object</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">p</span>)).<span class="ruby-identifier">nil?</span>)
138
+ <span class="ruby-keyword">end</span>
139
+ <span class="ruby-identifier">filtered</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">object</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
140
+ <span class="ruby-keyword">end</span></pre>
141
+ </div>
142
+
143
+ </div>
144
+
145
+
146
+
147
+
148
+ </div>
149
+
150
+
151
+ </section>
152
+
153
+ </section>
154
+ </main>
155
+
156
+
157
+ <footer id="validator-badges" role="contentinfo">
158
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
159
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
160
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
161
+ </footer>
162
+