Jesse Gumm
a2fac85ff6
Disambiguate parsing "Aug 12" and "12 Aug".
...
This started with just trying to parse the date format:
December 21st, 2013 7:00pm, which was failing with a bad_date error.
The solution involved setting up "Hinted Months", which was just a term
I used to indicate that a month was specified by name (ie "December"),
rather than by number (ie, "12"). Previously, named months were simply
replaced by their respective numbers in the parser. This tags those
named months so that the parser will unambiguously parse them correctly.
A tagged "Hinted Month" is simply a tuple with the tag `?MONTH_TAG`. For
example: "December" gets converted to `{?MONTH_TAG, 12}`
For example: "Aug 12" and "12 Aug". It's clear to the *reader* what is
meant, but when converted to simply 8 and 12, the parser has no way of
knowing which is which.
Doing this was aided with the addition of some macros to help it
along, since doing just straight comparisons with the hinted months was
yielding unexpected results. For example: `{mon, 1} > 31` returns
true, so changing that comparison to an ?is_year/1 macro that does:
`is_integer(Y) andalso Y > 31`.
It might not be a bad idea to help the parser be *very* unambiguous by
putting these macros on all comparisons.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 18:03:21 -05:00
Ben Kearns
97d39ec8db
Added support for ISO8601 Zulu and TZ time zone support. Remove hard coded version string in rebar.config.script for unit test pass. Remove dializer and edoc from default target to enable tests to run on Travis-ci
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:58:08 -05:00
Ben Kearns
320813e56e
Fixed type-o in .travis.yml
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:50:05 -05:00
Ben Kearns
4558635813
Fix broken tests.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:49:38 -05:00
Ben Kearns
122af09cb1
Added more tests and fixed format string to be 24 hour vs 12 hour.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:49:27 -05:00
Ben Kearns
5b23329d3a
Added tests and validated parse->format->parse and nparse->format->nparse
...
Conflicts:
src/ec_date.erl
2013-02-26 17:48:51 -05:00
Ben Kearns
5beeb3ff1b
Fix for dializer error.
...
Conflicts:
src/ec_date.erl
2013-02-26 17:44:31 -05:00
Ben Kearns
3437fc8c1c
Another fix for spec messages.
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 17:43:03 -05:00
Ben Kearns
5c6af5c7f5
Added dializer fix for new date format.
...
Conflicts:
src/ec_date.erl
2013-02-26 17:42:32 -05:00
Ben Kearns
e28130d9f3
Added parsing of ISO formats i.e. "2012-12-19T12:12:12.00001"
...
Conflicts:
src/ec_date.erl
2013-02-26 17:40:13 -05:00
Ben Kearns
5429ec2d14
Point rebar to fix of proper library for eunit.
...
Signed-off-by: Eric Merritt <ericbmerritt@gmail.com>
2013-01-21 10:51:11 -08:00
Ben Kearns
21c5f9fc74
Added parsing of ISO formats i.e. "2012-12-19T12:12:12.00001"
...
Signed-off-by: Eric Merritt <ericbmerritt@gmail.com>
2013-01-21 10:51:10 -08:00
Jordan Wilberding
0f409c0bf3
Merge pull request #32 from ericbmerritt/next
...
Next
2013-01-17 14:44:14 -08:00
Eric Merritt
74b0d7318d
support parsing a version with a leading 'v'
...
This *should* make version parsing much, much simpler.
2013-01-17 14:31:45 -08:00
Eric Merritt
407ccf886f
support printing erl_syntax meta calls in the same way as erl source
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-12-07 05:53:25 -07:00
Eric Merritt
95f723e1e0
make erlware_commons work on pre-R15 releases
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-12-07 05:53:21 -07:00
Eric Merritt
8d300f5d02
massively expand the documentation in the README
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
c7717743ed
bring ec_plists up to erlware standards
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
31ebca114a
replace ec_plists with Stephan's plists
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
0e10d59b3a
add Stephen Marsh's plists to the system
...
origin: http://code.google.com/p/plists/
detail: http://plists.wordpress.com/2007/09/20/introducing-plists-an-erlang-module-for-doing-list-operations-in-parallel/
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
dda4c85586
reorder default tasks so dialyzer is run after compile
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
1a1b87bf53
add a clean and rebuild task to makefile
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
b5371974d1
add fullpath to the makefile
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
c4887e2021
enable the rebar semver plugin on erlware_commons
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
1540fb1652
cleanup the rebar config
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-30 11:45:21 -06:00
Eric Merritt
7e4ba401fd
support non-numeric versions in major/minor/patch/minor-patch
...
This allows for two things. The first is support for non rigorous
versions. However, it still fully supports semver. So if you have
semver versions they work correctly, if you have alpha versions they
also work correctly but using natural alpha ordering.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-19 11:15:27 -06:00
Eric Merritt
0db7042ff9
support reasonable versioning for erlware_commons
...
You should get the latest and greatest rebar to build this.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-19 11:15:15 -06:00
Eric Merritt
f77afd43c3
add exists to ec_file
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-10-19 11:15:09 -06:00
Eric Merritt
a9f2a771f0
fix bug in ec_file:copy/3 spec
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
eab58fb660
export mkdir_p (this should have been done already)
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
b4ab414419
support four primary version numbers of in parsing
...
The OTP Versions distributed with erlang tend to have four version
numbers not three. This is a fairly minor deviation from semver that
we can support. Basically, the semver parser treats the fourth version
in exactly the same way as the other three.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
5105df48f9
minor whitespace cleanup for ec_semver
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
e9161d8688
provide the ability to format a version into a string as well as parse a version
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
0c34549901
make sure the docs get run as part of a bare make
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
3a29539285
fixes for edoc compilation
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
1b01380613
compilation utilities for the implementors
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-18 20:06:47 -06:00
Eric Merritt
c42581887a
version bump 0.8.0
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:31 -05:00
Eric Merritt
67acaaaf3f
minor fixes and enhancements to the makefile
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:30 -05:00
Eric Merritt
4db670c812
given a complete semver parser ec_string no longer makes sense to retain
...
It was really poorly named in any case
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:28 -05:00
Eric Merritt
bf37ad9492
suport proper semver parsing and comparison in the semver module
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:27 -05:00
Eric Merritt
9b9f070a5f
move ec_file away from exceptions to return values
...
In an attempt to unify on the accepted use of return values ec_file is
changing its API to use return values instead of exceptions.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:26 -05:00
Eric Merritt
a2672cafb1
minor whitespace cleanup
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:24 -05:00
Eric Merritt
cf8cad00df
make sure ec_dictionary gets built first
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:23 -05:00
Eric Merritt
e035ae3dbf
fixes to dialyzer
...
All types should now be correct and dialyzer runs successfully
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:21 -05:00
Eric Merritt
7e42c243b0
add travis support to the system
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:59:19 -05:00
Eric Merritt
d7b60ccf19
fix edoc errors in various modules
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:51:32 -05:00
Eric Merritt
51b5a41c63
add a full makefile that drives rebar
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:51:32 -05:00
Eric Merritt
9514b16993
add rebar files to gitignore
...
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-09-08 09:50:43 -05:00
Jordan Wilberding
8d625ceb46
Merge remote branch 'ericbmerritt/master' into rv
...
* ericbmerritt/master:
add beam files to gitignore
make insecure nature of ec_file:mkdtemp obvious fixes erlware/erlware_commons#16
fix eunit tests so that they actually work and run
make mkdtemp a lot more secure (still not fully secure but more).
add . files to gitignore
Migrate erlware_commons to rebar support
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2012-06-05 19:58:17 -04:00
Eric Merritt
3e5eeb8cf7
add beam files to gitignore
2012-06-05 17:59:54 -05:00