bibtex-ruby 2.2.1 → 2.2.2
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.
Potentially problematic release.
This version of bibtex-ruby might be problematic. Click here for more details.
- data/Gemfile.lock +1 -1
- data/History.txt +5 -0
- data/README.md +28 -0
- data/lib/bibtex/entry.rb +11 -3
- data/lib/bibtex/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -346,6 +346,34 @@ Use with caution, though, as this method will treat names as identical
|
|
346
346
|
as long as their initials are the same. That is to say, 'Poe, Eric A.' would
|
347
347
|
be extend to 'Poe, Edgar Allen'.
|
348
348
|
|
349
|
+
### Duplicates
|
350
|
+
|
351
|
+
Large bibliographies often contain duplicate data, i.e., duplicate entries
|
352
|
+
which are not completely identical (e.g., authors or editors with first
|
353
|
+
names or initials, titles using different casing, different keywords etc.).
|
354
|
+
BibTex-Ruby allows you to group your bibliography by any number of fields
|
355
|
+
in order to detect such duplicate entries.
|
356
|
+
|
357
|
+
b.select_duplicates_by :year, :title
|
358
|
+
#=> groups the bibliography by using the year and title field as key
|
359
|
+
|
360
|
+
b.duplicates?
|
361
|
+
#=> whether or not the bibliography contains any duplicates
|
362
|
+
|
363
|
+
For more complex requirements you can use the `#group_by` method directly.
|
364
|
+
This methods accepts a list of arguments whose value will be used for grouping
|
365
|
+
and, additionally, a block. The current digest and each individual entry will
|
366
|
+
be passed to the block and the block's return value is used as the final
|
367
|
+
digest.
|
368
|
+
|
369
|
+
The duplicate methods above, for example, do something like this:
|
370
|
+
|
371
|
+
group_by(:year, :title) do |digest, entry|
|
372
|
+
digest.gsub(/\s+/, '').downcase
|
373
|
+
end
|
374
|
+
|
375
|
+
You can use this method, for example, to match entries only by their author's
|
376
|
+
last name and so on and so forth.
|
349
377
|
|
350
378
|
### Filters
|
351
379
|
|
data/lib/bibtex/entry.rb
CHANGED
@@ -77,6 +77,7 @@ module BibTeX
|
|
77
77
|
url URL
|
78
78
|
doi DOI
|
79
79
|
year issued
|
80
|
+
type genre
|
80
81
|
}.map(&:intern)]).freeze
|
81
82
|
|
82
83
|
CSL_FIELDS = %w{ abstract annote archive archive_location archive-place
|
@@ -696,10 +697,17 @@ module BibTeX
|
|
696
697
|
hash[CSL_FILTER[k].to_s] = v.to_citeproc(options) unless DATE_FIELDS.include?(k)
|
697
698
|
end
|
698
699
|
|
699
|
-
|
700
|
+
hash['id'] = key.to_s
|
701
|
+
hash['type'] = CSL_TYPES[type].to_s
|
700
702
|
|
701
|
-
|
702
|
-
|
703
|
+
case type
|
704
|
+
when :mastersthesis
|
705
|
+
hash['genre'] = "Master's thesis"
|
706
|
+
when :phdthesis
|
707
|
+
hash['genre'] = 'PhD thesis'
|
708
|
+
else
|
709
|
+
# empty
|
710
|
+
end unless hash.key?('genre')
|
703
711
|
|
704
712
|
hash['issued'] = citeproc_date
|
705
713
|
|
data/lib/bibtex/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bibtex-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: latex-decode
|
@@ -162,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
segments:
|
164
164
|
- 0
|
165
|
-
hash: -
|
165
|
+
hash: -2827953330493505322
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
none: false
|
168
168
|
requirements:
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash: -
|
174
|
+
hash: -2827953330493505322
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
177
|
rubygems_version: 1.8.24
|