sinatra-pages 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/spec/pages_spec.rb +1 -1
- metadata +1 -1
data/spec/pages_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe Sinatra::Pages do
|
|
12
12
|
file_of = ->(page){page.downcase.gsub ' ', '_'}
|
13
13
|
separate = ->(text){text.chomp.split("\n")}
|
14
14
|
create_file_for = ->(page, content=[]) do
|
15
|
-
content << '= "#{params[:page]}"'
|
15
|
+
content << '= "#{params[:page]}"' if content.empty?
|
16
16
|
|
17
17
|
File.open("views/#{file_of.(page)}.haml", 'w') {|file| content.each{|line| file.puts line}}
|
18
18
|
end
|