Sha256: 008fde7c4f8e41e1bfa5333ec07d19d3a8031b3d8580d7602eeb86e5012b5376

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

module ActsAsFlyingSaucer

	class Config
		# default options
		class << self
			attr_accessor :options

		end
		ActsAsFlyingSaucer::Config.options = {
						:java_bin => "java",
						:classpath_separator => ':',
						:tmp_path => "/tmp",
						:run_mode => :once,
						:max_memory_mb => 50,
						:nailgun=> false,
						:nailgun_port => '2113',
						:nailgun_host => 'localhost',
		}
		def self.setup_nailgun
			if ActsAsFlyingSaucer::Config.options[:nailgun]
				Nailgun::NailgunConfig.options= {
								:java_bin => ActsAsFlyingSaucer::Config.options[:java_bin],
								:server_address => ActsAsFlyingSaucer::Config.options[:nailgun_host],
								:port_no=>ActsAsFlyingSaucer::Config.options[:nailgun_port]
				}
				Nailgun::NailgunServer.new(["start"]).daemonize
				count =0
				while(!system("lsof -i -n -P|grep #{ActsAsFlyingSaucer::Config.options[:nailgun_port]}") && count<9)
					sleep(1)
					count+=1
				end
				acts_as_flying_saucer_jar_path = File.expand_path(File.join(File.dirname(__FILE__),'java','jar','acts_as_flying_saucer.jar'))
				# ADD IN NAILGUN CLASS
				Nailgun::NgCommand.ng_cp(acts_as_flying_saucer_jar_path)
				Nailgun::NgCommand.ng_alias("Xhtml2Pdf","acts_as_flying_saucer.Xhtml2Pdf")
				Nailgun::NgCommand.ng_alias("encryptPdf", "acts_as_flying_saucer.encryptPdf")

			end
		end
		# cattr_accessor :options
	end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
acts_as_flying_saucer-1.0.2 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-1.0.1 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-1.0.0 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.9 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.8 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.7 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.6 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.5 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.4 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.3 lib/acts_as_flying_saucer/config.rb
acts_as_flying_saucer-0.0.2 lib/acts_as_flying_saucer/config.rb