lorem_athlete 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. data/lib/lorem_athlete.rb +6 -6
  2. metadata +1 -1
@@ -1,15 +1,15 @@
1
- require 'YAML'
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::load(File.open('lib/words.yml'))
5
+ WORDS = YAML.load_file(File.join(File.dirname(__FILE__),"words.yml"))
6
6
  def self.sport
7
- sports = YAML::load(File.open('lib/sports.yml'))
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::load( File.open('lib/athletes.yml'))
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::load( File.open('lib/teams.yml'))
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 = YAML::load(File.open("lib/countries.yml"))
68
+ countries = YAML.load_file(File.join(File.dirname(__FILE__),"countries.yml"))
69
69
  countries[rand(countries.length)]
70
70
  end
71
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorem_athlete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: