fOOrth 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b26e1b244da5adaa8fc5c44878adf0a23b1f066
4
- data.tar.gz: 0d6f3fcc299062f5a1729a0fb11612e7c6744825
3
+ metadata.gz: 077b2a26486139e757aa126f2baef39fd727f773
4
+ data.tar.gz: 8d06e885b72918c5061f29422a906136e752d4a3
5
5
  SHA512:
6
- metadata.gz: ee1b60bcd99441e124425f06ed89d3a1dbdfd30905b1cc6898833f47323c52a6a6d1163730604c758a017c7a0174275a53e2d73e20d2ec0d6b8157bf2fb2a95f
7
- data.tar.gz: 96115428006a4d71003c6060239814debcf44c57aae4627287ceb0ec5377a68f85da6d8a8dd38b886aea912f965b2124b769c41993134dff18eaf81e3a967aec
6
+ metadata.gz: f2f18a3ce3b5079b10f713b2d47b1895d8d1aa695a77b8ce3c608da2cd96af0a1394bcdd7a43886cc682f06f5d9850f42a242a247d3a0f4d542973bac52bd1da
7
+ data.tar.gz: 09dc8053a52a818d354decfe72e8a8c3ed4cd1a61207410e0115dae3f8872e1476e454b222f5b2191aca328e72c3280cf791c29e44b16cc6a46f83b420ed28b6
@@ -52,8 +52,8 @@ class Array
52
52
  public
53
53
 
54
54
  #Print out the array as bullet points.
55
- def puts_foorth_bullets
56
- puts foorth_format_bullets
55
+ def puts_foorth_bullets(page_width)
56
+ puts foorth_format_bullets(page_width)
57
57
  end
58
58
 
59
59
  #Convert the array to strings with bullet points.
@@ -65,7 +65,7 @@ class Array
65
65
  builder = XfOOrth::BulletPoints.new(page_width)
66
66
 
67
67
  self.each do |pair|
68
- builder.add(*pair)
68
+ builder.add(*pair.prepare_bullet_data)
69
69
  end
70
70
 
71
71
  builder.render.join("\n").freeze
@@ -78,4 +78,13 @@ class Array
78
78
  format_foorth_pages(false, page_width)[0] || []
79
79
  end
80
80
 
81
+ #Get data ready for being in a bullet point.
82
+ def prepare_bullet_data
83
+ if length < 2
84
+ ["*", self[0]]
85
+ else
86
+ self
87
+ end
88
+ end
89
+
81
90
  end
@@ -6,8 +6,8 @@ class Hash
6
6
  # Bullets ========================================================
7
7
 
8
8
  #Print out the array as bullet points.
9
- def puts_foorth_bullets
10
- puts foorth_format_bullets
9
+ def puts_foorth_bullets(page_width)
10
+ puts foorth_format_bullets(page_width)
11
11
  end
12
12
 
13
13
  #Convert the array to strings with bullet points.
@@ -8,6 +8,11 @@ class Object
8
8
  self.to_s.format_description(max_width)
9
9
  end
10
10
 
11
+ #Get data ready for being in a bullet point.
12
+ def prepare_bullet_data
13
+ ["*", self]
14
+ end
15
+
11
16
  end
12
17
 
13
18
 
@@ -3,5 +3,5 @@
3
3
  #* version.rb - The version string for fOOrth.
4
4
  module XfOOrth
5
5
  #The version string for fOOrth.
6
- VERSION = "0.6.8"
6
+ VERSION = "0.6.9"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fOOrth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler