campfire_export 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module CampfireExport
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -342,7 +342,14 @@ module CampfireExport
342
342
  rescue
343
343
  "[unknown user]"
344
344
  else
345
- doc.css('name').text
345
+ # Take the first name and last initial, if there is more than one name.
346
+ name_parts = doc.css('name').text.split
347
+ if name_parts.length > 1
348
+ name_parts[-1] = "#{name_parts.last[0,1]}."
349
+ name_parts.join(" ")
350
+ else
351
+ name_parts[0]
352
+ end
346
353
  end
347
354
  end
348
355
 
@@ -361,11 +368,11 @@ module CampfireExport
361
368
  when 'KickMessage', 'LeaveMessage'
362
369
  "[#{user} has left the room]\n"
363
370
  when 'TextMessage'
364
- "[#{user}:] #{body}\n"
371
+ "[#{user.rjust(12)}:] #{body}\n"
365
372
  when 'UploadMessage'
366
- "[#{user} uploaded:] #{body}\n"
373
+ "[#{user} uploaded: #{body}]\n"
367
374
  when 'PasteMessage'
368
- "[#{user} pasted:]\n#{indent(body, 2)}\n"
375
+ "[" + "#{user} pasted:]".rjust(14) + "\n#{indent(body, 16)}\n"
369
376
  when 'TopicChangeMessage'
370
377
  "[#{user} changed the topic to: #{body}]\n"
371
378
  when 'ConferenceCreatedMessage'
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 2
10
- version: 0.0.2
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marc Hedlund
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-08 00:00:00 Z
18
+ date: 2011-07-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler