Skip to content

Commit

Permalink
Merge branch 'location_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
cypher committed May 20, 2008
2 parents e59887c + aa042e1 commit e3572ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/thor/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.globs_for(path)
map "-T" => :list, "-i" => :install, "-u" => :update

desc "install NAME", "install a Thor file into your system tasks, optionally named for future updates"
method_options :as => :optional
method_options :as => :optional, :absolute => :boolean
def install(name, opts = {})
initialize_thorfiles
begin
Expand Down Expand Up @@ -56,7 +56,9 @@ def install(name, opts = {})
FileUtils.touch(yaml_file)
yaml = thor_yaml

yaml[as] = {:filename => Digest::MD5.hexdigest(name + as), :location => name, :constants => constants}
location = (opts["absolute"] && !is_uri) ? File.expand_path(name) : name

yaml[as] = {:filename => Digest::MD5.hexdigest(name + as), :location => location, :constants => constants}

save_yaml(yaml)

Expand Down

0 comments on commit e3572ba

Please sign in to comment.