bibtex-ruby 2.0.12 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bibtex-ruby might be problematic. Click here for more details.

data/Gemfile CHANGED
@@ -5,19 +5,32 @@ gemspec
5
5
  gem 'rdf', '~>0.3'
6
6
 
7
7
  group :debug do
8
- gem 'debugger', :platforms => [:mri_19]
9
- gem 'ruby-debug', :platforms => [:mri_18]
10
- gem 'rbx-trepanning', :platforms => [:rbx]
8
+ gem 'debugger', :require => false, :platforms => [:mri_19]
9
+ gem 'ruby-debug', :require => false, :platforms => [:mri_18]
11
10
  end
12
11
 
13
12
  group :test do
14
- gem 'minitest', :platforms => [:ruby_18, :jruby, :rbx]
15
- gem 'mynyml-redgreen', ['~>0.7']
16
- gem 'autowatchr', ['~>0.1']
13
+ gem 'minitest'
14
+ gem 'minitest-colorize'
17
15
  gem 'cucumber', ['~>1.0']
16
+ gem 'unicode', :platforms => [:mri, :rbx, :mswin, :mingw]
17
+ end
18
+
19
+ group :extra do
20
+ gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
21
+ gem 'guard-minitest'
22
+ gem 'guard-cucumber'
23
+ gem 'redcarpet'
18
24
  end
19
25
 
20
26
  group :profile do
21
27
  gem 'ruby-prof', ['~>0.10'], :platforms => [:mri_19, :mri_19]
22
28
  gem 'gnuplot', ['~>2.4']
23
- end
29
+ gem 'simplecov'
30
+ end
31
+
32
+ group :development do
33
+ gem 'rake'
34
+ gem 'racc'
35
+ gem 'yard'
36
+ end
data/Gemfile.lock CHANGED
@@ -1,89 +1,98 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bibtex-ruby (2.0.12)
4
+ bibtex-ruby (2.1.0)
5
5
  latex-decode (>= 0.0.6)
6
6
  multi_json (~> 1.3)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- addressable (2.2.7)
12
- autowatchr (0.1.5)
13
- watchr
11
+ addressable (2.3.2)
14
12
  builder (3.0.0)
15
- coderay (1.0.5)
16
13
  columnize (0.3.6)
17
- cucumber (1.1.9)
14
+ cucumber (1.2.1)
18
15
  builder (>= 2.1.2)
19
- diff-lcs (>= 1.1.2)
20
- gherkin (~> 2.9.0)
16
+ diff-lcs (>= 1.1.3)
17
+ gherkin (~> 2.11.0)
21
18
  json (>= 1.4.6)
22
- term-ansicolor (>= 1.0.6)
23
- debugger (1.0.0)
19
+ debugger (1.2.0)
24
20
  columnize (>= 0.3.1)
25
- debugger-linecache
26
- debugger-ruby_core_source
27
- debugger-linecache (1.0.1)
28
- debugger-ruby_core_source
29
- debugger-ruby_core_source (1.0.1)
21
+ debugger-linecache (~> 1.1.1)
22
+ debugger-ruby_core_source (~> 1.1.3)
23
+ debugger-linecache (1.1.2)
24
+ debugger-ruby_core_source (>= 1.1.1)
25
+ debugger-ruby_core_source (1.1.3)
30
26
  diff-lcs (1.1.3)
31
- gherkin (2.9.0)
27
+ ffi (1.1.5)
28
+ gherkin (2.11.2)
32
29
  json (>= 1.4.6)
33
- gherkin (2.9.0-java)
34
- json (>= 1.4.6)
35
- gnuplot (2.4.1)
36
- json (1.6.5)
37
- json (1.6.5-java)
30
+ gnuplot (2.5.0)
31
+ guard (1.3.2)
32
+ listen (>= 0.4.2)
33
+ thor (>= 0.14.6)
34
+ guard-cucumber (1.2.0)
35
+ cucumber (>= 1.2.0)
36
+ guard (>= 1.1.0)
37
+ guard-minitest (0.5.0)
38
+ guard (>= 0.4)
39
+ json (1.7.5)
38
40
  latex-decode (0.0.12)
39
41
  unicode (~> 0.4)
40
- latex-decode (0.0.12-java)
41
42
  linecache (0.46)
42
43
  rbx-require-relative (> 0.0.4)
43
- minitest (2.11.3)
44
+ listen (0.4.7)
45
+ rb-fchange (~> 0.0.5)
46
+ rb-fsevent (~> 0.9.1)
47
+ rb-inotify (~> 0.8.8)
48
+ minitest (2.12.1)
49
+ minitest-colorize (0.0.4)
50
+ minitest (~> 2.0)
44
51
  multi_json (1.3.6)
45
- mynyml-redgreen (0.7.1)
46
- term-ansicolor (>= 1.0.4)
47
52
  racc (1.4.8)
48
53
  rake (0.9.2.2)
49
- rbx-linecache (1.3)
50
- rbx-require-relative
54
+ rb-fchange (0.0.5)
55
+ ffi
56
+ rb-fsevent (0.9.1)
57
+ rb-inotify (0.8.8)
58
+ ffi (>= 0.5.0)
51
59
  rbx-require-relative (0.0.9)
52
- rbx-trepanning (0.1.0)
53
- coderay (>= 1.0)
54
- columnize
55
- rbx-linecache (~> 1.3)
56
- rbx-require-relative (>= 0.0.4)
57
- rdf (0.3.5.2)
60
+ rdf (0.3.8)
58
61
  addressable (>= 2.2.6)
59
- rdoc (3.12)
60
- json (~> 1.4)
62
+ redcarpet (2.1.1)
61
63
  ruby-debug (0.10.4)
62
64
  columnize (>= 0.1)
63
65
  ruby-debug-base (~> 0.10.4.0)
64
66
  ruby-debug-base (0.10.4)
65
67
  linecache (>= 0.3)
66
- ruby-prof (0.10.8)
67
- term-ansicolor (1.0.7)
68
- unicode (0.4.2)
69
- watchr (0.7)
68
+ ruby-prof (0.11.2)
69
+ simplecov (0.6.4)
70
+ multi_json (~> 1.0)
71
+ simplecov-html (~> 0.5.3)
72
+ simplecov-html (0.5.3)
73
+ thor (0.16.0)
74
+ unicode (0.4.3)
75
+ yard (0.8.2.1)
70
76
 
71
77
  PLATFORMS
72
- java
73
78
  ruby
74
79
 
75
80
  DEPENDENCIES
76
- autowatchr (~> 0.1)
77
81
  bibtex-ruby!
78
82
  cucumber (~> 1.0)
79
83
  debugger
80
84
  gnuplot (~> 2.4)
85
+ guard-cucumber
86
+ guard-minitest
81
87
  minitest
82
- mynyml-redgreen (~> 0.7)
83
- racc (~> 1.4)
84
- rake (~> 0.9)
85
- rbx-trepanning
88
+ minitest-colorize
89
+ racc
90
+ rake
91
+ rb-fsevent
86
92
  rdf (~> 0.3)
87
- rdoc (~> 3.9)
93
+ redcarpet
88
94
  ruby-debug
89
95
  ruby-prof (~> 0.10)
96
+ simplecov
97
+ unicode
98
+ yard
data/Guardfile ADDED
@@ -0,0 +1,20 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'cucumber' do
5
+ watch(%r{^features/.+\.feature$})
6
+ watch(%r{^features/support/.+$}) { 'features' }
7
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
8
+ end
9
+
10
+ guard 'minitest' do
11
+ # with Minitest::Unit
12
+ watch(%r|^test/(.*)\/?test_(.*)\.rb|)
13
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
14
+ watch(%r|^test/helper\.rb|) { 'test' }
15
+
16
+ # with Minitest::Spec
17
+ # watch(%r|^spec/(.*)_spec\.rb|)
18
+ # watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
19
+ # watch(%r|^spec/spec_helper\.rb|) { "spec" }
20
+ end
data/History.txt CHANGED
@@ -1,6 +1,9 @@
1
- 2.0.11 / 2012-05-23
2
- ===================
1
+ 2.1.0 / 2012-08-31
2
+ ==================
3
3
 
4
+ * Improved query support
5
+ * Use Travis-CI
6
+ * Updated dependencies
4
7
  * Bug fixes and 1.8 compatibility (@RubenVerborgh)
5
8
 
6
9
  2.0.11 / 2012-05-23
data/Manifest CHANGED
@@ -1,11 +1,11 @@
1
1
  Gemfile
2
2
  Gemfile.lock
3
+ Guardfile
3
4
  History.txt
4
5
  LICENSE
5
6
  Manifest
6
7
  README.md
7
8
  Rakefile
8
- auto.watchr
9
9
  bibtex-ruby.gemspec
10
10
  examples
11
11
  examples/bib2html.rb
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  BibTeX-Ruby
2
2
  ===========
3
+ [![Build Status](https://secure.travis-ci.org/inukshuk/bibtex-ruby.png?branch=master)](http://travis-ci.org/inukshuk/bibtex-ruby)
3
4
 
4
5
  BibTeX-Ruby is the Rubyist's swiss-army-knife for all things BibTeX. It
5
- includes a parser for all common BibTeX objects (@string, @preamble,
6
- @comment and regular entries) and a sophisticated name parser that
7
- tokenizes correctly formatted names; BibTeX-Ruby recognizes BibTeX string
8
- replacements, joins values containing multiple strings or variables,
9
- supports cross-references, and decodes common LaTeX formatting
10
- instructions to unicode; if you are in a hurry, it also allows for easy
11
- export/conversion to formats such as YAML, JSON, CiteProc/CSL, and
12
- XML (BibTeXML).
6
+ includes a parser for all common BibTeX objects (@string, @preamble, @comment
7
+ and regular entries) and a sophisticated name parser that tokenizes correctly
8
+ formatted names; BibTeX-Ruby recognizes BibTeX string replacements, joins
9
+ values containing multiple strings or variables, supports cross-references,
10
+ and decodes common LaTeX formatting instructions to unicode; if you are in a
11
+ hurry, it also allows for easy export/conversion to formats such as YAML,
12
+ JSON, CiteProc/CSL, XML (BibTeXML), and RDF (experimental).
13
13
 
14
14
  For a list of projects using BibTeX-Ruby, take a look at the
15
15
  [project wiki](https://github.com/inukshuk/bibtex-ruby/wiki/Projects-Using-BibTeX-Ruby).
@@ -17,7 +17,6 @@ For a list of projects using BibTeX-Ruby, take a look at the
17
17
 
18
18
  Quickstart
19
19
  ----------
20
-
21
20
  Install and load BibTeX-Ruby in an IRB session:
22
21
 
23
22
  $ [sudo] gem install bibtex-ruby
@@ -96,10 +95,8 @@ Save a bibliography to a file:
96
95
  #=> saves the bibliography in a new file
97
96
 
98
97
 
99
-
100
98
  Compatibility
101
99
  -------------
102
-
103
100
  The BibTeX-Ruby gem has been developed and tested on Ruby 1.8 and 1.9; it has
104
101
  been confirmed to work with JRuby, Rubinius, and REE, however, there have
105
102
  been repeated [issues](https://github.com/inukshuk/bibtex-ruby/issues)
@@ -107,18 +104,17 @@ been repeated [issues](https://github.com/inukshuk/bibtex-ruby/issues)
107
104
  implementation.
108
105
 
109
106
 
110
-
111
107
  Documentation
112
108
  -------------
113
-
114
109
  It is very easy to use BibTeX-Ruby. You can use the top level utility methods
115
- **BibTeX.open** and **BibTeX.parse** to open a '.bib' file or to parse a string
116
- containing BibTeX contents. By default, BibTeX-Ruby will discard all text outside
117
- of regular BibTeX elements; however, if you wish to include everything, simply add
118
- `:include => [:meta_content]` to your invocation of **BibTeX.open** or **BibTeX.parse**.
110
+ **BibTeX.open** and **BibTeX.parse** to open a '.bib' file or to parse a
111
+ string containing BibTeX contents. By default, BibTeX-Ruby will discard all
112
+ text outside of regular BibTeX elements; however, if you wish to include
113
+ everything, simply add `:include => [:meta_content]` to your invocation of
114
+ **BibTeX.open** or **BibTeX.parse**.
119
115
 
120
- Once BibTeX-Ruby has parsed your '.bib' file, you can easily access individual entries.
121
- For example, if you set up your bibliography as follows:
116
+ Once BibTeX-Ruby has parsed your '.bib' file, you can easily access individual
117
+ entries. For example, if you set up your bibliography as follows:
122
118
 
123
119
  b = BibTeX.parse <<-END
124
120
  @book{pickaxe,
@@ -130,20 +126,23 @@ For example, if you set up your bibliography as follows:
130
126
  year = {2009}
131
127
  }
132
128
  END
133
-
134
- You could easily access it, using the entry's key, 'pickaxe', like so: `b[:pickaxe]`;
135
- you also have easy access to individual fields, for example: `b[:pickaxe][:author]`.
136
- Alternatively, BibTeX-Ruby accepts ghost methods to conveniently access an entry's fields,
137
- similar to **ActiveRecord::Base**. Therefore, it is equally possible to access the
138
- 'author' field above as `b[:pickaxe].author`.
139
129
 
140
- BibTeX-Ruby wraps all values of fields in an entry are wrapped in Value objects.
141
- This is necessary to transparently handle different types of values (e.g., strings,
142
- dates, names etc.). These Value objects are designed to be hardly discernible
143
- from regular Ruby strings, however, if you ever run into a problem with a field's
144
- value, simply convert it to a string by calling the `#to_s` method.
130
+ You could easily access it, using the entry's key, 'pickaxe', like so:
131
+ `b[:pickaxe]`; you also have easy access to individual fields, for example:
132
+ `b[:pickaxe][:author]`. Alternatively, BibTeX-Ruby accepts ghost methods to
133
+ conveniently access an entry's fields, similar to **ActiveRecord::Base**.
134
+ Therefore, it is equally possible to access the 'author' field above as
135
+ `b[:pickaxe].author`.
136
+
137
+ BibTeX-Ruby wraps all values of fields in an entry are wrapped in Value
138
+ objects. This is necessary to transparently handle different types of values
139
+ (e.g., strings, dates, names etc.). These Value objects are designed to be
140
+ hardly discernible from regular Ruby strings, however, if you ever run into a
141
+ problem with a field's value, simply convert it to a string by calling the
142
+ `#to_s` method.
145
143
 
146
- Instead of parsing strings you can also create BibTeX elements directly in Ruby:
144
+ Instead of parsing strings you can also create BibTeX elements directly in
145
+ Ruby:
147
146
 
148
147
  > bib = BibTeX::Bibliography.new
149
148
 
@@ -173,10 +172,11 @@ Or programmatically:
173
172
 
174
173
  ### Cross References
175
174
 
176
- From version 2.0, BibTeX-Ruby correctly resolves entry cross-references, which
177
- are commonly used for entries with type `inbook`, `incollection`, and
178
- `inproceedings`. When an entry has a valid citation key in the field `crossref`,
179
- BibTeX-Ruby will return any fields inherited from the parent entry:
175
+ From version 2.0, BibTeX-Ruby correctly resolves entry cross-references,
176
+ which are commonly used for entries with type `inbook`, `incollection`,
177
+ and `inproceedings`. When an entry has a valid citation key in the field
178
+ `crossref`, BibTeX-Ruby will return any fields inherited from the parent
179
+ entry:
180
180
 
181
181
  > b = BibTeX.parse <<-END
182
182
  @inbook{fraassen_1989b,
@@ -298,12 +298,12 @@ A shorthand version for replacing all strings in a given bibliography is the
298
298
 
299
299
  ### Names
300
300
 
301
- Since version 1.3, BibTeX-Ruby features a name parser. You can use the top-level
302
- `BibTeX.names` utility to quickly parse individual name values. Alternatively,
303
- you can call `Bibliography.parse_names` to convert all name fields contained
304
- in the bibliography. When parsing BibTeX files, BibTeX-Ruby will automatically
305
- convert names; if you do not want the names to be parsed you can set the
306
- `:parse_names` parser option to false.
301
+ Since version 1.3, BibTeX-Ruby features a name parser. You can use the
302
+ top-level `BibTeX.names` utility to quickly parse individual name values.
303
+ Alternatively, you can call `Bibliography.parse_names` to convert all name
304
+ fields contained in the bibliography. When parsing BibTeX files, BibTeX-Ruby
305
+ will automatically convert names; if you do not want the names to be parsed
306
+ you can set the `:parse_names` parser option to false.
307
307
 
308
308
  Note that the string replacement and concatenation features described above
309
309
  are not supported for name objects; therefore, BibTeX-Ruby tries to replace
@@ -391,20 +391,20 @@ by passing the `:filter` option:
391
391
  Furthermore, BibTeX-Ruby allows you to export your bibliography for processing
392
392
  by other tools. Currently supported formats include YAML, JSON, and XML.
393
393
 
394
- Of course, you can also export your bibliography back to BibTeX; if you include
395
- `:meta_content', your export should be identical to the original '.bib' file,
396
- except for whitespace, blank lines and letter case (BibTeX-Ruby will downcase
397
- all keys).
394
+ Of course, you can also export your bibliography back to BibTeX; if you
395
+ include `:meta_content', your export should be identical to the original
396
+ '.bib' file, except for whitespace, blank lines and letter case (BibTeX-Ruby
397
+ will downcase all keys).
398
398
 
399
- In order to export your bibliography use **#to\_s**, **#to\_yaml**, **#to\_json**, or
400
- **#to\_xml**, respectively. For example, the following line constitutes a simple
401
- BibTeX to YAML converter:
399
+ In order to export your bibliography use **#to\_s**, **#to\_yaml**,
400
+ **#to\_json**, or **#to\_xml**, respectively. For example, the following line
401
+ constitutes a simple BibTeX to YAML converter:
402
402
 
403
403
  >> BibTeX.open('example.bib').to_yaml
404
404
 
405
405
  Starting with version 2.0, BibTeX-Ruby's `#to_xml` exports your bibliography
406
406
  to the [BibTeXML](http//bibtexml.sf.net/) format. By passing the option
407
- `:extended => true` you can make use of the BibTeXML's extended format which
407
+ `:extended => true` you can make use of the BibTeXML's extended format which
408
408
  will return individual person elements and name tokens (provided you have
409
409
  successfully parsed the names of your bibliography).
410
410
 
@@ -448,21 +448,20 @@ and writes the following XML to standard out:
448
448
  </bibtex:entry>
449
449
  </bibtex:file>
450
450
 
451
- Look at the 'examples' directory for more elaborate examples of a BibTeX to YAML
452
- and a BibTeX to HTML converter using **#to_citeproc** to format a bibliography
453
- using [CSL](http://citationstyles.org/).
451
+ Look at the 'examples' directory for more elaborate examples of a BibTeX to
452
+ YAML and a BibTeX to HTML converter using **#to_citeproc** to format a
453
+ bibliography using [CSL](http://citationstyles.org/).
454
454
 
455
455
  BibTeX-Ruby offers an API which lets you manipulate BibTeX objects (string
456
456
  replacement, name parsing etc.); however, sometimes you just want quick access
457
457
  to your bibliography's contents. In these cases the **to_hash** method is
458
- useful (use **to_a** if you are only interested in the bibliography's contents):
459
- it converts all objects into simple Ruby hashes made up of symbols
458
+ useful (use **to_a** if you are only interested in the bibliography's
459
+ contents): it converts all objects into simple Ruby hashes made up of symbols
460
460
  and strings. Furthermore, often you would like to control what sort of quotes
461
- are used in an export;
462
- therefore, all conversion methods accept an options hash which lets you define
463
- what quotes to use (note that BibTeX-Ruby will always use regular double
464
- quotes if a value consists of more than one token, because these tokens will
465
- be concatenated using BibTeX's '#' operator).
461
+ are used in an export; therefore, all conversion methods accept an options
462
+ hash which lets you define what quotes to use (note that BibTeX-Ruby will
463
+ always use regular double quotes if a value consists of more than one token,
464
+ because these tokens will be concatenated using BibTeX's '#' operator).
466
465
 
467
466
  >> BibTeX.parse(<<-END).to_a # implies: :quotes => ['{','}']
468
467
  @book{pickaxe,
@@ -496,7 +495,6 @@ quotes; therefore you can simply add the :quotes option with an empty string:
496
495
 
497
496
  The Parser
498
497
  ----------
499
-
500
498
  The BibTeX-Ruby parser is generated using the awesome
501
499
  [racc](http://i.loveruby.net/en/projects/racc/) parser generator. You can take
502
500
  look at the LALR grammar in the file
@@ -508,7 +506,6 @@ For more information about the BibTeX format and the parser's idiosyncrasies
508
506
 
509
507
  Contributing
510
508
  ------------
511
-
512
509
  The BibTeX-Ruby source code is
513
510
  [hosted on GitHub](http://github.com/inukshuk/bibtex-ruby/).
514
511
  You can check out a copy of the latest code using Git:
@@ -532,12 +529,11 @@ the bibtex-ruby directory):
532
529
 
533
530
  $ [sudo] gem install bundler
534
531
  $ [sudo] bundle install
535
- $ bundle exec cucumber
536
- $ bundle exec rake test
532
+ $ bundle exec rake
537
533
 
538
534
  To execute the test suite continuously while you're working run:
539
535
 
540
- $ bundle exec watchr auto.watchr
536
+ $ bundle exec guard
541
537
 
542
538
 
543
539
 
@@ -546,9 +542,8 @@ Credits
546
542
 
547
543
  Copyright 2011-2012 [Sylvester Keil](http://sylvester.keil.or.at/).
548
544
 
549
- See the [contributor page on GitHub](https://github.com/inukshuk/bibtex-ruby/contributors)
550
- for a list of all the awesome developers who have made BibTeX-Ruby
551
- possible.
545
+ Kudos to all [contributors](https://github.com/inukshuk/bibtex-ruby/contributors)
546
+ who have made BibTeX-Ruby possible.
552
547
 
553
- This software is distributed under the terms and conditions of the GNU GPL. See
554
- LICENSE for details.
548
+ This software is distributed under the terms and conditions of the GNU GPL.
549
+ See LICENSE for details.