Sha256: 0bd21b74e0c95b086c05339c74ac3deb62eaa57432280b86a45a0c9d6ee80ed8

Contents?: true

Size: 1.15 KB

Versions: 13

Compression:

Stored size: 1.15 KB

Contents

# ===========================================================================
# Project:   Abbot - SproutCore Build Tools
# Copyright: ©2009 Apple, Inc.
#            portions copyright @2006-2009 Sprout Systems, Inc.
#            and contributors
# ===========================================================================

require File.expand_path(File.join(File.dirname(__FILE__), 'base'))
require 'fileutils'

module SC

  # This builder combines several javascript files into a single file.  It is
  # used to prepare a single javascript file for production use.  This build
  # tool expects the javascript files to have already been processed for any
  # build directives such sc_static().
  #
  class Builder::Combine < Builder::Base
    
    def build(dst_path)
      lines = []
      entries = entry.ordered_entries || entry.source_entries
      
      entries.each do |entry|
        src_path = entry.stage!.staging_path
        next unless File.exist?(src_path)
        
        lines << "/* >>>>>>>>>> BEGIN #{entry.filename} */\n"
        lines += readlines(src_path)
        lines << "\n"
      end
      writelines dst_path, lines
    end
    
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.0.20090408130025 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.0.20090416161445 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.0.20090720093355 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.0.20090720202429 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.0.20090721125122 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.126 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.20090721145236 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.20090721145251 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.20090721145280 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.20090721145281 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.20090721145282 lib/sproutcore/builders/combine.rb
sproutit-sproutcore-1.0.203 lib/sproutcore/builders/combine.rb