bibsync 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibsync/actions/synchronize_files.rb +9 -4
- data/lib/bibsync/command.rb +4 -0
- data/lib/bibsync/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfc84d8c85a184b1e40e20bce407ebe42ab97dae
|
4
|
+
data.tar.gz: 2b17e69c62a67a2fd1fe92391ab3f8a256d40945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b7deebd3df2fe20949d2abc47630d47143d36e44ad2a4ced0c5fc6435801f8d63932bb3a21cda2ba18697202cddcc43a20a70941cf15f551773feda4772201f
|
7
|
+
data.tar.gz: 3be3be46771336ee5c8dcca8fa8345710d71b0c079af2110e12145e764253f07b39894bf04436f48e7d86e591afb069c546f27de08936de0889dcd5e9d73fef4
|
@@ -9,17 +9,22 @@ module BibSync
|
|
9
9
|
def initialize(options)
|
10
10
|
raise 'Option --bib is required' unless @bib = options[:bib]
|
11
11
|
raise 'Option --dir is required' unless @dir = options[:dir]
|
12
|
+
@dir = File.join(@dir, '**') unless options[:non_recursive]
|
12
13
|
end
|
13
14
|
|
14
15
|
def run
|
15
16
|
notice 'Synchronize with files'
|
16
17
|
|
17
18
|
files = {}
|
18
|
-
Dir[File.join(@dir, "
|
19
|
+
Dir[File.join(@dir, "*.{#{FileTypes.join(',')}}")].sort.each do |file|
|
19
20
|
name = File.basename(file)
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
if name =~ /\A[\w\.\-]+\Z/
|
22
|
+
key = name_without_ext(name)
|
23
|
+
raise "Duplicate file #{name}" if files[key]
|
24
|
+
files[key] = file
|
25
|
+
else
|
26
|
+
warning('File with invalid name', key: name)
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
files.each do |key, file|
|
data/lib/bibsync/command.rb
CHANGED
@@ -34,6 +34,10 @@ module BibSync
|
|
34
34
|
@options[:dir] = dir
|
35
35
|
end
|
36
36
|
|
37
|
+
opts.on('-n', '--non-recursive', 'Don\'t scan recursively') do |dir|
|
38
|
+
@options[:non_recursive] = true
|
39
|
+
end
|
40
|
+
|
37
41
|
opts.on('-v', '--check-versions', 'Check for updated arXiv papers') do
|
38
42
|
@options[:check_versions] = true
|
39
43
|
end
|
data/lib/bibsync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bibsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Mendler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project: bibsync
|
142
|
-
rubygems_version: 2.0.
|
142
|
+
rubygems_version: 2.0.0
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: BibSync is a tool to synchronize scientific papers and BibTeX bibliography
|