lorem_athlete 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lorem_athlete.rb +6 -6
- metadata +1 -1
data/lib/lorem_athlete.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require '
|
1
|
+
require 'yaml'
|
2
2
|
lib_path = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib_path)
|
4
4
|
class LoremAthlete
|
5
|
-
WORDS = YAML
|
5
|
+
WORDS = YAML.load_file(File.join(File.dirname(__FILE__),"words.yml"))
|
6
6
|
def self.sport
|
7
|
-
sports = YAML
|
7
|
+
sports = YAML.load_file(File.join(File.dirname(__FILE__),"sports.yml"))
|
8
8
|
sports[rand(sports.length)]
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.athlete(sport='default')
|
12
|
-
athletes = YAML
|
12
|
+
athletes = YAML.load_file(File.join(File.dirname(__FILE__),"athletes.yml"))
|
13
13
|
case sport.downcase
|
14
14
|
when "nfl"
|
15
15
|
athletes = athletes["nfl"]
|
@@ -26,7 +26,7 @@ class LoremAthlete
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.team(sport='all')
|
29
|
-
pro_sports_teams = YAML
|
29
|
+
pro_sports_teams = YAML.load_file(File.join(File.dirname(__FILE__),"teams.yml"))
|
30
30
|
case sport.downcase
|
31
31
|
when "all"
|
32
32
|
random_index = rand(2)
|
@@ -65,7 +65,7 @@ class LoremAthlete
|
|
65
65
|
|
66
66
|
private
|
67
67
|
def self.country
|
68
|
-
countries
|
68
|
+
countries = YAML.load_file(File.join(File.dirname(__FILE__),"countries.yml"))
|
69
69
|
countries[rand(countries.length)]
|
70
70
|
end
|
71
71
|
|