pdfmd 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/bin/pdfmd +1 -1
- data/lib/pdfmd.rb +2 -2
- data/lib/pdfmd/long_desc.pdfmdedit.txt +2 -0
- data/lib/pdfmd/pdfmdedit.rb +21 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e948a9ca9e518fe87c5e1f9125710e66b7d33209
|
4
|
+
data.tar.gz: 21ba2f5f0a12d8946ab842c31cafa72aa3c1322b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f774d40abdfbc4ae0cf5428026a1183f8578c2dfeefa12353a6d651f4f65fb37f18de0d84d7eb9637c5d98080513a6d1c8027461f0e9bbb5367442e1e6a65677
|
7
|
+
data.tar.gz: 8d5bc461ecca0b1ecf227ea74d67dadb3ccfc29d88f7b1bd662243d4477854aded0a798f71e9e257e630328a01d7b1088c5e41df414a6169421850b2b5d28ec6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# Version 2.3.1
|
2
|
+
- Fixing log typos.
|
3
|
+
- Fixing Issue #4, 'Input files with spaces in filename'.
|
4
|
+
- Suppressing errors from the PDF viewer.
|
5
|
+
- Setting old document date when no date is provided by user.
|
6
|
+
|
1
7
|
# Version 2.3.0
|
2
8
|
- Adding hiera parameter 'dest_create' to command `sort`.
|
3
9
|
|
data/bin/pdfmd
CHANGED
data/lib/pdfmd.rb
CHANGED
@@ -117,8 +117,8 @@ class Pdfmd
|
|
117
117
|
end
|
118
118
|
|
119
119
|
if not File.file?(filename)
|
120
|
-
self.log('error', "
|
121
|
-
puts "Cannot access file '#{filename}'. Abort"
|
120
|
+
self.log('error', "Cannot access file '#{filename}'.")
|
121
|
+
puts "Cannot access file for reading metatags '#{filename}'. Abort"
|
122
122
|
abort
|
123
123
|
end
|
124
124
|
|
@@ -150,6 +150,8 @@ yyyy:mm:dd
|
|
150
150
|
|
151
151
|
- When providing and invalid date, the incorrect date is rejected and the user asked to provide the correct date.
|
152
152
|
|
153
|
+
- When no date is provided, the current date value is used. It is not possible to empty the date value field.
|
154
|
+
|
153
155
|
|
154
156
|
|
155
157
|
== Rename file
|
data/lib/pdfmd/pdfmdedit.rb
CHANGED
@@ -18,7 +18,7 @@ class Pdfmdedit < Pdfmd
|
|
18
18
|
def start_viewer(filename = '', viewer = '')
|
19
19
|
if File.exists?(filename) and !viewer.empty?
|
20
20
|
|
21
|
-
pid = IO.popen("#{viewer} #{filename}")
|
21
|
+
pid = IO.popen("#{viewer} '#{filename}' 2>&1")
|
22
22
|
self.log('debug', "Application '#{viewer}' with PID #{pid.pid} started to show file '#{filename}'.")
|
23
23
|
pid.pid
|
24
24
|
|
@@ -114,15 +114,33 @@ class Pdfmdedit < Pdfmd
|
|
114
114
|
end
|
115
115
|
|
116
116
|
puts 'Changing ' + key.capitalize + ', current value: ' + @@metadata[key].to_s
|
117
|
+
|
118
|
+
# Save the current value
|
119
|
+
current_value = @@metadata[key]
|
120
|
+
|
121
|
+
# Validate Check for date input
|
117
122
|
if key.downcase == 'createdate'
|
118
123
|
|
119
124
|
# Repeat asking for a valid date
|
120
125
|
validatedDate = false
|
121
126
|
while !validatedDate
|
122
|
-
|
127
|
+
userInput = readUserInput('New date value: ')
|
128
|
+
|
129
|
+
if userInput.empty? and !current_value.empty?
|
130
|
+
@@metadata[key] = current_value
|
131
|
+
self.log('debug', "User decided to take over old value for #{key}.")
|
132
|
+
puts 'Date is needed. Setting old value: ' + current_value
|
133
|
+
break
|
134
|
+
end
|
135
|
+
|
136
|
+
# Update loop condition variable
|
137
|
+
validatedDate = validateDate(userInput)
|
138
|
+
|
139
|
+
# Update Metadata
|
140
|
+
@@metadata[key] = validatedDate
|
123
141
|
end
|
124
|
-
@@metadata[key] = validatedDate
|
125
142
|
|
143
|
+
# Input of all other values
|
126
144
|
else
|
127
145
|
|
128
146
|
@@metadata[key] = readUserInput('New value: ')
|
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.3.
|
4
|
+
version: 2.3.1
|
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-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -171,8 +171,8 @@ homepage: https://github.com/Micronarrativ/ruby-pmd
|
|
171
171
|
licenses:
|
172
172
|
- MIT
|
173
173
|
metadata:
|
174
|
-
created: '2015-
|
175
|
-
revision: '
|
174
|
+
created: '2015-11-05 09:26:59'
|
175
|
+
revision: '20151105092659'
|
176
176
|
post_install_message: ". Run `pdfmd` to see the command help."
|
177
177
|
rdoc_options: []
|
178
178
|
require_paths:
|