wkhtmltopdf-installer 0.12.2.1.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0a465c41c6870d64d08381fdfa1c7b1c4a78bc5e
4
+ data.tar.gz: df759b72362e5046b5d8dab0afb681aef506e030
5
+ SHA512:
6
+ metadata.gz: 725cdcef420b1e4aa43769d18a484e2a4215baae53c8eab7004adfc744914a39877d6f08f50e1813d8d5322b644256b02575419d7d409976e3b66a1009140da7
7
+ data.tar.gz: 32e286da26699e12a25cf2be9253d11238f11f0d5803cef64d494187e98b25f5bc21dd960ef1319363923d80bd062fbd5e36ba714f04c626ff3ec71ad05af4fd
data/bin/wkhtmltopdf ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/wkhtmltopdf_installer'
4
+ exec WkhtmltopdfInstaller.wkhtmltopdf_path, *ARGV
@@ -0,0 +1,17 @@
1
+
2
+ .PHONY: clean unpack tmp copy
3
+
4
+ $(DOWNLOADED):
5
+ curl -L $(URL) -o $(DOWNLOADED)
6
+
7
+ clean:
8
+ rm -rf $(TMPDIR) $(DOWNLOADED)
9
+
10
+ tmp:
11
+ mkdir -p $(TMPDIR)
12
+
13
+ copy:
14
+ mkdir -p $(LIBEXEC)
15
+ cp $(BINARY) $(TARGET)
16
+
17
+
@@ -0,0 +1,8 @@
1
+ DOWNLOADED = wkhtmltox.deb
2
+ BINARY = $(TMPDIR)/usr/local/bin/wkhtmltopdf
3
+
4
+ unpack: tmp $(DOWNLOADED)
5
+ cp $(DOWNLOADED) $(TMPDIR)/
6
+ cd $(TMPDIR) && ar -x wkhtmltox.deb
7
+ cd $(TMPDIR) && tar -xf data.*
8
+
@@ -0,0 +1,12 @@
1
+ DOWNLOADED = wkhtmltox.pkg
2
+ BINARY = $(TMPDIR)/bin/wkhtmltopdf
3
+
4
+ pkg_content = $(TMPDIR)/content
5
+ payload = $(pkg_content)/Payload
6
+ app_tar_xz = $(TMPDIR)/usr/local/share/wkhtmltox-installer/app.tar.xz
7
+
8
+ unpack: tmp $(DOWNLOADED)
9
+ pkgutil --expand $(DOWNLOADED) $(pkg_content)
10
+ tar -xf $(payload) -C $(TMPDIR)
11
+ tar -xzf $(app_tar_xz) -C $(TMPDIR)
12
+
data/ext/extconf.rb ADDED
@@ -0,0 +1,47 @@
1
+ require 'mkmf'
2
+ require 'tmpdir'
3
+ require 'ostruct'
4
+ require_relative '../lib/wkhtmltopdf_installer'
5
+
6
+ def probe
7
+ @probe ||= case RUBY_PLATFORM
8
+ when /x86_64-darwin.*/
9
+ OpenStruct.new(script: 'macos', platform: 'osx-cocoa-x86-64', ext: 'pkg')
10
+ when /x86_64-linux/
11
+ OpenStruct.new(script: 'linux', platform: 'linux-trusty-amd64', ext: 'deb')
12
+ when /i[3456]86-linux/
13
+ OpenStruct.new(script: 'linux', platform: 'linux-trusty-i386', ext: 'deb')
14
+ else
15
+ raise NotImplementedError "Unsupported ruby platform #{RUBY_PLATFORM}"
16
+ end
17
+ end
18
+
19
+ def version
20
+ WkhtmltopdfInstaller::VERSION
21
+ end
22
+
23
+ def makefile_dir
24
+ File.dirname(__FILE__)
25
+ end
26
+
27
+ # Some examples:
28
+ # "http://download.gna.org/wkhtmltopdf/0.12/#{version}/wkhtmltox-#{version}_osx-cocoa-x86-64.pkg"
29
+ # "http://download.gna.org/wkhtmltopdf/0.12/#{version}/wkhtmltox-#{version}_linux-trusty-amd64.deb"
30
+ # "http://download.gna.org/wkhtmltopdf/0.12/#{version}/wkhtmltox-#{version}_linux-trusty-i386.deb"
31
+ def package_url
32
+ major_version = version.gsub(/^(\d+\.\d+).*$/, '\1')
33
+ "http://download.gna.org/wkhtmltopdf/#{major_version}/#{version}/wkhtmltox-#{version}_#{probe.platform}.#{probe.ext}"
34
+ end
35
+
36
+ # The main Makefile contains settings only. The actual work is done by os-specific Makefile.xxxxx files
37
+ File.write "#{makefile_dir}/Makefile", <<-EOF
38
+ URL = #{package_url}
39
+ LIBEXEC = #{WkhtmltopdfInstaller.libexec_dir}
40
+ TARGET = #{WkhtmltopdfInstaller.wkhtmltopdf_path}
41
+ TMPDIR = #{Dir.mktmpdir}
42
+ all: unpack
43
+ install: copy clean
44
+ include Makefile.#{probe.script}
45
+ include Makefile.common
46
+ EOF
47
+
@@ -0,0 +1,16 @@
1
+ require_relative 'wkhtmltopdf_installer/version'
2
+
3
+ module WkhtmltopdfInstaller
4
+ extend self
5
+
6
+ def libexec_dir
7
+ "#{File.dirname(__FILE__)}/../libexec"
8
+ end
9
+
10
+ def wkhtmltopdf_path
11
+ "#{libexec_dir}/wkhtmltopdf"
12
+ end
13
+ end
14
+
15
+ ENV['PATH'] = [WkhtmltopdfInstaller.libexec_dir, ENV['PATH']].compact.join(':')
16
+
@@ -0,0 +1,5 @@
1
+ module WkhtmltopdfInstaller
2
+ VERSION = '0.12.2.1'.freeze
3
+ RELEASE_ITERATION = 3
4
+ GEM_VERSION = "#{VERSION}.#{RELEASE_ITERATION}"
5
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wkhtmltopdf-installer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.12.2.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Yartsev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Downloads wkhtmltopdf binary during 'Building native extension...' phase
14
+ email: vovayartsev@gmail.com
15
+ executables:
16
+ - wkhtmltopdf
17
+ extensions:
18
+ - ext/extconf.rb
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/wkhtmltopdf
22
+ - ext/Makefile.common
23
+ - ext/Makefile.linux
24
+ - ext/Makefile.macos
25
+ - ext/extconf.rb
26
+ - lib/wkhtmltopdf_installer.rb
27
+ - lib/wkhtmltopdf_installer/version.rb
28
+ homepage: http://rubygems.org/gems/wkhtmltopdf-installer
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.2.2
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: Light-weight cross-platform wkhtmltopdf binary installer
52
+ test_files: []
53
+ has_rdoc: