Commit graph

150 commits

Author SHA1 Message Date
Joe DeVivo
381189c006 Made grep version command's grep POSIX 2015-07-12 07:31:08 -07:00
Joe DeVivo
2d634c5e46 Made version prefix configurable in ec_git_vsn 2015-07-10 09:37:21 -07:00
Tristan Sloughter
d726ba2742 move to rebar3 and bump version 2015-06-22 17:06:50 -05:00
Jordan Wilberding
2e23e43079 Merge pull request #81 from tsloughter/master
fix conversion of ask/2 string
2015-06-01 11:15:41 -07:00
Tristan Sloughter
4c20e1903d fix conversion of ask/2 string 2015-05-31 12:04:54 -05:00
Jordan Wilberding
ef0d252b11 Merge pull request #79 from tsloughter/master
18.0 Support
2015-04-23 16:16:34 -07:00
Tristan Sloughter
7015ba2951 remove use of deprecated function erlang:now/0 2015-04-23 17:56:56 -05:00
Tristan Sloughter
e07d08333a use #atom{} syntax to support 18 2015-04-23 17:49:34 -05:00
Jesper Louis Andersen
aa373dddbe Introduce simple, preliminary TERM capability query.
When erlware_commons logs to the command_line, it assumes the
environment has common modern capabilities and color display. In
general, this is not the case and then color codes are sent verbatim
to the terminal.

This patch introduces a new field in #state_t{}, term_cap, encoding
if the terminal runs with 'full' or 'dumb' capabilities. In the latter case,
color display is suppressed. Initialization of the #state_t{} record queries
the environment once for the TERM variable in order to figure out what
it supports. The default is 'full' capability to be fully backwards compatible.
2015-02-11 17:10:16 +01:00
Jesper Louis Andersen
6079300634 Refactor: fold colorize_/3 into colorize/4.
Fold a local one-line leaf function with exactly one call-site into its caller.
2015-02-11 17:05:33 +01:00
Brian Lee Yung Rowe
441d11820d Parse Twitter-style dates 2014-12-10 10:59:24 -05:00
Jordan Wilberding
ae608d26e1 Merge pull request #74 from tsloughter/git_vsn
make git vsn the same as used in rebar_vsn_plugin
2014-11-03 13:57:18 -08:00
Tristan Sloughter
5ef8371020 make git vsn the same as used in rebar_vsn_plugin 2014-11-03 11:55:06 -06:00
Jordan Wilberding
d4d11ed1ba Merge pull request #71 from wk8/jr/iso8601
Adding an `ec_test:format_iso8601/1` fun to format datetimes according to ISO8601 standards
2014-10-01 14:21:41 -07:00
Jean Rouge
0b47f60bfb Have dialyzer run on Travis for OTP 17 too
v17 does not have the leading 'R'
```
erl -noshell -eval 'io:format("~p", [erlang:system_info(otp_release)]), erlang:halt(0).'
"17"
```
So the dialyzer wouldn't run in the Travis builds.

And a minor spec fix to appease v17's dialyzer.
2014-10-01 12:31:47 -07:00
Tristan Sloughter
4fb4199da3 fix error log message being colored green instead of red 2014-09-27 14:06:49 -05:00
Jean Rouge
c25dce9689 Adding an ec_test:format_iso8601/1 fun to format datetimes according to ISO8601 standards
And added a couple unit tests on it.
2014-09-12 12:28:59 -07:00
Jamie Winsor
7a32f52e7d add ec_file:is_dir/1
use ec_file:is_dir/1 to identify symlinks which are directories
Ensure contents of symlinked directories are copied when using ec_file:copy/3
2014-07-09 14:51:50 -07:00
Tristan Sloughter
3121c892b4 support r14/15 crypto 2014-05-24 09:42:57 -05:00
Low Kian Seong
73f21ee770 Adding sha1sum method 2014-05-16 10:38:13 +08:00
Low Kian Seong
cc7f6dd0df changes to add another clause to the directory/file check 2014-05-14 22:42:59 +08:00
Low Kian Seong
bd6fd557d5 Found a typo while reading docs. Correcting 2014-05-08 11:10:38 +08:00
Tristan Sloughter
523a66ad74 handle deprecated pre-defined types for 17.0 and later 2014-04-22 10:32:44 -05:00
Jordan Wilberding
449051bcd6 Fix argument for iolist_to_binary call 2014-03-28 08:39:26 +01:00
Eric B Merritt
47bcbd49b6 Suppport a vsn signature with a git implementation 2014-03-26 13:32:24 -07:00
Tristan Sloughter
06390816b9 fix includings of headers 2013-10-24 18:48:34 -05:00
Eric Merritt
efdd2a1092 fix dialyzer issues 2013-10-14 16:20:33 -07:00
Eric Merritt
54f568e826 update the ec_semver_parser 2013-10-14 14:10:47 -07:00
Eric Merritt
16b441f0e3 fix up tests to reflect the actual NOTEST variable DEV_ONLY 2013-10-14 14:10:25 -07:00
Eric Merritt
4973a0fb8f fix formatting problems in ec_date 2013-10-14 13:52:45 -07:00
Eric Merritt
558185b9b9 add a command line programming module to the system
This is a general module that helps output from command line
applications written in erlang.
2013-10-14 09:26:54 -07:00
Eric Merritt
79c5436c85 add utility type conversions to erlware commons 2013-10-14 09:26:47 -07:00
Jesse Gumm
8bc27f62fd Add vi modelines to files. Ignore vim backup files 2013-08-30 06:56:06 -05:00
Eric B Merritt
8870c422ca minor updates from a new version of neotoma 2013-04-24 09:54:55 -07:00
Eric B Merritt
652fcc1e23 remove ec_file:consult/1 as it provides very little value Fixes #1 2013-04-24 09:54:34 -07:00
Jordan Wilberding
f36f333374 Merge pull request #40 from choptastic/fix-12pm
Fix Formatting AM/PM for 12PM ({Date,{12,0,0}})
2013-04-23 19:02:01 -07:00
Jesse Gumm
e984618c3e Fix Formatting AM/PM for 12PM ({Date,{12,0,0}}) 2013-04-23 17:07:52 -05:00
Seth Falcon
d9c6ec1d28 Make proper and neotoma dev-only dependencies
This patch makes erlware_commons easier to include as a dependency by
removing depedencies that are not needed at run time.

The top-level Makefile creates a .DEV_MODE marker file which is
detected by rebar.config.script. When the marker file is present, the
development only dependencies proper and neotoma are included and a
macro 'DEV_ONLY' is defined. The macro is used to only enable the
proper tests for development mode.

The ec_semver_parser.peg is now located in priv/ and is moved into
src/ by the Makefile. The generated ec_semver_parser.erl is now under
version control; it need not be rebuilt by all projects wishing to
include erlware_commons. It will be rebuilt, as before this change, on
every make invocation.
2013-04-22 14:48:08 -07:00
Eric B Merritt
17e08c04a2 make ec_file a bit more friendly to binary file names 2013-04-09 10:51:11 -07:00
Jordan Wilberding
1cd615ef58 Merge pull request #35 from ericbmerritt/next
add file type discovery and resolution to ec_file
2013-03-14 20:46:01 -07:00
Eric Merritt
e1e30f4a75 add file type discovery and resolution to ec_file 2013-03-14 11:50:49 -07:00
Jesse Gumm
4ba12ec4ad Add disambig tests, add disambig parsing date-only
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
2013-02-26 18:03:30 -05:00
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
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