Skip to content

Commit

Permalink
Cache the value of action in App
Browse files Browse the repository at this point in the history
  • Loading branch information
Nucc committed Apr 16, 2013
1 parent de5f9f0 commit dd4ee9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lucie-lib/lib/lucie/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def task
end

def action
@action ||= @command.args.first
@action ? @action.to_sym : :index
@action ||= begin
@command.args.first ? @command.args.first.to_sym : :index
end
end

def controller
Expand Down Expand Up @@ -141,4 +142,4 @@ def exit_value=(exit_value)
@exit_value = exit_value if exit_value.is_a?(Fixnum)
end
end
end
end

0 comments on commit dd4ee9f

Please sign in to comment.