lib/codeguessing/console.rb in codeguessing-0.4.9 vs lib/codeguessing/console.rb in codeguessing-0.5
- old
+ new
@@ -1,13 +1,13 @@
module Codeguessing
class Console
attr_reader :game, :scores
- MESSAGE = YAML.load_file(File.expand_path('data/messages.yml'))
+ MESSAGE = YAML.load_file(File.join(File.dirname(__FILE__), 'data/messages.yml'))
def initialize
- @path = File.expand_path('data/scores.yml')
- @scores = load(@path)
+ @path = File.join(File.dirname(__FILE__), 'data/scores.yml')
+ @scores = load(@path) || []
@game = Game.new
end
def rules
puts MESSAGE['rules?']