Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #32 from pejuko/path

dynamicaly create load_path
  • Loading branch information...
commit fdc79340a9d595cb3b2297297a3bc13bc0ae16ff 2 parents 94dc735 + 7992ca2
@ryanb authored
View
6 lib/ruby_warrior/level.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
View
2  lib/ruby_warrior/profile.rb
@@ -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
View
2  lib/ruby_warrior/tower.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.