lib/ember-cli/html_page.rb in ember-cli-rails-0.4.3 vs lib/ember-cli/html_page.rb in ember-cli-rails-0.5.0
- old
+ new
@@ -1,10 +1,9 @@
module EmberCli
class HtmlPage
- def initialize(content:, asset_resolver:, head: "", body: "")
+ def initialize(content:, head: "", body: "")
@content = content
- @asset_resolver = asset_resolver
@head = head
@body = body
end
def render
@@ -14,43 +13,37 @@
if has_body_tag?
insert_body_content
end
- html
+ content
end
private
+ attr_reader :content
+
def has_head_tag?
head_tag_index >= 0
end
def has_body_tag?
body_tag_index >= 0
end
def insert_head_content
- html.insert(head_tag_index, @head.to_s)
+ content.insert(head_tag_index, @head.to_s)
end
def insert_body_content
- html.insert(body_tag_index, @body.to_s)
+ content.insert(body_tag_index, @body.to_s)
end
- def html
- @html ||= resolved_html
- end
-
def head_tag_index
- html.index("</head") || -1
+ content.index("</head") || -1
end
def body_tag_index
- html.index("</body") || -1
- end
-
- def resolved_html
- @asset_resolver.resolve_urls(@content)
+ content.index("</body") || -1
end
end
end