texzip 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/History.txt +4 -0
  2. data/Rakefile +1 -1
  3. data/lib/texzip/Project.rb +16 -14
  4. data/version.txt +1 -1
  5. metadata +4 -4
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.5 / 2011-06-22
2
+ * compatibility with bibtex-parser >= 1.3.6
3
+ * require ffi-libarchive only if necessary
4
+
1
5
  == 0.1.4 / 2011-04-20
2
6
  * Scan all files at once instead of linewise to deal with commands
3
7
  over multiple lines
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.2.1', '< 2.0']
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'
@@ -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.to_a)
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
- entry = @bib[cite]
359
- if entry
360
- crossref = entry["crossref"]
361
- if crossref
362
- crossref.split(',').map(&:strip).each do |ref|
363
- if seen_cites.add? ref
364
- cites << ref
365
- seen_cites << ref
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( @bib.to_a.select{|entry| seen_cites.include? entry.key} )
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.4
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.4
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-04-20 00:00:00 Z
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.2.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.6.5
81
+ version: 3.7.0
82
82
  type: :development
83
83
  version_requirements: *id006
84
84
  description: |-