breakdown 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -3
- data/lib/breakdown.rb +1 -1
- data/lib/breakdown/version.rb +1 -1
- data/spec/tachypomp_spec.rb +2 -2
- metadata +1 -1
data/README.md
CHANGED
|
@@ -65,11 +65,9 @@ section prior to writing out to a file.
|
|
|
65
65
|
Breakdown::process input_filename, output_dir do |section|
|
|
66
66
|
section[:title] = section[:title].upcase
|
|
67
67
|
section[:text] = convert_to_swedish_chef(section[:text])
|
|
68
|
-
section
|
|
69
68
|
end
|
|
70
69
|
|
|
71
|
-
Each `section` is hash containing values for `:title` and `:text` keys.
|
|
72
|
-
back (as the last statement in the block) so it can be accessed by the rest of the `process` method.
|
|
70
|
+
Each `section` is hash containing values for `:title` and `:text` keys. Modifying the section will change the file content and title generated by the processor.
|
|
73
71
|
|
|
74
72
|
Typical uses for the block method is to add metadata to the head of a section's text, for example when using Breakdown to generate content for *nanoc* or *Jekyll*.
|
|
75
73
|
|
data/lib/breakdown.rb
CHANGED
data/lib/breakdown/version.rb
CHANGED
data/spec/tachypomp_spec.rb
CHANGED
|
@@ -22,13 +22,12 @@ describe Breakdown do
|
|
|
22
22
|
filecount(@output_dir).should equal(9)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
it "should modify title and text when
|
|
25
|
+
it "should modify title and text when section returned by block" do
|
|
26
26
|
|
|
27
27
|
filecount(@output_dir).should equal(0)
|
|
28
28
|
Breakdown::process './spec/examples/the-tachypomp-and-other-stories.md', @output_dir do |section|
|
|
29
29
|
section[:title] = section[:title] + '-modified'
|
|
30
30
|
section[:text]= '!!modified!!' + section[:text]
|
|
31
|
-
section
|
|
32
31
|
end
|
|
33
32
|
|
|
34
33
|
%w(
|
|
@@ -48,6 +47,7 @@ describe Breakdown do
|
|
|
48
47
|
text.should include('!!modified!!')
|
|
49
48
|
end
|
|
50
49
|
end
|
|
50
|
+
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|