old_sql 1.24.0 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -153,15 +153,21 @@ Optionally create a CSV DESIGN file under config/old_sql/report_design:
153
153
  # To disable this set round_report_values to false in
154
154
  # config/initializers/old_sql.rb. You can also change the
155
155
  # precision, which is 2 by default.
156
+ #
157
+ # Tabs or spaces can optionally be used between "cells" for
158
+ # ease of reading.
159
+ #
160
+ # All uppercase Labels are bolded and converted to capitalized
161
+ # words for the jqgrid, and HTML table report views.
156
162
 
157
- id,name
158
- "Example Math Operation",id + id
159
- "Totals","..."
160
- "Expression",( id + id ) * 10
161
- "Divide by Zero 1",0 / 0
162
- "Divide by Zero 2",1.0 / 0
163
- "Divide by Zero 3",0.0 / 0.0
164
- "Rounding",200.0 / 43.0
163
+ id, name
164
+ "EXAMPLE MATH OPERATION", id + id
165
+ "Totals", "..."
166
+ "Expression", ( id + id ) * 10
167
+ "Divide by Zero 1", 0 / 0
168
+ "Divide by Zero 2", 1.0 / 0
169
+ "Divide by Zero 3", 0.0 / 0.0
170
+ "Rounding", 200.0 / 43.0
165
171
 
166
172
  Optionally create a CHART DESIGN file under config/old_sql/report_design:
167
173
 
@@ -14,12 +14,18 @@
14
14
  # To disable this set round_report_values to false in
15
15
  # config/initializers/old_sql.rb. You can also change the
16
16
  # precision, which is 2 by default.
17
+ #
18
+ # Tabs or spaces can optionally be used between "cells" for
19
+ # ease of reading.
20
+ #
21
+ # All uppercase Labels are bolded and converted to capitalized
22
+ # words for the jqgrid, and HTML table report views.
17
23
 
18
- id,name
19
- "Example Math Operation",id + id
20
- "Totals","..."
21
- "Expression",( id + id ) * 10
22
- "Divide by Zero 1",0 / 0
23
- "Divide by Zero 2",1.0 / 0
24
- "Divide by Zero 3",0.0 / 0.0
25
- "Rounding",200.0 / 43.0
24
+ id, name
25
+ "EXAMPLE MATH OPERATION", id + id
26
+ "Totals", "..."
27
+ "Expression", ( id + id ) * 10
28
+ "Divide by Zero 1", 0 / 0
29
+ "Divide by Zero 2", 1.0 / 0
30
+ "Divide by Zero 3", 0.0 / 0.0
31
+ "Rounding", 200.0 / 43.0
@@ -4,7 +4,7 @@ module OldSql
4
4
  attr_accessor :cell_data, :cell
5
5
 
6
6
  def initialize(value)
7
- @cell = value
7
+ @cell = value.strip
8
8
  @cell_data = []
9
9
 
10
10
  # Check if cell is a label
@@ -24,6 +24,7 @@ module OldSql
24
24
 
25
25
  return nil if @rec.nil?
26
26
 
27
+ @report_type = report_config['report_view']
27
28
  report_design = report_config['report_design']
28
29
 
29
30
  if report_design
@@ -178,7 +179,9 @@ module OldSql
178
179
  end
179
180
  report_row << result
180
181
  elsif cd.type == OldSql::ReportDesign::CellData::LABEL
181
- report_row << cd.data.gsub(/"/,"")
182
+ label = cd.data.gsub(/"/,"")
183
+ label = bold(label) if label.length == label[/[A-Z\s]*/].length
184
+ report_row << label
182
185
  end
183
186
  end
184
187
  end
@@ -242,6 +245,27 @@ module OldSql
242
245
 
243
246
  result
244
247
  end
248
+
249
+ def bold(label)
250
+ _label = ""
251
+ _label << "<span style='font-weight:bold'>"
252
+ _label << capitalize(label)
253
+ _label << "</span>"
254
+ _label.html_safe
255
+ end
256
+
257
+ def capitalize(label)
258
+ _label = ""
259
+ first = true
260
+
261
+ label.split(/\s/).each do |s|
262
+ _label << " " unless first
263
+ _label << s.capitalize
264
+ first = false
265
+ end
266
+
267
+ _label
268
+ end
245
269
  end
246
270
  end
247
271
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: old_sql
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.24.0
5
+ version: 1.25.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eddie Gonzales
@@ -195,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ">="
197
197
  - !ruby/object:Gem::Version
198
- hash: -4537625593687246760
198
+ hash: -1326309612636495588
199
199
  segments:
200
200
  - 0
201
201
  version: "0"