Open BrianHawley opened 1 year ago
Here's the sum of the commits that seem to have been lost:
diff -Nuar rghost-0.9.6/lib/rghost/merge_pdfs.rb rghost-0.9.7/lib/rghost/merge_pdfs.rb
--- rghost-0.9.6/lib/rghost/merge_pdfs.rb 1969-12-31 17:00:00.000000000 -0700
+++ rghost-0.9.7/lib/rghost/merge_pdfs.rb 2023-04-15 01:37:05.993735128 -0600
@@ -0,0 +1,12 @@
+class RGhost::MergePdfs
+ attr_reader :error, :errors
+ DEFAULT_OPTIONS = { :convert => true }
+
+ def self.merge(pdfs, options={})
+ rge = RGhost::Engine.new(pdfs,DEFAULT_OPTIONS.merge(options))
+ out = rge.render(:pdf)
+ @error = rge.error
+ @errors = rge.errors
+ out
+ end
+end
\ No newline at end of file
diff -Nuar rghost-0.9.6/lib/rghost/ruby_ghost_engine.rb rghost-0.9.7/lib/rghost/ruby_ghost_engine.rb
--- rghost-0.9.6/lib/rghost/ruby_ghost_engine.rb 2023-04-15 01:46:49.435913583 -0600
+++ rghost-0.9.7/lib/rghost/ruby_ghost_engine.rb 2023-04-15 01:37:06.000735034 -0600
@@ -52,11 +52,9 @@
params << "-sstdout=#{shellescape(file_err)}"
params << "-sOutputFile=#{shellescape(file_out)}"
params << @options[:raw] if @options[:raw]
-
-
case @document
when RGhost::Document
- file_in="#{tmp_filename}.rgin"
+ file_in = shellescape("#{tmp_filename}.rgin")
params.concat @document.gs_paper
mode=external_encoding.nil? ? 'w' : "w:#{external_encoding}"
fi=File.open(file_in,mode)
@@ -66,10 +64,14 @@
file_in=@document.path
#@delete_input=false unless @options[:debug]
when String
- file_in=@document
+ file_in = shellescape(@document)
+ when Array
+ file_in = @document.map{|d| shellescape(d) }.join(' ')
+ else
+ raise RuntimeError.new("Cannot convert #{@document.class}. Supported classes are RGhost::Document or File or String.")
end
- params << shellescape(file_in)
+ params << file_in
if RGhost::Config::GS[:mode] == :gslib
require "rghost/rgengine"
diff -Nuar rghost-0.9.6/lib/rghost/ruby_ghost_version.rb rghost-0.9.7/lib/rghost/ruby_ghost_version.rb
--- rghost-0.9.6/lib/rghost/ruby_ghost_version.rb 2023-04-15 01:46:49.436913569 -0600
+++ rghost-0.9.7/lib/rghost/ruby_ghost_version.rb 2023-04-15 01:37:06.001735020 -0600
@@ -1,8 +1,8 @@
module RGhost::VERSION #:nodoc:
MAJOR = 0
- MINOR = 8
+ MINOR = 9
TINY = 7
DATE=1244286414
STRING = [MAJOR, MINOR, TINY].join('.')
-
+
end
diff -Nuar rghost-0.9.6/lib/rghost.rb rghost-0.9.7/lib/rghost.rb
--- rghost-0.9.6/lib/rghost.rb 2023-04-15 01:46:49.418913810 -0600
+++ rghost-0.9.7/lib/rghost.rb 2023-04-15 01:37:05.989735181 -0600
@@ -12,7 +12,8 @@
require 'rghost/ps_facade'
require 'rghost/function'
require 'rghost/document'
-require 'rghost/grid/grid'
+require 'rghost/merge_pdfs'
+require 'rghost/grid/grid'
RGhost::Config::GS[:PATH]="/opt/local/bin/gs"
I'll also add that there are no tags in this repository, so it's impossible to validate what was actually released.
@mojavelinux I made you a collaborator, please feel free and fix it.
Do you know where the original repository is located that would have this missing commits? Or is that they were never pushed anywhere?
Good question, I might have generated the gem from another branch I don't remember now. I think applying that diff and pushing it to this repo is better.
I don't think it's the right approach because those are not my commits. We really should have the original commits, if they are available. I didn't write the code and therefore do not want to be associated as the author. However, I would be willing to submit a PR that makes you the author of the commit (assuming you changed the code).
I'm also noticing that the lib/rghost/ruby_ghost_version.rb
(called out in the diff above) is quite out of date/differs from the rghost.gemspec
file. So docs produced by RGhost
have the wrong metadata in them, and probably had since whatever versions came after 0.8.7
.
So, a few questions, @shairontoledo:
0.9.7
so we could get the missing commit in?RGhost::VERSION
constants and have the .gemspec
pull from there so future versions have the correct metadata?0.9.9
release?@stevenharman:
This github repo didn't have the changes past 0.9.6, so the recent 0.9.8 update here doesn't have them either.