adam 1.0.2 → 1.0.3
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.
- data/lib/adam.rb +1 -1
- data/lib/adam/kill.rb +2 -1
- data/lib/adam/killmail.rb +2 -2
- metadata +2 -2
data/lib/adam.rb
CHANGED
data/lib/adam/kill.rb
CHANGED
@@ -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|
|
data/lib/adam/killmail.rb
CHANGED
@@ -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
|