adam 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Adam
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
 
4
4
  autoload :Killmail, 'adam/killmail'
5
5
  autoload :KillLog, 'adam/kill_log'
@@ -56,11 +56,11 @@ module Adam
56
56
 
57
57
  end
58
58
 
59
- killmail << "\n"
60
59
  killmail << "\n"
61
60
 
62
61
  destroyed_items = loot.select { |l| l.dropped == false }
63
62
  unless destroyed_items.empty?
63
+ killmail << "\n"
64
64
  killmail << "Destroyed items:\n"
65
65
  killmail << "\n"
66
66
  destroyed_items.each do |loot|
@@ -74,6 +74,7 @@ module Adam
74
74
 
75
75
  dropped_items = loot.select { |l| l.dropped == true }
76
76
  unless dropped_items.empty?
77
+ killmail << "\n"
77
78
  killmail << "Dropped items:\n"
78
79
  killmail << "\n"
79
80
  dropped_items.each do |loot|
@@ -93,7 +93,7 @@ module Adam
93
93
  kill.loot = []
94
94
 
95
95
  if source =~ /Destroyed items:/
96
- source[/Destroyed items:\n\n(((.+)\n)*)/, 1].split("\n").each_with_index do |snippet, i|
96
+ source[/Destroyed items:\n\n(((.+)\n?)*)/, 1].split("\n").each_with_index do |snippet, i|
97
97
  loot = Adam::Kill::Loot.new do |l|
98
98
  l.name = snippet[/([^,\(\)]+)/, 1] or raise ValidationError.new(source), "Destroyed item #{i+1} name malformed"
99
99
  l.quantity = snippet =~ /Qty: ([0-9]+)/ ? snippet[/Qty: ([0-9]+)/, 1].to_i : 1
@@ -107,7 +107,7 @@ module Adam
107
107
  end
108
108
 
109
109
  if source =~ /Dropped items:/
110
- source[/Dropped items:\n\n(((.+)\n)*)/, 1].split("\n").each_with_index do |snippet, i|
110
+ source[/Dropped items:\n\n(((.+)\n?)*)/, 1].split("\n").each_with_index do |snippet, i|
111
111
  loot = Adam::Kill::Loot.new do |l|
112
112
  l.name = snippet[/([^,\(\)]+)/, 1] or raise ValidationError.new(source), "Dropped item #{i+1} name malformed"
113
113
  l.quantity = snippet =~ /Qty: ([0-9]+)/ ? snippet[/Qty: ([0-9]+)/, 1].to_i : 1
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Johannes Gorset