<commit_before>= rake-minify

Rake Minify is an exetremely simple solution for minifying javascript files using a rake task.

== Installation

First, install the gem:

  gem install rake-minify

Or if your are using Bundler:

  echo "gem 'rake-minify'" >> Gemfile
  bundle install

== Minifying a single JavaScript file

Open your Rakefile and add:

  Rake::Minify.new(:minify_single) do
    dir("path/to/your/dir") do # we specify only the source directory
      add("output.js", "source.js") # the output file name is full path
    end
  end

This task minify the file "path/to/your/dir/source.js" into the file "output.js".

== Minify multiple JavaScript files

Open your Rakefile and add:

  Rake::Minify.new(:minify_multiple) do
    dir("path/to/your/dir") do # we specify only the source directory
      group("output-multi.js") do # the output file name is full path
        add("first.js")
        add("second.js")
      end
    end
  end

This task packs and minify the files "path/to/your/dir/first.js" and
"path/to/your/dir/second.js" into the file "output-multi.js".

== Combine only multiple JavaScript files

Open your Rakefile and add:

  Rake::Minify.new(:minify_and_combine) do
    dir("path/to/your/dir") do # we specify only the source directory
      group("output-first-second.js") do
        add("first.js", :minify => false) # this file is not minified
        add("second.js")
      end
    end
  end

== CoffeeScript support

The rake-minify gem now supports even CoffeeScript files to be compiled,
minified and bundled, just include them like javascript files.

CoffeeScript support requires the coffe-script gem, so install the gem:

  gem install coffee-script

Or if your are using Bundler:

  echo "gem 'coffee-script'" >> Gemfile
  bundle install

Then open your Rakefile and add:

  Rake::Minify.new(:minify_single) do
    dir("path/to/your/dir") do # we specify only the source directory
      add("output.js", "source.coffee") # the coffee file is compiled and minified
    end
  end


== Contributing to rake-minify
 
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet<commit_msg>Added bare mode documentation to README.rdoc.<commit_after>= rake-minify

Rake Minify is an exetremely simple solution for minifying javascript files using a rake task.

== Installation

First, install the gem:

  gem install rake-minify

Or if your are using Bundler:

  echo "gem 'rake-minify'" >> Gemfile
  bundle install

== Minifying a single JavaScript file

Open your Rakefile and add:

  Rake::Minify.new(:minify_single) do
    dir("path/to/your/dir") do # we specify only the source directory
      add("output.js", "source.js") # the output file name is full path
    end
  end

This task minify the file "path/to/your/dir/source.js" into the file "output.js".

== Minify multiple JavaScript files

Open your Rakefile and add:

  Rake::Minify.new(:minify_multiple) do
    dir("path/to/your/dir") do # we specify only the source directory
      group("output-multi.js") do # the output file name is full path
        add("first.js")
        add("second.js")
      end
    end
  end

This task packs and minify the files "path/to/your/dir/first.js" and
"path/to/your/dir/second.js" into the file "output-multi.js".

== Combine only multiple JavaScript files

Open your Rakefile and add:

  Rake::Minify.new(:minify_and_combine) do
    dir("path/to/your/dir") do # we specify only the source directory
      group("output-first-second.js") do
        add("first.js", :minify => false) # this file is not minified
        add("second.js")
      end
    end
  end

== CoffeeScript support

The rake-minify gem now supports even CoffeeScript files to be compiled,
minified and bundled, just include them like javascript files.

CoffeeScript support requires the coffe-script gem, so install the gem:

  gem install coffee-script

Or if your are using Bundler:

  echo "gem 'coffee-script'" >> Gemfile
  bundle install

Then open your Rakefile and add:

  Rake::Minify.new(:minify_single) do
    dir("path/to/your/dir") do # we specify only the source directory
      add("output.js", "source.coffee") # the coffee file is compiled and minified
    end
  end

=== Bare mode

Since version 0.3.0 rake-minify support the configuration of the coffee script bare switch
(see http://jashkenas.github.com/coffee-script/#installation for details).
However in the 0.2.x series that flag was assumed as true, now it defaults to false.

You can specify it:

  Rake::Minify.new(:minify_single) do
    # the coffee file is compiled and minified without the
    # without the top-level function safety wrapper.
    add("output.js", "source.coffee", :bare => true) 
  end

== Contributing to rake-minify
 
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
{'fraction_non_alphanumeric': 0.0909463334698894, 'fraction_numerical': 0.0010241704219582138, 'mean_word_length': 3.479816513761468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '1714980', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1469, 'n_words': 577}