Sha256: 3726358fcf9fdf15e20063ca6837f0510b69f3e3f037c852b92b6fa8b2ca974c

Contents?: true

Size: 809 Bytes

Versions: 8

Compression:

Stored size: 809 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

8 entries across 8 versions & 2 rubygems

Version Path
juicer-1.0.13 lib/juicer/merger/javascript_merger.rb
psyho_juicer-1.0.11 lib/juicer/merger/javascript_merger.rb
juicer-1.0.12 lib/juicer/merger/javascript_merger.rb
juicer-1.0.11 lib/juicer/merger/javascript_merger.rb
juicer-1.0.10 lib/juicer/merger/javascript_merger.rb
psyho_juicer-1.0.9 lib/juicer/merger/javascript_merger.rb
juicer-1.0.9 lib/juicer/merger/javascript_merger.rb
juicer-1.0.8 lib/juicer/merger/javascript_merger.rb