Fixes #305. Beautify input in single temp file for HTMLBeautifier

- Enable HTMLBeautifier tests for Travis CI
This commit is contained in:
Glavin Wiechert 2015-05-04 02:32:25 -03:00
parent 024a6c7bdc
commit 8bcf4efcfa
4 changed files with 5 additions and 9 deletions

View File

@ -30,6 +30,7 @@ before_install:
# Ruby language support
# - gem install ruby-beautify --verbose
- gem install rubocop
- gem install htmlbeautifier
# Python language support
- brew install python
- pip install --upgrade autopep8

View File

@ -3,12 +3,10 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Shopping List for
<%= @date.strftime('%A, %d %B %Y') %></title>
<title>Shopping List for <%= @date.strftime('%A, %d %B %Y') %></title>
</head>
<body>
<h1>Shopping List for
<%= @date.strftime('%A, %d %B %Y') %></h1>
<h1>Shopping List for <%= @date.strftime('%A, %d %B %Y') %></h1>
<p>You need to buy:</p>
<ul>
<% for @item in @items %>

View File

@ -13,11 +13,8 @@ module.exports = class HTMLBeautifier extends Beautifier
beautify: (text, language, options) ->
@run("htmlbeautifier", [
'<'
@tempFile("input", text)
'>'
outputFile = @tempFile("output")
tempFile = @tempFile("temp", text)
])
.then(=>
@readFile(outputFile)
@readFile(tempFile)
)