Class: LNCS::Section
- Inherits:
-
Object
- Object
- LNCS::Section
- Defined in:
- lib/lncs/section.rb
Instance Attribute Summary collapse
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#proceedings ⇒ Object
Returns the value of attribute proceedings.
Instance Method Summary collapse
- #copy_to(dst) ⇒ Object
- #generate_body_to(dst, volume_number, start_page) ⇒ Object
- #generate_titles_to(dst, start_page) ⇒ Object
- #papers ⇒ Object
- #report ⇒ Object
- #title ⇒ Object
Instance Attribute Details
#manifest ⇒ Object
Returns the value of attribute manifest.
5 6 7 |
# File 'lib/lncs/section.rb', line 5 def manifest @manifest end |
#proceedings ⇒ Object
Returns the value of attribute proceedings.
5 6 7 |
# File 'lib/lncs/section.rb', line 5 def proceedings @proceedings end |
Instance Method Details
#copy_to(dst) ⇒ Object
21 22 23 |
# File 'lib/lncs/section.rb', line 21 def copy_to(dst) papers.each { |paper| paper.copy_to("#{dst}/#{paper.id}") } end |
#generate_body_to(dst, volume_number, start_page) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/lncs/section.rb', line 25 def generate_body_to(dst, volume_number, start_page) papers.each do |paper| padded_start_page = "%04d" % start_page.to_s paper.copy_to("#{dst}/#{volume_number}#{padded_start_page}") start_page += paper.page_count end start_page end |
#generate_titles_to(dst, start_page) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/lncs/section.rb', line 34 def generate_titles_to(dst, start_page) titles = [] papers.each do |paper| padded_start_page = "%04d" % start_page.to_s titles << "#{dst}/#{padded_start_page}.tex" paper.generate_title_to(titles.last, start_page) start_page += paper.page_count end actions.append_file("#{dst}/index.tex") do "\\addtocmark{#{title}}\n" + titles.map {|title| "\\input{#{title}}\n"}.join end start_page end |
#papers ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/lncs/section.rb', line 7 def papers manifest["papers"].map do |paper_id| Paper.new.tap do |p| p.manifest = proceedings.paper_manifest_for(paper_id) p.path = proceedings.paper_path_for(paper_id) p.proceedings = proceedings end end end |
#report ⇒ Object
51 52 53 54 |
# File 'lib/lncs/section.rb', line 51 def report puts title papers.each { |paper| puts "#{"%03d" % paper.id} -- #{paper.page_count}pgs #{paper.type}" } end |
#title ⇒ Object
17 18 19 |
# File 'lib/lncs/section.rb', line 17 def title manifest["title"] end |