texzip 0.1.8 → 0.1.9
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.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/bin/texzip +27 -34
- data/lib/texzip/Project.rb +516 -518
- data/lib/texzip.rb +8 -13
- data/spec/spec_helper.rb +1 -2
- data/spec/texzip_spec.rb +38 -41
- data/version.txt +1 -1
- metadata +34 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c12e08ba503ac34756956e265693eeaec089d0a
|
4
|
+
data.tar.gz: 856f9703d45fda06052e3b809d02cacc6788cfec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5a71df7c1fe384f702db9ecbc0eb4ffee1ee735d72564ee0432125b54edae54c5c8a3540fd62d8bf0cdb3e92455bdc948e1ce045627700ef8a0b12375e47852
|
7
|
+
data.tar.gz: 9c7c7aa4d13f3f8e0f7d465a1e7cfa4e4bef3f267635742cbd693faf40f5d989a758f40fc8b68cad1f4e8e4e8ab5e1dd0e5ad8510d654327eb8ff1b2a4da312f
|
data/History.txt
CHANGED
data/bin/texzip
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__),
|
4
|
-
%w
|
4
|
+
%w(.. lib texzip)))
|
5
5
|
|
6
6
|
# Put your code here
|
7
7
|
|
8
8
|
require 'trollop'
|
9
9
|
|
10
|
-
opts = Trollop
|
11
|
-
|
10
|
+
opts = Trollop.options do
|
11
|
+
banner <<-EOS
|
12
12
|
TeXzip bundles your TeX project in a single archive or directory with all
|
13
13
|
included tex-, sty-, cls-files, pictures and (used) BibTeX-references.
|
14
14
|
|
@@ -18,48 +18,41 @@ Usage:
|
|
18
18
|
|
19
19
|
where [options] are:
|
20
20
|
EOS
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
opt :bib, 'Output BibTeX file', default: 'bibliography.bib'
|
22
|
+
opt :output, 'Output directory where the modified files should saved', type: String
|
23
|
+
opt :images, 'Subdirectory where the images should be stored', default: 'img'
|
24
|
+
opt 'plain-images', 'Images should be stored without further subdirectories'
|
25
|
+
opt :archive, 'Archive to be created', type: String
|
26
|
+
opt :force, 'Force overwriting of files', default: false
|
27
|
+
version "#{File.basename(__FILE__)} #{TeXzip::VERSION} (c) 2011,2012 Frank Fischer"
|
28
28
|
end
|
29
29
|
|
30
30
|
if ARGV.empty?
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
STDERR.puts 'Error: No master TeX-file given.'
|
32
|
+
STDERR.puts 'Try --help for help.'
|
33
|
+
exit(-1)
|
34
34
|
end
|
35
35
|
|
36
|
-
unless opts[:archive]
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
unless opts[:archive] || opts[:output]
|
37
|
+
STDERR.puts 'Error: --output or --archive must be given.'
|
38
|
+
STDERR.puts 'Try --help for help.'
|
39
|
+
exit(-1)
|
40
40
|
end
|
41
41
|
|
42
42
|
begin
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
texproject = TeXzip::Project.new ARGV.shift
|
44
|
+
texproject.modify_files(opts[:output] || Dir.getwd,
|
45
|
+
opts[:images], opts['plain-images'],
|
46
|
+
opts[:bib])
|
47
47
|
|
48
|
-
|
48
|
+
texproject.overwrite_all = opts[:force]
|
49
49
|
|
50
|
-
|
51
|
-
texproject.write_files
|
52
|
-
end
|
50
|
+
texproject.write_files if opts[:output]
|
53
51
|
|
54
|
-
|
55
|
-
texproject.write_archive opts[:archive]
|
56
|
-
end
|
52
|
+
texproject.write_archive opts[:archive] if opts[:archive]
|
57
53
|
rescue TeXzip::Error => e
|
58
|
-
|
59
|
-
|
54
|
+
STDERR.puts "Error: #{e}"
|
55
|
+
exit(-1)
|
60
56
|
rescue TeXzip::Project::Quit
|
61
|
-
|
57
|
+
puts 'Aborted.'
|
62
58
|
end
|
63
|
-
|
64
|
-
|
65
|
-
|