Permalink
Browse files

Care only about rakefile filename.

  • Loading branch information...
1 parent 1f119d1 commit cb381a2c5971a05c16f9f522ebc05c576d910f14 @josevalim josevalim committed Oct 18, 2009
Showing with 2 additions and 5 deletions.
  1. +1 −4 lib/thor/rake_compat.rb
  2. +1 −1 spec/rake_compat_spec.rb
View
5 lib/thor/rake_compat.rb
@@ -21,11 +21,8 @@ def self.rake_classes
end
def self.included(base)
- rakefile = caller[0].match(/(.*):\d+/)[1]
- rakefile.gsub!(Dir.pwd, "")
- rakefile.gsub!(/^\//, "")
-
# Hack. Make rakefile point to invoker, so rdoc task is generated properly.
+ rakefile = File.basename(caller[0].match(/(.*):\d+/)[1])
Rake.application.instance_variable_set(:@rakefile, rakefile)
self.rake_classes << base
end
View
2 spec/rake_compat_spec.rb
@@ -28,7 +28,7 @@ class ThorTask < Thor
describe Thor::RakeCompat do
it "sets the rakefile application" do
- Rake.application.rakefile.must =~ /rake_compat_spec.rb$/
+ Rake.application.rakefile.must == "rake_compat_spec.rb"
end
it "adds rake tasks to thor classes too" do

0 comments on commit cb381a2

Please sign in to comment.