scholar-rename 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9b153f14e13357deb803a4c2f710541a9ce57d0
4
- data.tar.gz: 33818a84b0aa7ee8855ab1752e22586fec361b61
3
+ metadata.gz: d039aaa0b17ca8cbc90f85c2451bddece6057ddb
4
+ data.tar.gz: 4815af5eb0879eeabd6cae2b460e2bc9ddde8676
5
5
  SHA512:
6
- metadata.gz: 4f0aa16507883b264b58ee8a854df972e912eaae734a1eb1d4e1e5ffc0aa7b56ac2bb1bf9173615b037b4a747cffaf6421b5ce3765241d92e87ad6bb7ae7e0fa
7
- data.tar.gz: f1d35d6a5bbebcd7bbeca64541a9208e351be8ad1bac4d71193a1e7b29bd3c685722d9362b6e0e690ce3f7a7d8dddd8c5f35824be33a4775a6df92abcfb8d560
6
+ metadata.gz: 0e1b4510e462585608e88f6058c22565ca572d66dc55dcc4fb2858bb885800aa40094282b7a16cf9599f68132edfb5d19a8ecde839d3800e864d2a3acda41bea
7
+ data.tar.gz: 77bdc55ea52ac0c6fd3deff70ac13e61b8dd10419c986582f899ea566ca072e77a4451ee3e7f77e3f98cfb001d22d0f7b3d1680eeff0b0b7f48b68056ce96390
data/bin/scholar-rename CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  # by jeremy warner, fall 2016
4
4
  # scholar-rename, interactive pdf-namer
5
+
5
6
  # prereq: pdftotext installation for text dump
6
7
  # renames a pdf file to author-title-year.pdf
7
8
  # or other formats based on your selection
@@ -10,4 +11,4 @@
10
11
  require_relative '../lib/selector'
11
12
  require_relative '../lib/renamer'
12
13
 
13
- r = Renamer.new ARGV
14
+ Renamer.new ARGV
data/lib/renamer.rb CHANGED
@@ -1,9 +1,12 @@
1
1
  class Renamer
2
2
  def initialize(*args)
3
- @file = File.join(Dir.pwd, args.first)
3
+ a1 = args.first
4
+ @file = File.join(Dir.pwd, a1)
4
5
 
5
6
  if @file == Dir.pwd.to_s + '/'
6
7
  puts "scholar-rename: provide a file"
8
+ elsif a1 == "-v"
9
+ puts SR::Version
7
10
  else
8
11
  rename
9
12
  end
@@ -22,7 +25,7 @@ class Renamer
22
25
  conf = STDIN.gets.chomp # confirm title
23
26
 
24
27
  begin # file read in from first ARGV above
25
- File.rename(@file, s.title) unless conf.match /^(n|N).*/
28
+ File.rename(@file, s.title) unless conf.match(/^(n|N).*/)
26
29
  ensure # cleaning up @file cleanup from pdftotext
27
30
  puts "Cleaning up..."
28
31
  File.delete(temp)
data/lib/selector.rb CHANGED
@@ -49,7 +49,7 @@ class Selector
49
49
  # Generate different forms for author selection, enumerating the different
50
50
  # author that you want to save the file as. Split based on a comma.
51
51
  def gen_authors(aline)
52
- lines = aline.split(", ").map {|a| a.sub /\d$/, '' } # delete ref number.
52
+ lines = aline.split(", ").map {|a| a.sub(/\d$/, '') } # delete ref number.
53
53
  if lines.is_a?(String)
54
54
  aline # return first
55
55
  else # its an array, augment w/ lname and choose
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- module SR; Version = "0.1.1"; end
1
+ module SR; Version = "0.1.2"; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scholar-rename
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Warner