Sha256: 8ec3e474f33a858edd91679cb600bc443942942ea9fc2883228fae8bd6b83766

Contents?: true

Size: 780 Bytes

Versions: 13

Compression:

Stored size: 780 Bytes

Contents

#!/usr/bin/env ruby
require "juicer/merger/base"
require "juicer/dependency_resolver/javascript_dependency_resolver"

module Juicer
  module Merger
    # Merge several files into one single output file. Resolves and adds in files from @depend comments
    class JavaScriptMerger < Base

      # Constructor
      def initialize(files = [], options = {})
        @dependency_resolver = JavaScriptDependencyResolver.new(options)
        super(files, options)
      end
    end
  end
end

# Run file from command line
# TODO: Refactor to testable Juicer::Merger::JavaScript::FileMerger.cli method
# or similar.
#
if $0 == __FILE__
  puts("Usage: javascript_merger.rb file[...] output") and exit if $*.length < 2

  fm = JavaScriptMerger.new()
  fm << $*[0..-2]
  fm.save($*[-1])
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
juicer-1.2.0 lib/juicer/merger/javascript_merger.rb
juicer-1.1.2 lib/juicer/merger/javascript_merger.rb
juicer-1.1.1 lib/juicer/merger/javascript_merger.rb
juicer-1.1.0 lib/juicer/merger/javascript_merger.rb
juicer-1.0.22 lib/juicer/merger/javascript_merger.rb
juicer-1.0.21 lib/juicer/merger/javascript_merger.rb
juicer-1.0.20 lib/juicer/merger/javascript_merger.rb
juicer-1.0.19 lib/juicer/merger/javascript_merger.rb
juicer-1.0.18 lib/juicer/merger/javascript_merger.rb
juicer-1.0.17 lib/juicer/merger/javascript_merger.rb
juicer-1.0.16 lib/juicer/merger/javascript_merger.rb
juicer-1.0.15 lib/juicer/merger/javascript_merger.rb
juicer-1.0.14 lib/juicer/merger/javascript_merger.rb