Class: LNCS::Proceedings
- Inherits:
-
Object
- Object
- LNCS::Proceedings
- Defined in:
- lib/lncs/proceedings.rb
Instance Attribute Summary collapse
-
#manifest ⇒ Object
Returns the value of attribute manifest.
Instance Method Summary collapse
- #copy_to(dst) ⇒ Object
- #generate_body_to(dst) ⇒ Object
- #generate_titles_to(dst) ⇒ Object
- #paper_file_name_for(paper_id) ⇒ Object
- #paper_manifest_for(paper_id) ⇒ Object
- #paper_path_for(paper_id) ⇒ Object
- #papers ⇒ Object
- #report ⇒ Object
- #sections ⇒ Object
- #source_directory ⇒ Object
- #volume_number ⇒ Object
Instance Attribute Details
#manifest ⇒ Object
Returns the value of attribute manifest.
5 6 7 |
# File 'lib/lncs/proceedings.rb', line 5 def manifest @manifest end |
Instance Method Details
#copy_to(dst) ⇒ Object
46 47 48 |
# File 'lib/lncs/proceedings.rb', line 46 def copy_to(dst) sections.each { |section| section.copy_to(dst) } end |
#generate_body_to(dst) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/lncs/proceedings.rb', line 50 def generate_body_to(dst) start_page = 1 sections.each do |s| start_page = s.generate_body_to(dst, volume_number, start_page) end end |
#generate_titles_to(dst) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/lncs/proceedings.rb', line 57 def generate_titles_to(dst) actions.remove_file("#{dst}/index.tex") actions.create_file("#{dst}/index.tex") start_page = 1 sections.each do |s| start_page = s.generate_titles_to(dst, start_page) end end |
#paper_file_name_for(paper_id) ⇒ Object
19 20 21 22 23 |
# File 'lib/lncs/proceedings.rb', line 19 def paper_file_name_for(paper_id) Dir.chdir(source_directory) do Dir.glob("*_#{paper_id}.{pdf,zip}")[0] end end |
#paper_manifest_for(paper_id) ⇒ Object
31 32 33 34 35 |
# File 'lib/lncs/proceedings.rb', line 31 def paper_manifest_for(paper_id) paper_manifest = papers.fetch(paper_id.to_s, {}) paper_manifest["pdf"] = paper_file_name_for(paper_id) unless paper_manifest["pdf"] paper_manifest end |
#paper_path_for(paper_id) ⇒ Object
25 26 27 28 29 |
# File 'lib/lncs/proceedings.rb', line 25 def paper_path_for(paper_id) filename = paper_file_name_for(paper_id) raise "Error: no file with name ending '#{paper_id}.pdf' or '#{paper_id}.zip' found at path '#{source_directory}'" unless filename File.join(source_directory, filename) end |
#papers ⇒ Object
15 16 17 |
# File 'lib/lncs/proceedings.rb', line 15 def papers manifest["papers"] || {} end |
#report ⇒ Object
66 67 68 |
# File 'lib/lncs/proceedings.rb', line 66 def report sections.each { |s| s.report } end |
#sections ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/lncs/proceedings.rb', line 37 def sections manifest["sections"].map do |section| Section.new.tap do |s| s.manifest = section s.proceedings = self end end end |
#source_directory ⇒ Object
11 12 13 |
# File 'lib/lncs/proceedings.rb', line 11 def source_directory manifest["sources"] end |
#volume_number ⇒ Object
7 8 9 |
# File 'lib/lncs/proceedings.rb', line 7 def volume_number manifest["volume_number"] end |