builder/extra/tools/ruby-tpm/transformer.rb
def output
    @output.map!{
      |line|
      transform_line(line)
    }
    
    if @outfile
      Configurator.instance.info("Writing " + @outfile)
      ChangedFiles.register(@outfile)
      
      File.open(@outfile, "w") {
        |f|
        if mode() != nil
          f.chmod(mode())
        end
        
        if timestamp?()
          f.puts "# AUTO-GENERATED: #{DateTime.now}"
        end

        @output.each{
          |line| 
          f.puts(line) 
        }
      }
      
      if watch_file?()
        WatchFiles.watch_file(@outfile, @config)
      end
      
      ChangedFiles.check(@outfile, @config)
    else
      return self.to_s
    end
  end
# Evaluate the template and push the contents to the outfile
# If no file was given then the contents are returned as a string
Evaluate the template and push the contents to the outfile
If no file was given then the contents are returned as a string
Evaluate the template and push the contents to the outfile If no file was given then the contents are returned as a string
def output
    @output.map!{
      |line|
      transform_line(line)
    }
    if @outfile
      Configurator.instance.info("Writing " + @outfile)
      ChangedFiles.register(@outfile)
      File.open(@outfile, "w") {
        |f|
        if mode() != nil
          f.chmod(mode())
        end
        if timestamp?()
          f.puts "# AUTO-GENERATED: #{DateTime.now}"
        end
        @output.each{
          |line| 
          f.puts(line) 
        }
      }
      if watch_file?()
        WatchFiles.watch_file(@outfile, @config)
      end
      ChangedFiles.check(@outfile, @config)
    else
      return self.to_s
    end
  end
def output @output . map! { | line | transform_line ( line ) } if @outfile Configurator . instance . info ( "Writing " + @outfile ) ChangedFiles . register ( @outfile ) File . open ( @outfile , "w" ) { | f | if mode ( ) != nil f . chmod ( mode ( ) ) end if timestamp? ( ) f . puts "# AUTO-GENERATED: #{DateTime.now}" end @output . each { | line | f . puts ( line ) } } if watch_file? ( ) WatchFiles . watch_file ( @outfile , @config ) end ChangedFiles . check ( @outfile , @config ) else return self . to_s end end
Evaluate the template and push the contents to the outfile
If no file was given then the contents are returned as a string
Evaluate the template and push the contents to the outfile If no file was given then the contents are returned as a string