Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rebarize.

  • Loading branch information...
commit 6b142ed266c8f61b543179e01a1500fccc0b7191 1 parent 92e7e03
@seancribbs authored
View
3  .gitignore
@@ -1,2 +1,3 @@
-ebin
+ebin/*.beam
*.dump
+.eunit
View
10 Makefile
@@ -0,0 +1,10 @@
+all: compile
+
+compile:
+ @ ./rebar compile
+
+tests:
+ @ ./rebar eunit
+
+clean:
+ @ ./rebar clean
View
25 Rakefile
@@ -1,25 +0,0 @@
-require 'rubygems'
-require 'rake'
-
-ERLC_FLAGS = "+debug_info -W2 -o ebin"
-
-task :default => :test
-
-task :chdir do
- Dir.chdir(File.join(File.dirname(__FILE__), *%w[.]))
-end
-
-task :build => :chdir do
- sh "mkdir -p ebin"
- sh "erlc #{ERLC_FLAGS} src/*.erl"
-end
-
-task :test => :chdir do
- sh "mkdir -p ebin"
- sh "erlc #{ERLC_FLAGS} -DTEST -I etest src/*.erl"
- sh "test/run.es"
-end
-
-task :console => :chdir do
- sh "erl +Bc +K true -smp enable -pa ebin -sname local_console_#{$$} -kernel start_boot_server true"
-end
View
7 ebin/bert.app
@@ -0,0 +1,7 @@
+{application, bert,
+ [
+ {description, "BERT Serialization Library"},
+ {vsn, "1.1.0"},
+ {modules, [bert]},
+ {applications, [kernel, stdlib]}
+ ]}.
View
BIN  rebar
Binary file not shown
View
29 src/bert.erl
@@ -8,7 +8,7 @@
-export([encode/1, decode/1]).
-ifdef(TEST).
--include("test/bert_test.erl").
+-include_lib("eunit/include/eunit.hrl").
-endif.
%%---------------------------------------------------------------------------
@@ -66,4 +66,29 @@ decode_term(Term) ->
TList2 = lists:map((fun decode_term/1), TList),
list_to_tuple(TList2);
_Else -> Term
- end.
+ end.
+
+
+-ifdef(TEST).
+%% encode
+
+encode_list_nesting_test() ->
+ Bert = term_to_binary([foo, {bert, true}]),
+ Bert = encode([foo, true]).
+
+encode_tuple_nesting_test() ->
+ Bert = term_to_binary({foo, {bert, true}}),
+ Bert = encode({foo, true}).
+
+%% decode
+
+decode_list_nesting_test() ->
+ Bert = term_to_binary([foo, {bert, true}]),
+ Term = [foo, true],
+ Term = decode(Bert).
+
+decode_tuple_nesting_test() ->
+ Bert = term_to_binary({foo, {bert, true}}),
+ Term = {foo, true},
+ Term = decode(Bert).
+-endif.
View
23 test/bert_test.erl
@@ -1,23 +0,0 @@
--include_lib("eunit/include/eunit.hrl").
-
-%% encode
-
-encode_list_nesting_test() ->
- Bert = term_to_binary([foo, {bert, true}]),
- Bert = encode([foo, true]).
-
-encode_tuple_nesting_test() ->
- Bert = term_to_binary({foo, {bert, true}}),
- Bert = encode({foo, true}).
-
-%% decode
-
-decode_list_nesting_test() ->
- Bert = term_to_binary([foo, {bert, true}]),
- Term = [foo, true],
- Term = decode(Bert).
-
-decode_tuple_nesting_test() ->
- Bert = term_to_binary({foo, {bert, true}}),
- Term = {foo, true},
- Term = decode(Bert).
View
6 test/run.es
@@ -1,6 +0,0 @@
-#!/usr/bin/env escript
-%% -*- erlang -*-
-%%! -pa ./ebin -sasl -boot start_sasl -noshell
-
-main(_) ->
- bert:test().
Please sign in to comment.
Something went wrong with that request. Please try again.