table_setter 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/table_setter/table.rb +26 -2
- data/table_setter.gemspec +1 -1
- metadata +3 -3
data/VERSION.yml
CHANGED
data/lib/table_setter/table.rb
CHANGED
@@ -226,15 +226,39 @@ class TableFu::Formatting
|
|
226
226
|
def markdown(cell)
|
227
227
|
RDiscount.new(cell).to_html
|
228
228
|
end
|
229
|
+
|
229
230
|
# format as a link, if the href is empty don't make the link active
|
230
231
|
def link(linkname, href)
|
231
|
-
title = linkname.to_s.gsub(/(["])/, "'")
|
232
|
-
if !href.value.nil? && !href.value.empty?
|
232
|
+
title = linkname.to_s.gsub(/(["])/, "'")
|
233
|
+
if !href.value.nil? && !href.value.to_s().empty?
|
233
234
|
"<a href=\"#{href}\" title=\"#{title}\">#{linkname}</a>"
|
234
235
|
else
|
235
236
|
"<a title=\"#{title}\">#{linkname}</a>"
|
236
237
|
end
|
237
238
|
end
|
238
239
|
|
240
|
+
# make it strong
|
241
|
+
def strong(cell)
|
242
|
+
"<strong>#{cell}</strong>"
|
243
|
+
end
|
244
|
+
|
245
|
+
# make it small
|
246
|
+
def small(cell)
|
247
|
+
"<small>#{cell}</small>"
|
248
|
+
end
|
249
|
+
|
250
|
+
# join multiple columns, with optional delimiter
|
251
|
+
def join(*args)
|
252
|
+
args.join(" ")
|
253
|
+
end
|
254
|
+
|
255
|
+
def joinbr(*args)
|
256
|
+
args.join("<br>")
|
257
|
+
end
|
258
|
+
|
259
|
+
def joincomma(*args)
|
260
|
+
args.join(", ")
|
261
|
+
end
|
262
|
+
|
239
263
|
end
|
240
264
|
end
|
data/table_setter.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_setter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 10
|
10
|
+
version: 0.1.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeff Larson
|