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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ab7c496da55c93341b8d97bd94fc511bc150bab
4
- data.tar.gz: 1c9a4416bdd38052ca3e009576dfc1b98d001381
3
+ metadata.gz: e948a9ca9e518fe87c5e1f9125710e66b7d33209
4
+ data.tar.gz: 21ba2f5f0a12d8946ab842c31cafa72aa3c1322b
5
5
  SHA512:
6
- metadata.gz: 174bbd13886843c0bdd9294ce4ef589834ce043db9693e790ff3f74857e299b6fba490eed342f6b03aff41bbe5fa4ff12fabc65335902113f2ea843b7443574f
7
- data.tar.gz: 794fa5246df3c0efc53091272e04162a4da7d6c6313cd33a5cbe9a91dc07c9cd11c04ac33585da73f2c09d458a72832a03307ee11393ea7e7687e25e8eb4c8d1
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
@@ -7,7 +7,7 @@ require "fileutils"
7
7
  require "i18n"
8
8
  require 'pathname'
9
9
 
10
- VERSION = '2.3.0'
10
+ VERSION = '2.3.1'
11
11
  NAME = 'pdfmd'
12
12
 
13
13
  #
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', "Cannog access file '#{filename}'.")
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
@@ -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
- validatedDate = validateDate(readUserInput('New date value: '))
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.0
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-10-15 00:00:00.000000000 Z
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-10-15 10:52:22'
175
- revision: '20151015105222'
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: