lib/fcb.rb in markdown_exec-1.8.7 vs lib/fcb.rb in markdown_exec-1.8.8

- old
+ new

@@ -19,10 +19,11 @@ call: nil, headings: [], dname: nil, indent: '', name: nil, + nickname: nil, oname: nil, reqs: [], shell: '', title: '', random: Random.new.rand, @@ -36,16 +37,17 @@ # Derives a title from the body of an FCB object. # @param fcb [Object] The FCB object whose title is to be derived. # @return [String] The derived title. def derive_title_from_body - body_content = @attrs[:body] - unless body_content + unless (body_content = @attrs[:body]) + # empty body -> empty title @attrs[:title] = '' return end + # body -> title @attrs[:title] = if body_content.count == 1 body_content.first else format_multiline_body_as_title(body_content) end @@ -111,9 +113,10 @@ body: 'Sample body', call: 'Sample call', headings: %w[Header1 Header2], dname: 'Sample name', indent: '', + nickname: nil, name: 'Sample name', oname: 'Sample name', reqs: %w[req1 req2], shell: 'bash', text: 'Sample Text',