View Source Changelog
5.0.0
Overview
This version adds support for running solutions against multiple example inputs
in both iex and in test modules. Since this requires changing the naming scheme
of example files, users who wrote tests that rely on example input must run
mix aoc.get to fetch the examples for each day that uses example input in
tests.
Detailed Changelog
- Make
mix aoc.getfetch and store each example input, not just the first (this is useful when several example are available or when part 2 supplies additional examples) - Update
example_path/1andexample_string/1to accept an:noption to retrieve the n-th example (0-based). - Add
AOC.IEx.list_examples/1to show the available examples. - Update
AOC.Caseso thatexample_path/1andexample_string/1optionally accept the index of the example to use. - Remove warning on freshly generated aoc code about unused input.
4.0.1
- Make
mix aoc.genuseexample_string()instead ofexample_input(), which doesn't exist.
4.0.0
Overview
Dropping support for helper functions in solution modules
This update makes the "puzzle input" method introduced in 3.0.0 the only way to write solution modules. The old, "helper function" method is no longer supported.
The helper function method worked as follows:
aoc year, day do
def p1, do: input_string() |> # Solve puzzle
endThe puzzle input method works as follows:
aoc year, day do
def p1(input), do: input |> # solve puzzle
endInput is provided through the use of the helpers in AOC.IEx.
The input method is preferred as it makes it easier to test your solution using different inputs without the need to modify any code. It also makes it significantly easier to write tests for your solution module.
Users who wish to keep using the helper method are advised to stick to version 3 of Advent of Code Utils.
aoc_test/4
This update adds optional support for generating unit test modules for your solution modules. You can now write:
aoc_test year, day do
endWhich will create an ExUnit.Case which tests your solution module. The
generated case will automatically call the doctests of your solution module.
mix aoc.gen can now also generate this test code and add doctests to your
solution module.
Detailed Changelog
- Introduce
AOC.aoc_test/4,AOC.Case. - Update
mix aoc.gento generate unit test files - Remove
example_path/1,input_path/1,example_string/1,input_string/1,example_stream/1,input_stream/1fromAOCmodule. - Remove
example_stream/1,input_stream/1fromAOC.IEx. - Rename
fetch_exampleconfiguration tofetch_example?for consistency.
3.1.3
- Optionally show the elapsed time when calling a
p1,p2,p1i,p1e,p2iandp2e. This is done when thetime_calls?configuration option is set to true.
3.1.2
AOC.IEx.mod/1now callsCode.ensure_loaded!/1to ensure the target module is loaded. This is done to prevent issues wherep1eandp1icomplain that the target module does not exist.
3.1.1
input_stream,input_string,example_streamandexample_stringnow only trim trailing newlines, not significant whitespace.
3.1.0
- Timezone support: the project now accepts a
time_zoneconfiguration setting which can be used to specify the time zone used by the input fetcher and iex helpers. This can be set to a time zone string, to:aocor to:local(the default).:localuses the system time, as before, while:aocuses the advent of code time zone (i.e. EST).
3.0.0
AOC.IExhas been reworked.- All functions accept an
optskeyword list used to specify year or day when needed. p1andp2now accept puzzle input as an argument, making it easier to switch between different inputs or examples.- Introduce
p1e,p1i,p2eandp2ito facilitate callingp1orp2with example or puzzle input. - Introduce wrapper functions
example_path/1,input_path/1,example_string/1,input_string/1,example_stream/1andinput_stream/1to facilitate experimentation inside iex.
- All functions accept an
- Update
AOCdocumentation to reflect to new workflow. - Update
mix aoc.gento generate a template more suited to new workflow.
2.0.2
- Pass user agent when using
mix aoc.get
2.0.1
- Update ex_doc, add typespecs to public functions.
2.0.0
input_stringandexample_stringnow both callString.trim_trailing/1on the returned string.
1.1.0
- Download example input when using
mix aoc.get. - Add
example_*functions toAOCmodule.
1.0.1
- Make
input_*functions public (definstead ofdefp) to facilitate debugging.
1.0.0
- Initial stable release