mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
Updated for version 0.6.9
This commit is contained in:
parent
22899e4962
commit
6dc2b19d4e
5 changed files with 20 additions and 6 deletions
Binary file not shown.
|
@ -52,8 +52,8 @@ class Array
|
||||||
public
|
public
|
||||||
|
|
||||||
#Print out the array as bullet points.
|
#Print out the array as bullet points.
|
||||||
def puts_foorth_bullets
|
def puts_foorth_bullets(page_width)
|
||||||
puts foorth_format_bullets
|
puts foorth_format_bullets(page_width)
|
||||||
end
|
end
|
||||||
|
|
||||||
#Convert the array to strings with bullet points.
|
#Convert the array to strings with bullet points.
|
||||||
|
@ -65,7 +65,7 @@ class Array
|
||||||
builder = XfOOrth::BulletPoints.new(page_width)
|
builder = XfOOrth::BulletPoints.new(page_width)
|
||||||
|
|
||||||
self.each do |pair|
|
self.each do |pair|
|
||||||
builder.add(*pair)
|
builder.add(*pair.prepare_bullet_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
builder.render.join("\n").freeze
|
builder.render.join("\n").freeze
|
||||||
|
@ -78,4 +78,13 @@ class Array
|
||||||
format_foorth_pages(false, page_width)[0] || []
|
format_foorth_pages(false, page_width)[0] || []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#Get data ready for being in a bullet point.
|
||||||
|
def prepare_bullet_data
|
||||||
|
if length < 2
|
||||||
|
["*", self[0]]
|
||||||
|
else
|
||||||
|
self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,8 +6,8 @@ class Hash
|
||||||
# Bullets ========================================================
|
# Bullets ========================================================
|
||||||
|
|
||||||
#Print out the array as bullet points.
|
#Print out the array as bullet points.
|
||||||
def puts_foorth_bullets
|
def puts_foorth_bullets(page_width)
|
||||||
puts foorth_format_bullets
|
puts foorth_format_bullets(page_width)
|
||||||
end
|
end
|
||||||
|
|
||||||
#Convert the array to strings with bullet points.
|
#Convert the array to strings with bullet points.
|
||||||
|
|
|
@ -8,6 +8,11 @@ class Object
|
||||||
self.to_s.format_description(max_width)
|
self.to_s.format_description(max_width)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#Get data ready for being in a bullet point.
|
||||||
|
def prepare_bullet_data
|
||||||
|
["*", self]
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
#* version.rb - The version string for fOOrth.
|
#* version.rb - The version string for fOOrth.
|
||||||
module XfOOrth
|
module XfOOrth
|
||||||
#The version string for fOOrth.
|
#The version string for fOOrth.
|
||||||
VERSION = "0.6.8"
|
VERSION = "0.6.9"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue