urbanterror 0.5 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/urbanterror.rb +4 -2
  2. metadata +4 -4
@@ -64,10 +64,12 @@ class UrbanTerror
64
64
  MAX_GEAR = 63
65
65
 
66
66
  def self.gearCalc(gearArray)
67
- MAX_GEAR - gearArray.select{|w| GEAR_TYPES.has_key? w }.map{|w| GEAR_TYPES[w] }.reduce(:+)
67
+ gearArray.each{ |w| raise "No such gear type '#{w}'" unless GEAR_TYPES.has_key?(w) }
68
+ MAX_GEAR - gearArray.map{|w| GEAR_TYPES[w] }.reduce(:+)
68
69
  end
69
70
 
70
71
  def self.reverseGearCalc(number)
72
+ raise "#{number} is outside of the range 0 to 63." unless (0..63).include?(number)
71
73
  GEAR_TYPES.select{|weapon, gear_val| number & gear_val == 0 }.map(&:first)
72
74
  end
73
75
 
@@ -83,6 +85,6 @@ class UrbanTerror
83
85
 
84
86
  def self.matchType(number, abbreviate=false)
85
87
  raise "#{number} is not a valid gametype." unless GAME_MODES.has_key? number
86
- match[number][abbreviate ? 1 : 0]
88
+ GAME_MODES[number][abbreviate ? 1 : 0]
87
89
  end
88
90
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanterror
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 5
9
- version: "0.5"
9
+ version: "1.0"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ricky Elrod
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-28 00:00:00 -04:00
17
+ date: 2010-08-29 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20