<commit_before><commit_msg>Adding sketch for new concat command<commit_after># -*- coding: utf-8 -*-

require "juicer/cli"
require "juicer/io_proxy"

module Juicer
  #
  # Author::    <NAME> (<EMAIL>)
  # Copyright:: Copyright (c) 2009 <NAME>
  # License::   BSD
  #
  module Command
    class Concat
      include Juicer::Loggable

      def initialize(args = nil)
        opts = Trollop::options(args) do
          banner "Resolve dependencies and concatenate files"
          opt :output, "File to write concatenated contents to", :default => nil, :type => :string
          opt :type, "css or javascript. Not necessary to specify when using files", :default => "css"
        end

        @output = Juicer::IOProxy.new(opts[:output] || $stdout, "w")
        @type = opts[:type]
        @files = args
      end

      def execute
        input = Juicer::Cli.file_input(args)
        asset = Juicer.load_lib(input.type).new(input.to_a)
        asset.export(@output, :inline_dependencies => true)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12109375, 'fraction_numerical': 0.0048828125, 'mean_word_length': 2.6476868327402134, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1334497', 'n_tokens_mistral': 323, 'n_tokens_neox': 308, 'n_words': 91}