Permalink
Browse files

Merge pull request #32 from pejuko/path

dynamicaly create load_path
  • Loading branch information...
2 parents 94dc735 + 7992ca2 commit fdc79340a9d595cb3b2297297a3bc13bc0ae16ff @ryanb committed Apr 28, 2012
Showing with 7 additions and 3 deletions.
  1. +5 −1 lib/ruby_warrior/level.rb
  2. +1 −1 lib/ruby_warrior/profile.rb
  3. +1 −1 lib/ruby_warrior/tower.rb
@@ -24,7 +24,11 @@ def player_path
end
def load_path
- @profile.tower_path + "/level_" + @number.to_s.rjust(3, '0') + ".rb"
+ File.join(
+ File.expand_path(File.dirname(__FILE__) + '/../../towers/'),
+ File.basename(@profile.tower_path) + "/level_" +
+ @number.to_s.rjust(3, '0') + ".rb"
+ )
end
def load_level
@@ -62,7 +62,7 @@ def epic_score_with_grade
end
def tower
- Tower.new(@tower_path)
+ Tower.new(File.basename @tower_path)
end
def current_level
@@ -3,7 +3,7 @@ class Tower
attr_reader :path
def initialize(path)
- @path = path
+ @path = File.join(File.expand_path(File.dirname(__FILE__) + '/../../towers/'), path)
end
def name

0 comments on commit fdc7934

Please sign in to comment.