documenter 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1,2 @@
1
- 0.0.4
1
+ 0.0.5
2
+
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{documenter}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["A N"]
12
- s.date = %q{2009-12-11}
12
+ s.date = %q{2009-12-14}
13
13
  s.description = %q{This gem uses OpenOffice and pdftk to convert, split, join, fill and copy files. It may be usefull if you have many documents to work with. It is not realy fast solution and it depend on istalled software}
14
14
  s.email = %q{goremika@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -24,6 +24,9 @@ Gem::Specification.new do |s|
24
24
  "Rakefile",
25
25
  "VERSION",
26
26
  "documenter.gemspec",
27
+ "lib/1b608964155d6d7d6db93752719a499fddde8d3ae4a9412ab42d42793cfb6f06",
28
+ "lib/Archive.rb",
29
+ "lib/New Text Document.txt",
27
30
  "lib/documenter.rb",
28
31
  "lib/documenter/csv.rb",
29
32
  "lib/documenter/ooo.rb",
@@ -44,12 +47,10 @@ Gem::Specification.new do |s|
44
47
  "lib/documenter/ooo/odt.rb",
45
48
  "lib/documenter/pdf.rb",
46
49
  "lib/documenter/pdftk/pdftk.exe",
47
- "test/17474316977tmp.odf",
48
- "test/17474338776tmp.xml",
50
+ "lib/generated.txt",
51
+ "lib/on.txt",
52
+ "lib/text.txt",
49
53
  "test/helper.rb",
50
- "test/myout.csv",
51
- "test/out.pdf",
52
- "test/test1.pdf",
53
54
  "test/test_data/custom_register.odt",
54
55
  "test/test_documenter.rb"
55
56
  ]
@@ -0,0 +1,56 @@
1
+ require 'digest/sha2'
2
+ require 'ftools'
3
+ require 'fileutils'
4
+
5
+ class Archive
6
+ def initialize folder
7
+ @folder = folder
8
+ end
9
+
10
+ def self.file_key filename
11
+ file_h = Digest::SHA2.new
12
+ File.open(filename, 'r') do |fh|
13
+ while buffer = fh.read(1024)
14
+ file_h << buffer
15
+ end
16
+ end
17
+ file_h
18
+ end
19
+
20
+ def self.hash_key hash
21
+ Digest::SHA2.new << hash.to_yaml
22
+ end
23
+
24
+ def get_key params
25
+ self.class.hash_key params
26
+ end
27
+
28
+ def has? params
29
+ key = get_key params
30
+ File.exists? @folder+'/'+key.to_s
31
+ end
32
+
33
+ def put params, file
34
+ key = get_key params
35
+ File.copy @folder+'/'+file, key.to_s
36
+ end
37
+
38
+ def get params, file
39
+ key = get_key params
40
+ if File.exists? @folder+'/'+key.to_s
41
+ File.copy @folder+'/'+key.to_s, file
42
+ else
43
+ raise 'No such file'
44
+ end
45
+ end
46
+ end
47
+
48
+ =begin
49
+ arch = Archive.new '.'
50
+ template = Archive.file_key('text.txt')
51
+ data = {'a' => 'b'}
52
+ ar = Archive.new '.'
53
+ ar.put({:data => data, :template => template}, 'generated.txt')
54
+ #data['a']='a'
55
+ ar.get({:data => data, :template => template}, 'on.txt')
56
+ =end
@@ -0,0 +1 @@
1
+ qweqwe
@@ -0,0 +1 @@
1
+ qweqwe
@@ -0,0 +1 @@
1
+ 122
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - A N
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-11 00:00:00 +03:00
12
+ date: 2009-12-14 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -59,6 +59,9 @@ files:
59
59
  - Rakefile
60
60
  - VERSION
61
61
  - documenter.gemspec
62
+ - lib/1b608964155d6d7d6db93752719a499fddde8d3ae4a9412ab42d42793cfb6f06
63
+ - lib/Archive.rb
64
+ - lib/New Text Document.txt
62
65
  - lib/documenter.rb
63
66
  - lib/documenter/csv.rb
64
67
  - lib/documenter/ooo.rb
@@ -79,12 +82,10 @@ files:
79
82
  - lib/documenter/ooo/odt.rb
80
83
  - lib/documenter/pdf.rb
81
84
  - lib/documenter/pdftk/pdftk.exe
82
- - test/17474316977tmp.odf
83
- - test/17474338776tmp.xml
85
+ - lib/generated.txt
86
+ - lib/on.txt
87
+ - lib/text.txt
84
88
  - test/helper.rb
85
- - test/myout.csv
86
- - test/out.pdf
87
- - test/test1.pdf
88
89
  - test/test_data/custom_register.odt
89
90
  - test/test_documenter.rb
90
91
  has_rdoc: true
Binary file
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:rdfa="http://docs.oasis-open.org/opendocument/meta/rdfa#" xmlns:field="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" office:version="1.2"><office:scripts/><office:font-face-decls><style:font-face style:name="OpenSymbol" svg:font-family="OpenSymbol"/><style:font-face style:name="ARial" svg:font-family="ARial" style:font-family-generic="swiss"/><style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="swiss"/><style:font-face style:name="Nimbus Roman No9 L" svg:font-family="&apos;Nimbus Roman No9 L&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="DejaVu Sans1" svg:font-family="&apos;DejaVu Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Nimbus Sans L" svg:font-family="&apos;Nimbus Sans L&apos;, Arial" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="DejaVu Sans" svg:font-family="&apos;DejaVu Sans&apos;" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="Table1" style:family="table"><style:table-properties style:width="6.9375in" table:align="margins" style:writing-mode="lr-tb"/></style:style><style:style style:name="Table1.A" style:family="table-column"><style:table-column-properties style:column-width="6.9375in" style:rel-column-width="65535*"/></style:style><style:style style:name="Table1.A1" style:family="table-cell"><style:table-cell-properties fo:background-color="#e6e6e6" fo:padding="0.0382in" fo:border="0.0007in solid #000000"><style:background-image/></style:table-cell-properties></style:style><style:style style:name="posts" style:family="table"><style:table-properties style:width="6.9375in" table:align="margins" style:writing-mode="lr-tb"/></style:style><style:style style:name="posts.A" style:family="table-column"><style:table-column-properties style:column-width="6.9375in" style:rel-column-width="65535*"/></style:style><style:style style:name="posts.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="none"/></style:style><style:style style:name="packets" style:family="table"><style:table-properties style:width="6.8611in" table:align="margins" style:writing-mode="lr-tb"/></style:style><style:style style:name="packets.A" style:family="table-column"><style:table-column-properties style:column-width="2.3299in" style:rel-column-width="22254*"/></style:style><style:style style:name="packets.B" style:family="table-column"><style:table-column-properties style:column-width="2.2438in" style:rel-column-width="21431*"/></style:style><style:style style:name="packets.C" style:family="table-column"><style:table-column-properties style:column-width="2.2875in" style:rel-column-width="21850*"/></style:style><style:style style:name="packets.1" style:family="table-row"><style:table-row-properties style:min-row-height="0.0556in"/></style:style><style:style style:name="packets.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="none"/></style:style><style:style style:name="packets.2" style:family="table-row"><style:table-row-properties style:min-row-height="0.2167in"/></style:style><style:style style:name="Table4" style:family="table"><style:table-properties style:width="6.8611in" table:align="margins" style:writing-mode="lr-tb"/></style:style><style:style style:name="Table4.A" style:family="table-column"><style:table-column-properties style:column-width="6.8611in" style:rel-column-width="65535*"/></style:style><style:style style:name="Table4.A1" style:family="table-cell"><style:table-cell-properties fo:background-color="transparent" fo:padding="0.0382in" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"><style:background-image/></style:table-cell-properties></style:style><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-left="1.6807in" fo:margin-right="0in" fo:text-align="center" style:justify-single-word="false" fo:text-indent="-1.389in" style:auto-text-indent="false"><style:tab-stops><style:tab-stop style:position="0.3193in"/><style:tab-stop style:position="1.5626in"/></style:tab-stops></style:paragraph-properties></style:style><style:style style:name="P2" style:family="paragraph" style:parent-style-name="Text_20_body"><style:paragraph-properties fo:margin-left="1.6807in" fo:margin-right="0in" fo:text-align="start" style:justify-single-word="false" fo:text-indent="-1.389in" style:auto-text-indent="false"><style:tab-stops><style:tab-stop style:position="0.3193in"/><style:tab-stop style:position="1.5626in"/></style:tab-stops></style:paragraph-properties><style:text-properties style:font-name="ARial" fo:font-size="10pt" fo:language="en" fo:country="US" fo:font-weight="normal" style:font-size-asian="8.75pt" style:font-weight-asian="normal" style:font-size-complex="10pt" style:font-weight-complex="normal"/></style:style><style:style style:name="P3" style:family="paragraph" style:parent-style-name="Text_20_body"><style:paragraph-properties fo:margin-left="1.6807in" fo:margin-right="0in" fo:text-align="start" style:justify-single-word="false" fo:text-indent="-1.389in" style:auto-text-indent="false"><style:tab-stops><style:tab-stop style:position="0.3193in"/><style:tab-stop style:position="1.5626in"/></style:tab-stops></style:paragraph-properties><style:text-properties style:font-name="ARial" fo:font-size="8pt" fo:language="en" fo:country="US" fo:font-weight="normal" style:font-size-asian="8pt" style:font-weight-asian="normal" style:font-size-complex="8pt" style:font-weight-complex="normal"/></style:style><style:style style:name="P4" style:family="paragraph" style:parent-style-name="Text_20_body"><style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/><style:text-properties style:font-name="ARial" fo:font-size="10pt" fo:language="en" fo:country="US" fo:font-weight="normal" style:font-size-asian="8.75pt" style:font-weight-asian="normal" style:font-size-complex="10pt" style:font-weight-complex="normal"/></style:style><style:style style:name="P5" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties fo:font-size="2pt" style:font-size-asian="2pt" style:font-size-complex="2pt"/></style:style><style:style style:name="P6" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties style:font-name="ARial"/></style:style><style:style style:name="P7" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties style:font-name="ARial" fo:font-size="2pt" fo:font-weight="normal" style:font-size-asian="2pt" style:font-weight-asian="normal" style:font-size-complex="2pt" style:font-weight-complex="normal"/></style:style><style:style style:name="P8" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties style:font-name="ARial" fo:font-size="8pt" fo:font-weight="normal" style:font-size-asian="8pt" style:font-weight-asian="normal" style:font-size-complex="8pt" style:font-weight-complex="normal"/></style:style><style:style style:name="P9" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/><style:text-properties style:font-name="ARial" fo:font-size="8pt" fo:language="en" fo:country="US" style:font-size-asian="8pt" style:font-size-complex="8pt"/></style:style><style:style style:name="P10" style:family="paragraph" style:parent-style-name="Heading_20_1"><style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/><style:text-properties style:font-name="ARial" fo:font-size="12pt" fo:language="en" fo:country="US" style:font-size-asian="12pt" style:font-size-complex="12pt"/></style:style><style:style style:name="P11" style:family="paragraph" style:parent-style-name="Heading_20_1"><style:paragraph-properties fo:background-color="transparent"><style:background-image/></style:paragraph-properties><style:text-properties style:font-name="ARial" fo:font-size="8pt" fo:language="en" fo:country="US" fo:font-weight="bold" style:font-size-asian="8pt" style:font-weight-asian="bold" style:font-size-complex="8pt" style:font-weight-complex="bold"/></style:style><style:style style:name="P12" style:family="paragraph" style:parent-style-name="Heading_20_10"><style:paragraph-properties fo:margin-left="1.6807in" fo:margin-right="0in" fo:text-align="start" style:justify-single-word="false" fo:text-indent="-1.389in" style:auto-text-indent="false"><style:tab-stops><style:tab-stop style:position="0.3193in"/><style:tab-stop style:position="1.5626in"/></style:tab-stops></style:paragraph-properties><style:text-properties style:font-name="ARial" fo:font-size="8pt" fo:font-weight="normal" style:font-size-asian="8pt" style:font-weight-asian="normal" style:font-size-complex="8pt" style:font-weight-complex="normal"/></style:style><style:style style:name="T1" style:family="text"><style:text-properties fo:language="en" fo:country="US"/></style:style><style:style style:name="T2" style:family="text"><style:text-properties style:font-name="Arial1" fo:font-size="8pt" fo:language="en" fo:country="US" style:font-size-asian="8pt" style:font-size-complex="8pt"/></style:style></office:automatic-styles><office:body><office:text><office:forms form:automatic-focus="false" form:apply-design-mode="false"/><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:user-field-decls><text:user-field-decl office:value-type="string" office:string-value="group_number" text:name="group_number"/><text:user-field-decl office:value-type="string" office:string-value="number" text:name="number"/><text:user-field-decl office:value-type="string" office:string-value="surname" text:name="surname"/><text:user-field-decl office:value-type="string" office:string-value="name" text:name="name"/><text:user-field-decl office:value-type="string" office:string-value="fathername" text:name="fathername"/><text:user-field-decl office:value-type="string" office:string-value="adr" text:name="adr"/><text:user-field-decl office:value-type="string" office:string-value="packet_number" text:name="packet_number"/><text:user-field-decl office:value-type="string" office:string-value="cur_date" text:name="cur_date"/><text:user-field-decl office:value-type="string" office:string-value="post_date" text:name="post_date"/><text:user-field-decl office:value-type="string" office:string-value="posts" text:name="posts"/><text:user-field-decl office:value-type="string" office:string-value="t" text:name="t"/></text:user-field-decls><text:h text:style-name="P10" text:outline-level="1"/><text:h text:style-name="P10" text:outline-level="1">Реестр выдачи экспресс-грузов</text:h><text:p text:style-name="P9"/><text:p text:style-name="P9"><text:s/></text:p><table:table table:name="Table1" table:style-name="Table1"><table:table-column table:style-name="Table1.A"/><table:table-row><table:table-cell table:style-name="Table1.A1" office:value-type="string"><text:h text:style-name="P11" text:outline-level="1">Группа №: <text:s/><text:user-field-get text:name="group_number">group_number</text:user-field-get></text:h></table:table-cell></table:table-row></table:table><text:h text:style-name="P12" text:outline-level="10"><text:span text:style-name="T1"><text:s/></text:span><text:span text:style-name="T1"><text:user-field-get text:name="number">number</text:user-field-get></text:span><text:span text:style-name="T1"> <text:tab/> </text:span><text:span text:style-name="T1"><text:user-field-get text:name="surname">surname</text:user-field-get></text:span><text:span text:style-name="T1"> </text:span><text:span text:style-name="T1"><text:user-field-get text:name="name">name</text:user-field-get></text:span><text:span text:style-name="T1"> </text:span><text:span text:style-name="T1"><text:user-field-get text:name="fathername">fathername</text:user-field-get></text:span><text:span text:style-name="T1">, </text:span><text:span text:style-name="T1"><text:user-field-get text:name="adr">adr</text:user-field-get></text:span></text:h><table:table table:name="posts" table:style-name="posts"><table:table-column table:style-name="posts.A"/><table:table-row><table:table-cell table:style-name="posts.A1" office:value-type="string"><text:p text:style-name="P5"/></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="posts.A1" office:value-type="string"><text:p text:style-name="Table_20_Contents"/><text:p text:style-name="P1"><text:span text:style-name="T2">Отправка <text:s/></text:span><text:span text:style-name="T2"><text:user-field-get text:name="posts">posts</text:user-field-get></text:span><text:span text:style-name="T2"> <text:s text:c="14"/>от </text:span><text:span text:style-name="T2"><text:user-field-get text:name="post_date">post_date</text:user-field-get></text:span></text:p><table:table table:name="packets" table:style-name="packets"><table:table-column table:style-name="packets.A"/><table:table-column table:style-name="packets.B"/><table:table-column table:style-name="packets.C"/><table:table-row table:style-name="packets.1"><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P7"/></table:table-cell><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P7"/></table:table-cell><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P7"/></table:table-cell></table:table-row><table:table-row table:style-name="packets.2"><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P8"><text:s/><text:user-field-get text:name="packet_number">packet_number</text:user-field-get> <text:s/><text:user-field-get text:name="t">t</text:user-field-get></text:p></table:table-cell><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P8">Получил:</text:p></table:table-cell><table:table-cell table:style-name="packets.A1" office:value-type="string"><text:p text:style-name="P8"><text:user-field-get text:name="cur_date">cur_date</text:user-field-get> <text:user-field-get text:name="t">t</text:user-field-get><text:user-field-get text:name="t">t</text:user-field-get></text:p></table:table-cell></table:table-row></table:table><text:p text:style-name="P4"/><table:table table:name="Table4" table:style-name="Table4"><table:table-column table:style-name="Table4.A"/><table:table-row><table:table-cell table:style-name="Table4.A1" office:value-type="string"><text:p text:style-name="P6"/></table:table-cell></table:table-row></table:table><text:p text:style-name="Text_20_body"/><text:p text:style-name="Table_20_Contents"/></table:table-cell></table:table-row></table:table><text:p text:style-name="P3"/><text:p text:style-name="P3"/><text:p text:style-name="P3"/><text:p text:style-name="P3"/><text:p text:style-name="P2"/></office:text></office:body></office:document-content>
@@ -1,3 +0,0 @@
1
- "a","b"
2
- "a0","b0"
3
- "a1","b1"
Binary file
Binary file