pdfmd 2.1.5 → 2.1.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +11 -0
- data/bin/pdfmd +21 -16
- data/img/workflow.png +0 -0
- data/img/workflow_200.png +0 -0
- data/img/workflow_500.png +0 -0
- metadata +7 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e2ba1b3dab8288ed43b930c7e27b1754fc436f5
|
|
4
|
+
data.tar.gz: b2a0cfb407738c31d9b465bc2711b7c2b04ff650
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d02be348bfe4301f09e3ca7e093c4d4585968f8229e56b759903ae2822b4a072f6030de75976f261a1c0ccccfe605988d01b71b22e49cb17bf645e20e0a60beb
|
|
7
|
+
data.tar.gz: 31051acfda07bd823eede7653917b74404e4d55948fd9b057156a4d082bda8697c56125777924034dfc5e4a84d7797d797c66711694fa42d4c83711866551954
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -6,6 +6,15 @@ Hidden deep in the directory structure of my disks I can quickly find the
|
|
|
6
6
|
documents I need with a quick `find /document/path -type f -iname
|
|
7
7
|
'*<keyword>*'` which matches some string in the filename.
|
|
8
8
|
|
|
9
|
+
## Workflow
|
|
10
|
+
 My workflow is as follow:
|
|
11
|
+
A) Scan the document. I use a small script for this to scan in color, black-white or grayscale. Generally all scans are black-white/300dpi. Documents with handwriting on them end up in grayscale and rarely i use color scans.
|
|
12
|
+
Documents end up as two-sided if there's a two sided print on it, otherwise not.
|
|
13
|
+
B) The scanned document is saved as pdf document, no caring about the naming.
|
|
14
|
+
C) That is where `pdfmd` comes in. Using `pdfmd` metadata is asked from me to provide. While going through the interactive menu, the document is opened, so it's easier for me to see which document I am working on.
|
|
15
|
+
D) The pdf document is updated with the metadata and automatically renamed according to a general naming scheme. That way the document gets uniq and is easy to find on the filesystem level.
|
|
16
|
+
E) The document gets automatically sorted away into a folder structure somewhere else on the system.
|
|
17
|
+
|
|
9
18
|
# Requirements
|
|
10
19
|
|
|
11
20
|
Although the requirements are listed in the script itself as well (header documentation!), here they are again:
|
|
@@ -154,3 +163,5 @@ $ hiera pdfmd::config
|
|
|
154
163
|
|
|
155
164
|
If you have improvements and suggestions -> let me know.
|
|
156
165
|
If you can help me writing tests for this, please let me know as well.
|
|
166
|
+
|
|
167
|
+
Icons and symbols from [www.opensymbols.org](http://www.opensymbols.org).
|
data/bin/pdfmd
CHANGED
|
@@ -7,7 +7,7 @@ require "fileutils"
|
|
|
7
7
|
require "i18n"
|
|
8
8
|
require 'pathname'
|
|
9
9
|
|
|
10
|
-
VERSION = '2.1.
|
|
10
|
+
VERSION = '2.1.6'
|
|
11
11
|
NAME = 'pdfmd'
|
|
12
12
|
|
|
13
13
|
#
|
|
@@ -207,30 +207,35 @@ method_option :copy, :aliases => '-c', :required => false, :type => :boolean, :d
|
|
|
207
207
|
method_option :interactive, :aliases => '-i', :required => false, :type => :boolean, :desc => 'Enable/Disable interactive sorting'
|
|
208
208
|
method_option :overwrite, :alises => '-o', :required => false, :type => :boolean, :desc => 'Enable/Disable file overwrite.', :lazy_default => true
|
|
209
209
|
method_option :dryrun, :aliases => '-n', :required => false, :type => :boolean, :desc => 'Run without changing something'
|
|
210
|
-
def sort(input)
|
|
210
|
+
def sort(*input)
|
|
211
211
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
pdfdoc.destination = pdfdoc.determineValidSetting(options[:destination], 'sort:destination')
|
|
217
|
-
pdfdoc.overwrite = pdfdoc.determineValidSetting(options[:overwrite], 'sort:overwrite')
|
|
218
|
-
pdfdoc.dryrun = pdfdoc.determineValidSetting(options[:dryrun], 'sort:dryrun')
|
|
219
|
-
pdfdoc.sort
|
|
220
|
-
else
|
|
221
|
-
|
|
222
|
-
# Run the actions for all files
|
|
223
|
-
Dir.glob(input.chomp + '/*.pdf').each do |filename|
|
|
224
|
-
pdfdoc = Pdfmdsort.new filename
|
|
212
|
+
input.each do |file|
|
|
213
|
+
|
|
214
|
+
if File.file?(file)
|
|
215
|
+
pdfdoc = Pdfmdsort.new file
|
|
225
216
|
pdfdoc.copy = pdfdoc.determineValidSetting(options[:copy], 'sort:copy')
|
|
226
217
|
pdfdoc.interactive = pdfdoc.determineValidSetting(options[:interactive], 'sort:interactive')
|
|
227
218
|
pdfdoc.destination = pdfdoc.determineValidSetting(options[:destination], 'sort:destination')
|
|
228
219
|
pdfdoc.overwrite = pdfdoc.determineValidSetting(options[:overwrite], 'sort:overwrite')
|
|
229
220
|
pdfdoc.dryrun = pdfdoc.determineValidSetting(options[:dryrun], 'sort:dryrun')
|
|
230
221
|
pdfdoc.sort
|
|
222
|
+
|
|
223
|
+
else
|
|
224
|
+
|
|
225
|
+
# Run the actions for all files
|
|
226
|
+
Dir.glob(input.chomp + '/*.pdf').each do |filename|
|
|
227
|
+
pdfdoc = Pdfmdsort.new filename
|
|
228
|
+
pdfdoc.copy = pdfdoc.determineValidSetting(options[:copy], 'sort:copy')
|
|
229
|
+
pdfdoc.interactive = pdfdoc.determineValidSetting(options[:interactive], 'sort:interactive')
|
|
230
|
+
pdfdoc.destination = pdfdoc.determineValidSetting(options[:destination], 'sort:destination')
|
|
231
|
+
pdfdoc.overwrite = pdfdoc.determineValidSetting(options[:overwrite], 'sort:overwrite')
|
|
232
|
+
pdfdoc.dryrun = pdfdoc.determineValidSetting(options[:dryrun], 'sort:dryrun')
|
|
233
|
+
pdfdoc.sort
|
|
234
|
+
end
|
|
235
|
+
|
|
231
236
|
end
|
|
232
237
|
|
|
233
|
-
end
|
|
238
|
+
end # End of input array loop
|
|
234
239
|
|
|
235
240
|
end
|
|
236
241
|
|
data/img/workflow.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pdfmd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Roos
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-09-
|
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -107,6 +107,9 @@ files:
|
|
|
107
107
|
- Rakefile
|
|
108
108
|
- TODO.mkd
|
|
109
109
|
- bin/pdfmd
|
|
110
|
+
- img/workflow.png
|
|
111
|
+
- img/workflow_200.png
|
|
112
|
+
- img/workflow_500.png
|
|
110
113
|
- lib/pdfmd.rb
|
|
111
114
|
- lib/pdfmd/.pdfmd.log
|
|
112
115
|
- lib/pdfmd/explain.author.md
|
|
@@ -147,8 +150,8 @@ homepage: https://github.com/Micronarrativ/ruby-pmd
|
|
|
147
150
|
licenses:
|
|
148
151
|
- MIT
|
|
149
152
|
metadata:
|
|
150
|
-
created: '2015-09-
|
|
151
|
-
revision: '
|
|
153
|
+
created: '2015-09-21 21:06:09'
|
|
154
|
+
revision: '20150921210609'
|
|
152
155
|
post_install_message: ". Run `pdfmd` to see the command help."
|
|
153
156
|
rdoc_options: []
|
|
154
157
|
require_paths:
|