podoff 1.2.0 → 1.2.1
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.
- data/CHANGELOG.txt +5 -0
- data/LICENSE.txt +1 -1
- data/Makefile +23 -0
- data/lib/podoff.rb +8 -3
- data/podoff.gemspec +1 -2
- metadata +3 -19
- data/Rakefile +0 -68
data/CHANGELOG.txt
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
Copyright (c) 2015-
|
2
|
+
Copyright (c) 2015-2017, John Mettraux, jmettraux@gmail.com
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
data/Makefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
NAME = \
|
3
|
+
$(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name")
|
4
|
+
VERSION = \
|
5
|
+
$(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version")
|
6
|
+
|
7
|
+
|
8
|
+
gemspec_validate:
|
9
|
+
@echo "---"
|
10
|
+
ruby -e "s = eval(File.read(Dir['*.gemspec'].first)); p s.validate"
|
11
|
+
@echo "---"
|
12
|
+
|
13
|
+
name: gemspec_validate
|
14
|
+
@echo "$(NAME) $(VERSION)"
|
15
|
+
|
16
|
+
build: gemspec_validate
|
17
|
+
gem build $(NAME).gemspec
|
18
|
+
mkdir -p pkg
|
19
|
+
mv $(NAME)-$(VERSION).gem pkg/
|
20
|
+
|
21
|
+
push: build
|
22
|
+
gem push pkg/$(NAME)-$(VERSION).gem
|
23
|
+
|
data/lib/podoff.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2015-
|
3
|
+
# Copyright (c) 2015-2017, John Mettraux, jmettraux@gmail.com
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -30,7 +30,7 @@ require 'stringio'
|
|
30
30
|
|
31
31
|
module Podoff
|
32
32
|
|
33
|
-
VERSION = '1.2.
|
33
|
+
VERSION = '1.2.1'
|
34
34
|
|
35
35
|
def self.load(path, encoding)
|
36
36
|
|
@@ -153,7 +153,12 @@ module Podoff
|
|
153
153
|
#@objs.values.select { |o| o.type == '/Page' }
|
154
154
|
|
155
155
|
ps = @objs.values.find { |o| o.type == '/Pages' }
|
156
|
-
|
156
|
+
|
157
|
+
fail ArgumentError.new(
|
158
|
+
"no /Pages, the PDF is not usable by Podoff as is, you have to do " +
|
159
|
+
"`qpdf --object-streams=disable original.pdf unpacked.pdf` " +
|
160
|
+
"and use unpacked.pdf instead of original.pdf"
|
161
|
+
) unless ps
|
157
162
|
|
158
163
|
extract_refs(ps.attributes[:kids]).collect { |r| @objs[r] }
|
159
164
|
end
|
data/podoff.gemspec
CHANGED
@@ -21,14 +21,13 @@ a tool to deface PDF documents
|
|
21
21
|
|
22
22
|
#s.files = `git ls-files`.split("\n")
|
23
23
|
s.files = Dir[
|
24
|
-
'
|
24
|
+
'Makefile',
|
25
25
|
'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb',
|
26
26
|
'*.gemspec', '*.txt', '*.rdoc', '*.md'
|
27
27
|
]
|
28
28
|
|
29
29
|
#s.add_runtime_dependency 'tzinfo'
|
30
30
|
|
31
|
-
s.add_development_dependency 'rake'
|
32
31
|
s.add_development_dependency 'rspec', '>= 2.13.0'
|
33
32
|
|
34
33
|
s.require_path = 'lib'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: podoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rake
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
14
|
- !ruby/object:Gem::Dependency
|
31
15
|
name: rspec
|
32
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +34,7 @@ executables: []
|
|
50
34
|
extensions: []
|
51
35
|
extra_rdoc_files: []
|
52
36
|
files:
|
53
|
-
-
|
37
|
+
- Makefile
|
54
38
|
- lib/podoff.rb
|
55
39
|
- spec/alpha_spec.rb
|
56
40
|
- spec/core_spec.rb
|
data/Rakefile
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'rubygems'
|
3
|
-
|
4
|
-
require 'rake'
|
5
|
-
require 'rake/clean'
|
6
|
-
require 'rdoc/task'
|
7
|
-
|
8
|
-
|
9
|
-
#
|
10
|
-
# clean
|
11
|
-
|
12
|
-
CLEAN.include('pkg', 'rdoc')
|
13
|
-
|
14
|
-
|
15
|
-
#
|
16
|
-
# test / spec
|
17
|
-
|
18
|
-
#task :spec => :check_dependencies do
|
19
|
-
task :spec do
|
20
|
-
exec 'rspec spec/'
|
21
|
-
end
|
22
|
-
task :test => :spec
|
23
|
-
|
24
|
-
task :default => :spec
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
# gem
|
29
|
-
|
30
|
-
GEMSPEC_FILE = Dir['*.gemspec'].first
|
31
|
-
GEMSPEC = eval(File.read(GEMSPEC_FILE))
|
32
|
-
GEMSPEC.validate
|
33
|
-
|
34
|
-
|
35
|
-
desc %{
|
36
|
-
builds the gem and places it in pkg/
|
37
|
-
}
|
38
|
-
task :build do
|
39
|
-
|
40
|
-
sh "gem build #{GEMSPEC_FILE}"
|
41
|
-
sh "mkdir -p pkg"
|
42
|
-
sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem pkg/"
|
43
|
-
end
|
44
|
-
|
45
|
-
desc %{
|
46
|
-
builds the gem and pushes it to rubygems.org
|
47
|
-
}
|
48
|
-
task :push => :build do
|
49
|
-
|
50
|
-
sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
|
51
|
-
end
|
52
|
-
|
53
|
-
|
54
|
-
##
|
55
|
-
## rdoc
|
56
|
-
##
|
57
|
-
## make sure to have rdoc 2.5.x to run that
|
58
|
-
#
|
59
|
-
#Rake::RDocTask.new do |rd|
|
60
|
-
#
|
61
|
-
# rd.main = 'README.txt'
|
62
|
-
# rd.rdoc_dir = "rdoc/#{GEMSPEC.name}"
|
63
|
-
#
|
64
|
-
# rd.rdoc_files.include('README.rdoc', 'CHANGELOG.txt', 'lib/**/*.rb')
|
65
|
-
#
|
66
|
-
# rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}"
|
67
|
-
#end
|
68
|
-
|