Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract chapter name from hash #44

Merged
merged 2 commits into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/renderer/contents_manifest_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def write_manifest_file(book_metadata)
end

def manifest_contents(book_metadata)
chapters = book_metadata["chapters"].map { |c| "#{c}.playgroundchapter" }
chapters = book_metadata["chapters"].map { |c| "#{c["name"]}.playgroundchapter" }
manifest_contents = {
"Name" => book_metadata["name"],
"ContentIdentifier" => book_metadata["identifier"],
Expand Down
2 changes: 1 addition & 1 deletion lib/renderer/page_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def write_page(page_name, page_dir_name, imports, page_contents, chapter_info={}
file.write({
"Name" => page_name,
"LiveViewMode" => chapter_info.has_key?("live_view_mode") ? chapter_info["live_view_mode"] : "HiddenByDefault",
"LiveViewEdgeToEdge" => chapter_info.has_key?(["edge_to_edge_live_view"]) ? chapter_info["edge_to_edge_live_view"] : true,
"LiveViewEdgeToEdge" => chapter_info.has_key?("edge_to_edge_live_view") ? chapter_info["edge_to_edge_live_view"] : true,
"Version" => "1.0",
"ContentVersion" => "1.0"
}.to_plist)
Expand Down
2 changes: 1 addition & 1 deletion spec/renderer/contents_manfiest_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Playgroundbook
end

it "has chapters specified" do
expect(get_manifest["Chapters"]).to eq(["{\"name\"=>\"test_chapter\"}.playgroundchapter"])
expect(get_manifest["Chapters"]).to eq(["test_chapter.playgroundchapter"])
end

it "has a ImageReference" do
Expand Down