<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -15,6 +15,16 @@ have set up a &quot;Season Pass&quot;-type automatic Bittorrent download of shows, this
 means that every day {The Daily Show, 30 Rock, whatever..} automatically gets
 sync'ed to your {iPod, Zune, whatever}!
 
+Gems you'll need:
+  * builder
+  * gettext
+  * ramaze
+
+Misc. gems you might need (building, etc):
+  * RSpec
+  * Rake
+  * RCov
+  * Pallet
 
 To build:
 	rake &amp;&amp; rake ffmpeg 	# Takes forever, only works on Mac/Linux</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -141,8 +141,13 @@ end
 
 desc &quot;Create a bundle folder that has all dependencies included&quot;
 task :bundle do
-	ENV[&quot;REQUIRE2LIB_LIBDIR&quot;] = &quot;#{RootDir}/bundle&quot;
+	ENV[&quot;REQUIRE2LIB_LIBDIR&quot;] = &quot;#{RootDir}/bundle/lib/yikes&quot;
 	sh &quot;#{RootDir}/findlibs/main.rb #{RootDir}/lib/main.rb&quot;
+	sh &quot;cp -R #{RootDir}/bin #{RootDir}/bundle/&quot;
+	sh &quot;cp -R #{RootDir}/lib/* #{RootDir}/bundle/lib/yikes&quot;
+	sh &quot;mkdir -p #{RootDir}/bundle/lib/yikes/libexec&quot;
+	sh &quot;cp -R #{RootDir}/libexec/bin #{RootDir}/bundle/lib/yikes/libexec&quot;
+	sh &quot;cp -R #{RootDir}/libexec/lib #{RootDir}/bundle/lib/yikes/libexec&quot;
 end
 
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -30,3 +30,4 @@ Future:
 	* Daemon control interface, script to kick off encoder run
 	* Dir change notifications on Linux, OSX
 	* Running daemon instant on-demand
+	* Add Amazon ads to page</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -82,58 +82,15 @@ end
 module ExternalTranscoder
 	def transcode(input, output)
 		cmd = get_transcode_command(input, output)
-		run_external_command(cmd)
+		Platform.run_external_command(cmd)
 	end
 
 	def get_screenshot(input, output)
 		cmd = get_screenshot_command(input, output)
-		run_external_command(cmd)
+		Platform.run_external_command(cmd)
 	end
 
 private
-	def run_external_command(cmd)
-		logger.debug &quot;Running #{cmd}&quot;
-
-		# FIXME: Dumb hack code!
-		pid = nil
-		unless (pid = fork)
-			STDOUT.reopen '/dev/null'
-			STDERR.reopen '/dev/null'
-			logger.debug &quot;Executing: #{cmd}&quot;
-			before_transcode() if self.respond_to? :before_transcode
-			system(cmd)
-			after_transcode() if self.respond_to? :before_transcode
-			Kernel.exit!
-		end
-		e = Process.wait pid
-		exitcode = ($?) ? ($?.exitstatus) : -1
-		logger.info &quot;Process returned #{exitcode}&quot;
-
-		# FIXME: Since we haven't got FFmpeg to actually return us not crap values,
-		# just return true here
-		true
-		
-		return exitcode == 0
-
-#                 IO.popen cmd do |i,o,e|
-#                         break
-#                         o.readlines.each do |line|
-#                                 p line
-#                         end
-#                 end
-
-#		if Platform.os == :windows
-#			# TODO: Implement me
-#			return
-#		end
-#
-#		# Platform is Posix so we have fork
-#		Kernel.fork do
-#			before_transcode() if self.respond_to? :before_transcode
-#			Kernel.exec 
-#			after_transcode() if self.respond_to? :before_transcode
-#		end
-	end
 
 end
 </diff>
      <filename>lib/engine.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,17 +27,89 @@ require 'logger'
 require 'gettext'
 require 'pathname'
 require 'fileutils'
+require 'rbconfig'
 
 include GetText
 
 module Platform
 class &lt;&lt; self 
+
+	def run_external_command_fork(cmd)
+		# FIXME: Dumb hack code!
+		pid = nil
+		unless (pid = fork)
+			STDOUT.reopen '/dev/null'
+			STDERR.reopen '/dev/null'
+			logger.debug &quot;Executing: #{cmd}&quot;
+			before_transcode() if self.respond_to? :before_transcode
+			system(cmd)
+			after_transcode() if self.respond_to? :before_transcode
+			Kernel.exit!
+		end
+		e = Process.wait pid
+		exitcode = ($?) ? ($?.exitstatus) : -1
+		logger.info &quot;Process returned #{exitcode}&quot;
+	end
+
+	def run_external_command(cmd)
+		logger.debug &quot;Running #{cmd}&quot;
+
+		if platform_has_fork?
+			run_external_command_fork(cmd) 
+			return true
+		end
+
+		# Last chance - just use system
+		system(cmd)
+		return true
+
+#                 IO.popen cmd do |i,o,e|
+#                         break
+#                         o.readlines.each do |line|
+#                                 p line
+#                         end
+#                 end
+
+#		if Platform.os == :windows
+#			# TODO: Implement me
+#			return
+#		end
+#
+#		# Platform is Posix so we have fork
+#		Kernel.fork do
+#			before_transcode() if self.respond_to? :before_transcode
+#			Kernel.exec 
+#			after_transcode() if self.respond_to? :before_transcode
+#		end
+	end
+
+ 	def hostname
+ 		return &quot;DONTKNOW&quot; if os == :windows
+ 		return super_chomp(`hostname -s`)
+ 	end
+
+
+	###
+	# Constant-returning routines (aka &quot;boring&quot;)
+	###
+
+	def ruby_runtime
+		# FIXME: Rubinius? IronRuby?
+		return :jruby if RUBY_PLATFORM =~ /java/
+		return :mri
+	end
+
 	def os
-		return :linux if RUBY_PLATFORM =~ /linux/
-		return :osx if RUBY_PLATFORM =~ /darwin/
-		return :solaris if RUBY_PLATFORM =~ /solaris/
-		return :bsd if RUBY_PLATFORM =~ /bsd/
-		return :windows if RUBY_PLATFORM =~ /win/
+		host_os = Config::CONFIG['host_os']
+		return :linux if host_os =~ /linux/
+		return :osx if host_os =~ /darwin/
+		return :solaris if host_os =~ /solaris/
+		return :bsd if host_os =~ /bsd/
+		return :windows if host_os =~ /win/
+	end
+
+	def platform_has_fork?
+		os != :windows and [:mri, :rubinius].include? ruby_runtime
 	end
 
 	def home_dir
@@ -83,11 +155,6 @@ class &lt;&lt; self
 		return path
 	end
  
- 	def hostname
- 		return &quot;DONTKNOW&quot; if os == :windows
- 		return super_chomp(`hostname -s`)
- 	end
- 
 
 end # Class &lt;&lt; self
 end</diff>
      <filename>lib/platform.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>61aa8e1f6ff3a7c210c3502c23791aa1fb20b39b</id>
    </parent>
  </parents>
  <author>
    <name>Paul Betts</name>
    <email>paul@paulbetts.org</email>
  </author>
  <url>http://github.com/xpaulbettsx/yikes/commit/6f24b512e0a67f50278fa58a05c6807399fb6183</url>
  <id>6f24b512e0a67f50278fa58a05c6807399fb6183</id>
  <committed-date>2008-06-07T23:46:35-07:00</committed-date>
  <authored-date>2008-06-07T23:46:35-07:00</authored-date>
  <message>Add gems to README, beef up 'rake bundle', refactor Platform stuff for
JRuby as well as moving engine process runner to Platform</message>
  <tree>e127bfc9fe9d62a8409eabafa17c0698bfcc97b9</tree>
  <committer>
    <name>Paul Betts</name>
    <email>paul@paulbetts.org</email>
  </committer>
</commit>
