commentbox 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/commentbox.rb +6 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c075de18d6c7e47412397f8429b95a4ccf4a510915c412912fecb899ea3c6e37
4
- data.tar.gz: 293ef1564eed9d108736d08284df7cc9d7e8f04961e0918fc5be062071d0e7ba
3
+ metadata.gz: 922e9531c4f2d9e403c9343697e58086c40217a625de7b66b8b145c619b8eae9
4
+ data.tar.gz: 6d4ba601200f5fef70d43203dbc4e2ae4cd76d105c5e884cef96fccee26627ba
5
5
  SHA512:
6
- metadata.gz: 544071b2459e49a38323151808d87d172d0e29785cddb4aa54ef708a74479c93bcfe0a61f13791d672d0c1d38308b59acc9f6e3943f9ed2f669f18c43c9fd8ba
7
- data.tar.gz: a5ff842476987796f19f49b0523986e559b5868f3200b8fcf0b6b129407f4d43afeb87a87c43d5cede01ac66cfc842df1194e2502811a0d75fb173969584be6f
6
+ metadata.gz: f862760a55925ce00d08746251bc8512189e0acd301e6bb4c45d84cc42115da0fd97eb64eb508429ef959021c48e14361ddafe0e24e6ece5d9d9e09a776d4667
7
+ data.tar.gz: 9eed5ab62484e8acefad8dccc13ddd843555adcac89eb6cc37a23bbd4cf06f3ae760475e75f498ce3b678ea7291ea79e67ad46310d164824947b7d5857d10df9
data/lib/commentbox.rb CHANGED
@@ -144,11 +144,14 @@ private
144
144
  @alignment = [ align ] * (@text.size)
145
145
  # set @alignment directly if an array is given
146
146
  elsif align.is_a? Array
147
+ align.map! { |a| a.to_sym }
147
148
  # if the array is too short, fill it with the last element
148
149
  if align.size < @text.size then (@text.size - align.size).times { align.push align.last } end
149
150
  @alignment = align
151
+ elsif align.is_a? String
152
+ @alignment = [ align.to_sym ] * (@text.size)
150
153
  else
151
- raise 'CommentBox#alignment= : expected Symbol or Array here'
154
+ raise 'CommentBox#alignment= : expected Symbol, Array, or String here'
152
155
  end
153
156
  end
154
157
  # if the number of lines is even, insert a blank line between the first and second lines
@@ -158,7 +161,8 @@ private
158
161
  if style == nil then @style = Styles[DefaultParams[:style]]
159
162
  elsif style.is_a? Symbol then @style = Styles[style]
160
163
  elsif style.is_a? Hash then @style = style
161
- else raise 'CommentBox#style= : expected Symbol or Hash here' end
164
+ elsif style.is_a? String then @style = Styles[style.to_sym]
165
+ else raise 'CommentBox#style= : expected Symbol, Hash, or String here' end
162
166
  end
163
167
  def insert_line_if_even # also will delete a blank line if there is one
164
168
  # stop this function from raising errors we don't really care about if the instance isn't fully constructed yet
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commentbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonard H. Phelan IV