pdfmd 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjA3YWQ3YjBhZjU1Mjk4OTBhN2YzMzdiZGNhNTJjYmFkNTQ4MGQyMg==
5
- data.tar.gz: !binary |-
6
- ODE0MzYxNGNjMGJhOWJiMTkyZjY4ZTc1Njg5MzRiMWI1MmNiNjhlYQ==
2
+ SHA1:
3
+ metadata.gz: a468c38125c3c8666a363e93f670707f27aa7d56
4
+ data.tar.gz: d73bc27bf63fedeb9f8c8ae9b4f335c8243e6283
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODRjNzdkYmM4NGNkZTkyMTMwMjE2NWE1MTAzNGFhYjFhYjc1NzBhZGQ2OGMy
10
- YWY4MDM4N2MxNGQ5ZTM4ZmRkNGM3YjkxNTE0ZDY5YzIzYmI1NzhlYmY4YzJm
11
- ZDZlYmU0ZGExOGI1OTg3YjUyYTFlNjAzMmUxMzY5NDY2NjU1MmI=
12
- data.tar.gz: !binary |-
13
- ZWQyN2ViOGY3ZjhkNjg0ZGU1YTcwZTcyODY0ZmQ2NjNmYmIzY2Q3NmYwYjE4
14
- ODgyMGVhYzdmYWI5MThlZTU3ZWUyNTY5NWVhNmFkYTlmNjIwNTZmYmI2OGVl
15
- N2E0MDBiMjk0NWYzMzU4NDM3NzA5ZWQ0YWZhODA1YWE2NjQ1ZjU=
6
+ metadata.gz: b1250781f28ee514c561386f98e79447798d9b46ee24a57a31874c24ecce53b2da6c920455ff3bf7ebbc6166624fd0c8f82933f83ca8cf255b8cb3c663c67cdb
7
+ data.tar.gz: 4eb10eec863147e23945b9fc585d94dd557e3fa522ef4c8ed50948369529e8e189860fa0a6be51670d9fe3a672bac0f2024367129986991bfc724d649ff4a849
@@ -1,3 +1,6 @@
1
+ # Version 1.6.3
2
+ - Added hiera option 'rename' for command 'edit'
3
+
1
4
  # Version 1.6.2
2
5
  - Invalid Byte character in Rename command
3
6
 
data/README.md CHANGED
@@ -130,6 +130,8 @@ pdfmd::config:
130
130
  keywords : 2
131
131
  outputdir : /data/output/sorted
132
132
  copy : true
133
+ edit:
134
+ rename : true
133
135
 
134
136
  ```
135
137
 
@@ -59,7 +59,7 @@ require "i18n"
59
59
  require 'pathname'
60
60
  require 'logger'
61
61
 
62
- VERSION = '1.6.2'
62
+ VERSION = '1.6.3'
63
63
 
64
64
  # Include general usage methods
65
65
  require_relative('pdfmd/methods.rb')
@@ -171,6 +171,8 @@ class DOC < Thor
171
171
 
172
172
  This parameter is identical to running `> CLI rename <filename>`
173
173
 
174
+ Hiera parameter: rename
175
+
174
176
  General example:
175
177
 
176
178
  # Edit tag 'TAG' and set a new value interactive.
@@ -236,6 +238,8 @@ class DOC < Thor
236
238
 
237
239
  See `> CLI help rename` for details about renaming.
238
240
 
241
+ To enable this feature in hiera add the key 'rename' into the section 'edit' with the value 'true'.
242
+
239
243
  LONGDESC
240
244
  method_option :tag, :type => :string, :aliases => '-t', :desc => 'Name of the Tag(s) to Edit', :default => false, :required => true
241
245
  method_option :rename, :type => :boolean, :aliases => '-r', :desc => 'Rename file after changing meta-tags', :default => false, :required => false
@@ -1,20 +1,30 @@
1
1
  #
2
2
  # Thor command 'edit' for changing the common
3
3
  # ExifTags within the PDF file
4
- # TODO: Put rename into Hiera
5
- # TODO: Back backup file/path into hiera and options
4
+ # TODO: backup file/path into hiera and options
6
5
  #
7
6
 
8
7
  require_relative '../string_extend'
9
8
 
10
9
  filename = ENV.fetch('PDFMD_FILENAME')
11
10
  optTag = ENV['PDFMD_TAG'] || nil
12
- optRename = ENV['PDFMD_RENAME'] == 'true' ? true : false
11
+ opt_rename = ENV['PDFMD_RENAME']
13
12
  pdfmd = ENV['PDFMD']
14
13
  opt_log = ENV['PDFMD_LOG']
15
14
  opt_logfile = ENV['PDFMD_LOGFILE']
16
15
  hieraDefaults = queryHiera('pdfmd::config')
17
16
 
17
+ # Rename or not
18
+ if opt_rename == 'true'
19
+ opt_rename = true
20
+ elsif (not hieraDefaults['edit'].nil? and
21
+ not hieraDefaults['edit']['rename'].nil? and
22
+ hieraDefaults['edit']['rename'] == true)
23
+ opt_rename = true
24
+ else
25
+ opt_rename = false
26
+ end
27
+
18
28
  # Define logging state
19
29
  if ( hieraDefaults['edit'].nil? or
20
30
  hieraDefaults['edit']['log'].nil? or
@@ -112,8 +122,7 @@ end
112
122
  # If required, run the renaming task afterwards
113
123
  # This is not pretty, but seems to be the only way to do this in THOR
114
124
  #
115
- if optRename
125
+ if opt_rename
116
126
  logenable ? $logger.info("#{filename}: Trigger file renaming.") : ''
117
127
  `#{pdfmd} rename '#{filename}'`
118
128
  end
119
-
@@ -22,4 +22,6 @@ Configure default settings in hiera:
22
22
  keywords : 4
23
23
  outputdir : /data/output/sorted
24
24
  copy : true
25
+ edit:
26
+ rename : true
25
27
 
metadata CHANGED
@@ -1,106 +1,106 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
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-04-12 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.19'
20
- - - ! '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.19.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.19'
30
- - - ! '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.19.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: highline
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.7'
40
- - - ! '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.7.1
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '1.7'
50
- - - ! '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.7.1
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: fileutils
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0.7'
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0.7'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0.7'
70
- - - ! '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0.7'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: i18n
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ~>
77
+ - - "~>"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0.6'
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.6.11
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.6'
90
- - - ! '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 0.6.11
93
- description: ! " Managing the common pdf metadata values and renaming the pdf file
94
- accordingly.\n Sets common tags like 'author', 'createdate', 'title', 'subject'
95
- and 'keywords'\n and re-uses them for renaming the file with to a human-readable
96
- identifier.\n"
93
+ description: |2
94
+ Managing the common pdf metadata values and renaming the pdf file accordingly.
95
+ Sets common tags like 'author', 'createdate', 'title', 'subject' and 'keywords'
96
+ and re-uses them for renaming the file with to a human-readable identifier.
97
97
  email: pdfmd@micronarrativ.org
98
98
  executables:
99
99
  - pdfmd
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
- - .gitignore
103
+ - ".gitignore"
104
104
  - CHANGELOG.md
105
105
  - LICENSE
106
106
  - README.md
@@ -137,16 +137,16 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - ! '>='
140
+ - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ! '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements:
149
- - ! '[exiftools](http://www.sno.phy.queensu.ca/~phil/exiftool/)'
149
+ - "[exiftools](http://www.sno.phy.queensu.ca/~phil/exiftool/)"
150
150
  rubyforge_project:
151
151
  rubygems_version: 2.4.6
152
152
  signing_key: