diff --git a/rakefile b/Rakefile similarity index 92% rename from rakefile rename to Rakefile index 1f2037de..bc0af9e1 100644 --- a/rakefile +++ b/Rakefile @@ -9,7 +9,7 @@ spec = Gem::Specification.new do |s| s.email = "vpr-ris-developers@iowa.uiowa.edu,mcollas@aconex.com" s.platform = Gem::Platform::RUBY s.summary = "Provides binaries for WKHTMLTOPDF project in an easily accessible package." - s.files = FileList["{bin}/**/*"].to_a + s.files = FileList["{bin,libexec,lib}/*"].to_a s.has_rdoc = false s.executables << "wkhtmltopdf" s.require_path = '.' diff --git a/bin/wkhtmltopdf b/bin/wkhtmltopdf index 9b71458c..ec51b172 100755 --- a/bin/wkhtmltopdf +++ b/bin/wkhtmltopdf @@ -1,19 +1,17 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby -executable = case RUBY_PLATFORM +arch = case RUBY_PLATFORM when /64.*linux/ - 'wkhtmltopdf_linux_amd64' + 'linux-amd64' when /linux/ - 'wkhtmltopdf_linux_386' + 'linux-x86' when /darwin/ - 'wkhtmltopdf_darwin_386' + 'darwin-x86' else raise "Invalid platform. Must be running linux or intel-based Mac OS." end -arguments = $*.map { |x| x.include?(' ') ? "'" + x + "'" : x } +args = $*.map { |x| x.include?(' ') ? "'" + x + "'" : x } +cmd = File.expand_path "#{File.dirname(__FILE__)}/../libexec/wkhtmltopdf-#{arch}" -executable = File.join(File.dirname(__FILE__), executable) -r = system(executable + " " + arguments.join(" ")) - -exit r ? 0 : 1 +exec "#{cmd} #{args.join(' ')}" diff --git a/bin/wkhtmltopdf-binary.rb b/bin/wkhtmltopdf-binary.rb deleted file mode 100644 index 95ce5999..00000000 --- a/bin/wkhtmltopdf-binary.rb +++ /dev/null @@ -1,2 +0,0 @@ -# Having this file, which matches the name of the gem, -# is required for the gem to be installed and called properly. diff --git a/bin/wkhtmltopdf_darwin_386 b/libexec/wkhtmltopdf-darwin-x86 similarity index 100% rename from bin/wkhtmltopdf_darwin_386 rename to libexec/wkhtmltopdf-darwin-x86 diff --git a/bin/wkhtmltopdf_linux_amd64 b/libexec/wkhtmltopdf-linux-amd64 similarity index 100% rename from bin/wkhtmltopdf_linux_amd64 rename to libexec/wkhtmltopdf-linux-amd64 diff --git a/bin/wkhtmltopdf_linux_386 b/libexec/wkhtmltopdf-linux-x86 similarity index 100% rename from bin/wkhtmltopdf_linux_386 rename to libexec/wkhtmltopdf-linux-x86 diff --git a/pkg/wkhtmltopdf-binary-0.1.3.gem b/pkg/wkhtmltopdf-binary-0.1.3.gem deleted file mode 100644 index b59a3e6d..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.1.3.gem and /dev/null differ diff --git a/pkg/wkhtmltopdf-binary-0.1.4.gem b/pkg/wkhtmltopdf-binary-0.1.4.gem deleted file mode 100644 index b927d1bb..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.1.4.gem and /dev/null differ diff --git a/pkg/wkhtmltopdf-binary-0.1.5.gem b/pkg/wkhtmltopdf-binary-0.1.5.gem deleted file mode 100644 index 9b90b679..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.1.5.gem and /dev/null differ diff --git a/pkg/wkhtmltopdf-binary-0.1.6.gem b/pkg/wkhtmltopdf-binary-0.1.6.gem deleted file mode 100644 index 0c0ec230..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.1.6.gem and /dev/null differ diff --git a/pkg/wkhtmltopdf-binary-0.1.7.gem b/pkg/wkhtmltopdf-binary-0.1.7.gem deleted file mode 100644 index 191a9d37..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.1.7.gem and /dev/null differ diff --git a/pkg/wkhtmltopdf-binary-0.9.5.4.gem b/pkg/wkhtmltopdf-binary-0.9.5.4.gem deleted file mode 100644 index bf710ccf..00000000 Binary files a/pkg/wkhtmltopdf-binary-0.9.5.4.gem and /dev/null differ diff --git a/wkhtmltopdf-binary.gemspec b/wkhtmltopdf-binary.gemspec index 35c8e4c1..51ef187c 100644 --- a/wkhtmltopdf-binary.gemspec +++ b/wkhtmltopdf-binary.gemspec @@ -13,20 +13,11 @@ Gem::Specification.new do |s| s.email = 'vpr-ris-developers@iowa.uiowa.edu,mcollas@aconex.com' s.bindir = 'bin' - s.executables = ['wkhtmltopdf'] + s.executables = %w(wkhtmltopdf) - s.files = [ - 'lib/wkhtmltopdf-binary.rb', - 'bin/wkhtmltopdf_linux_amd64', - 'bin/wkhtmltopdf-binary.rb', - 'bin/wkhtmltopdf', - 'bin/wkhtmltopdf_darwin_386', - 'bin/wkhtmltopdf_linux_386' - ] + s.files = %w( + lib/wkhtmltopdf-binary.rb bin/wkhtmltopdf + libexec/wkhtmltopdf-darwin-x86 + libexec/wkhtmltopdf-linux-amd64 + libexec/wkhtmltopdf-linux-x86) end - - - - - -