Skip to content

Commit

Permalink
Make sure opts parameters are always optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed May 17, 2008
1 parent 3831099 commit 29400d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/thor
Expand Up @@ -38,7 +38,7 @@ class Thor::Runner < Thor

desc "install NAME", "install a Thor file into your system tasks, optionally named for future updates"
method_options :as => :optional
def install(name, opts)
def install(name, opts = {})
initialize_thorfiles
begin
contents = open(name).read
Expand Down
2 changes: 1 addition & 1 deletion task.thor
Expand Up @@ -3,7 +3,7 @@
class Amazing < Thor
desc "describe NAME", "say that someone is amazing"
method_options :forcefully => :boolean
def describe(name, opts)
def describe(name, opts = {})
ret = "#{name} is amazing"
puts opts["forcefully"] ? ret.upcase : ret
end
Expand Down

0 comments on commit 29400d3

Please sign in to comment.