texzip 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/texzip/Project.rb +16 -14
- data/version.txt +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ Bones {
|
|
17
17
|
authors 'Frank Fischer'
|
18
18
|
email 'frank.fischer@mathematik.tu-chemnitz.de'
|
19
19
|
url 'http://darcsden.com/lyro/texzip'
|
20
|
-
depend_on 'bibtex-ruby', ['>= 1.
|
20
|
+
depend_on 'bibtex-ruby', ['>= 1.3.6', '< 2.0']
|
21
21
|
depend_on 'trollop', '~> 1.16'
|
22
22
|
depend_on 'ffi-libarchive', '>= 0.1.3', '< 2.0'
|
23
23
|
depend_on 'ffi-inliner', '>= 0.2.4', '< 2.0'
|
data/lib/texzip/Project.rb
CHANGED
@@ -2,7 +2,6 @@ require 'pathname'
|
|
2
2
|
require 'set'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'bibtex'
|
5
|
-
require 'ffi-libarchive'
|
6
5
|
require 'highline'
|
7
6
|
|
8
7
|
class TeXzip::Error < Exception; end
|
@@ -99,7 +98,7 @@ class TeXzip::Project < HighLine
|
|
99
98
|
@bib_files.each do |bib_file|
|
100
99
|
bib = BibTeX.open(bib_file.path)
|
101
100
|
bib.replace_strings
|
102
|
-
@bib.add(bib.
|
101
|
+
@bib.add(bib.data)
|
103
102
|
end
|
104
103
|
else
|
105
104
|
@bib = nil
|
@@ -351,27 +350,28 @@ class TeXzip::Project < HighLine
|
|
351
350
|
|
352
351
|
def filter_bibtex
|
353
352
|
if @bib
|
354
|
-
cites = @cites.to_a
|
353
|
+
cites = @cites.to_a.map{|c| c.to_s}
|
355
354
|
seen_cites = cites.to_set
|
356
355
|
until cites.empty?
|
357
356
|
cite = cites.pop
|
358
|
-
|
359
|
-
if
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
357
|
+
entries = @bib[cite]
|
358
|
+
if entries.nil?
|
359
|
+
puts "WARNING: Can't find BibTeX-entry #{cite}"
|
360
|
+
else
|
361
|
+
entries = [entries] unless entries.kind_of? Array
|
362
|
+
entries.each do |entry|
|
363
|
+
crossref = entry["crossref"]
|
364
|
+
if crossref
|
365
|
+
crossref.split(',').map(&:strip).each do |ref|
|
366
|
+
ref = ref.to_s
|
367
|
+
cites << ref if seen_cites.add? ref
|
366
368
|
end
|
367
369
|
end
|
368
370
|
end
|
369
|
-
else
|
370
|
-
puts "WARNING: Can't find BibTeX-entry #{cite}"
|
371
371
|
end
|
372
372
|
end
|
373
373
|
|
374
|
-
@bib = BibTeX::Bibliography.new(
|
374
|
+
@bib = BibTeX::Bibliography.new.add(@bib.data.select{|entry| seen_cites.include? entry.key.to_s})
|
375
375
|
end
|
376
376
|
end
|
377
377
|
|
@@ -391,6 +391,8 @@ class TeXzip::Project < HighLine
|
|
391
391
|
end
|
392
392
|
|
393
393
|
def write_archive( archive_file, force = false )
|
394
|
+
require 'ffi-libarchive'
|
395
|
+
|
394
396
|
archive_file = Pathname.new(archive_file).expand_path
|
395
397
|
return unless ask_overwrite(archive_file)
|
396
398
|
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: texzip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Frank Fischer
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-22 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bibtex-ruby
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
23
|
+
version: 1.3.6
|
24
24
|
- - <
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: "2.0"
|
@@ -78,7 +78,7 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 3.
|
81
|
+
version: 3.7.0
|
82
82
|
type: :development
|
83
83
|
version_requirements: *id006
|
84
84
|
description: |-
|