Skip to content

Commit

Permalink
allow :bare as equivalent to :nowrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mattly committed Jan 21, 2011
1 parent d88b9e1 commit c0e991d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rack/coffee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize(app, opts={})
@cache = opts[:cache]
@ttl = opts[:ttl] || 86400
@command = ['coffee', '-p']
@command.push('--bare') if opts[:nowrap]
@command.push('--bare') if opts[:nowrap] || opts[:bare]
@command = @command.join(' ')
end

Expand Down
7 changes: 6 additions & 1 deletion test/rack_coffee_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,9 @@ def test_no_wrap_option
assert_equal "alert(\"coffee\");", result.body.chomp
end

end
def test_bare_option
result = request({:bare => true}).get("/javascripts/test.js")
assert_equal "alert(\"coffee\");", result.body.chomp
end

end

0 comments on commit c0e991d

Please sign in to comment.