<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,9 @@
 = Change Log
 
+== Version 0.6.1 (2009-03-23)
+* rename command-line compiler output file
+
+
 == Version 0.6 (2009-03-23)
 * follow symbolic links
 * reorganize directory structure</diff>
      <filename>CHANGES.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
-# Author:: Oliver Steele
-# Copyright:: Copyright (c) 2005-2008 Oliver Steele.  All rights reserved.
-# License:: MIT License
+require 'net/http'
+require 'uri'
 
 # == module OpenLaszlo
 #
@@ -49,14 +48,15 @@ module OpenLaszlo
     # * &lt;tt&gt;:format&lt;/tt&gt; - request type (default 'swf')
     # See OpenLaszlo.compile for a description of +options+.
     def compile(source_file, options={})
-      mtime = File.mtime source_file
+      mtime = File.mtime(source_file)
       runtime = options[:runtime] || 'swf8'
-      output = options[:output] || &quot;#{File.expand_path(File.join(File.dirname(source_file), File.basename(source_file, '.lzx')))}.lzr=#{runtime}.swf&quot;
+      default_output = source_file.sub(/\.lzx/, '') + '.swf'
+      output = options[:output] || default_output
       compile_object(source_file, output, options)
       results = request_metadata_for(source_file, options)
       raise &quot;Race condition: #{source_file} was modified during compilation&quot; if mtime != File.mtime(source_file)
-      results[:output] = output
       raise CompilationError.new(results[:error]) if results[:error]
+      results[:output] = output
       return results
     end
 
@@ -67,8 +67,8 @@ module OpenLaszlo
     end
     
     def request_metadata_for(source_file, options={})
-      results = {}
       options = {}.update(options).update(:format =&gt; 'canvas-xml', :output =&gt; nil)
+      results = {}
       text = request(source_file, options)
       if text =~ %r{&lt;warnings&gt;(.*?)&lt;/warnings&gt;}m
         results[:warnings] = $1.scan(%r{&lt;error&gt;\s*(.*?)\s*&lt;/error&gt;}m).map { |w| w.first }
@@ -80,8 +80,6 @@ module OpenLaszlo
     
     def request(source_file, options={})
       output = options[:output]
-      require 'net/http'
-      require 'uri'
       # assert that pathname is relative to LPS home:
       absolute_path = File.expand_path(source_file)
       server_relative_path = nil
@@ -98,8 +96,8 @@ module OpenLaszlo
         raise InvalidSourceLocation.new(&quot;#{absolute_path} isn't inside #{@home}&quot;) unless absolute_path.index(@home) == 0
         server_relative_path = absolute_path[@home.length..-1]
         # FIXME: this doesn't handle quoting; use recursive File.split instead
-        # FIXME: should encode the url, for filenames that include '/'
-        server_relative_path.gsub(File::Separator, '/')
+        # FIXME: encode the url
+        server_relative_path.gsub!(File::Separator, '/')
       end
       options = {
         :lzr =&gt; options[:runtime],
@@ -174,11 +172,9 @@ module OpenLaszlo
     # See OpenLaszlo.compile for a description of +options+.
     def compile(source_file, options={})
       runtime = options[:runtime] || 'swf8'
-      output_suffix = &quot;.lzr=#{runtime}.swf&quot;
       default_output = File.join(File.dirname(source_file),
-                                 File.basename(source_file, '.lzx') + output_suffix)
+                                 File.basename(source_file, '.lzx') + '.swf')
       output = options[:output] || default_output
-      raise &quot;#{source_file} and #{output} do not have the same basename.&quot; unless File.basename(source_file, '.lzx') == File.basename(output, output_suffix)
       args = []
       args &lt;&lt; &quot;--runtime=#{options[:runtime]}&quot; if options[:runtime]
       args &lt;&lt; '--debug' if options[:debug]
@@ -195,7 +191,13 @@ module OpenLaszlo
         stdin, stdout, stderr = Open3.popen3(command)
         errors = stdout.read
         warnings = stderr.readlines
-        warnings.shift if warnings.first and warnings.first =~ /^Compiling:/
+        # OpenLaszlo &gt;= 4.0
+        if warnings.first and warnings.first =~ /^Compiling:.* to (.+)/
+          real_output = $1
+          warnings.shift
+          FileUtils.mv(real_output, output) if
+            File.exists?(real_output) and real_output != output
+        end
       rescue NotImplementedError
         # Windows doesn't have popen
         errors = `#{command}`
@@ -271,17 +273,4 @@ EOF
   rescue InvalidSourceLocation
     CommandLineCompiler.new.compile(source_file, options)
   end
-  
-  def self.make_html(source_file, options={}) #:nodoc:
-    raise 'not really supported, for now'
-    options = {
-      :format =&gt; 'html-object',
-      :output =&gt; File.basename(source_file, '.lzx')+'.html'}.update(options)
-    compiler.compile(source_file, options)
-    source_file = options[:output]
-    s = open(source_file).read
-    open(source_file, 'w') do |f|
-      f &lt;&lt; s.gsub!(/\.lzx\?lzt=swf&amp;amp;/, '.lzx.swf?')
-    end
-  end
 end</diff>
      <filename>lib/openlaszlo/compiler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ module CompilerTestHelper
   
   def compile(file, output=nil, options={})
     file = testfile_pathname(file)
-    output ||= File.join(File.dirname(file), File.basename(file, '.lzx')+'.lzr=swf8.swf')
+    output ||= File.join(File.dirname(file), File.basename(file, '.lzx')+'.swf')
     rm_f output
     raise &quot;Unable to remove output file: #{output}&quot; if File.exists?(output)
     begin</diff>
      <filename>test/compiler_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f1cca77770c169120ee997e659b3f3c527af2a6a</id>
    </parent>
  </parents>
  <author>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </author>
  <url>http://github.com/osteele/ropenlaszlo/commit/e1cbbd44bb5660bc422d549d8da3ddce1b4508b9</url>
  <id>e1cbbd44bb5660bc422d549d8da3ddce1b4508b9</id>
  <committed-date>2009-03-23T05:37:01-07:00</committed-date>
  <authored-date>2009-03-23T05:37:01-07:00</authored-date>
  <message>rename command-line compiler output file</message>
  <tree>4beae40c4d50933fb0d162031463bda45b3d8a71</tree>
  <committer>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </committer>
</commit>
