Permalink
Browse files

Get rid of Ruby stuff

  • Loading branch information...
1 parent 7ad1edf commit 012846d9f70c56d61386c9cd8105924693dc002a @pusewicz committed Feb 21, 2012
Showing with 10 additions and 224 deletions.
  1. +0 −4 Gemfile
  2. +0 −12 Gemfile.lock
  3. +10 −0 Makefile
  4. +0 −114 Rakefile
  5. +0 −43 Watchfile
  6. +0 −51 bin/colorize
View
@@ -1,4 +0,0 @@
-source :rubygems
-
-gem "watchr"
-gem "rake", "0.9.2"
View
@@ -1,12 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- rake (0.9.2)
- watchr (0.7)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- rake (= 0.9.2)
- watchr
View
@@ -0,0 +1,10 @@
+.PHONY: test
+
+all: deps
+ ./rebar compile
+
+deps:
+ ./rebar get-deps
+
+test:
+ ./rebar eunit
View
114 Rakefile
@@ -1,114 +0,0 @@
-require 'rake/clean'
-
-ERL_VER = 'R14B03'
-ERL_HOME = "/usr/local/Cellar/erlang/#{ERL_VER}/bin"
-
-abort "Please install Erlang #{ERL_VER}: brew update; brew install erlang" unless File.exist?(ERL_HOME)
-
-# Set PATH to use newer Erlang
-ENV["PATH"] = ERL_HOME + ":" + ENV["PATH"]
-
-APPS_EBINS = Dir["ebin"]
-LIBS_EBINS = Dir["/usr/local/lib/erlang/lib/*/ebin"]
-
-ALL_EBINS = APPS_EBINS + LIBS_EBINS
-
-INCLUDE_DIRS = Dir["include"] unless defined?(INCLUDE_DIRS)
-
-CLEAN.include("ebin/*.beam")
-CLEAN.include("*/.eunit")
-CLOBBER.include("ebin/*.beam")
-
-FLAGS = %w(
-+warn_unused_vars
-+warn_export_all
-+warn_shadow_vars
-+warn_unused_import
-+warn_unused_function
-+warn_bif_clash
-+warn_unused_record
-+warn_deprecated_function
-+warn_obsolete_guard
-+strict_validation
-+warn_export_vars
-+warn_exported_vars
-+warn_missing_spec
-+warn_untyped_record
-+debug_info
-).join(' ') unless defined?(FLAGS)
-
-ERLC_FLAGS = INCLUDE_DIRS.map { |i| "-I#{i}" }.join(' ') + " -Ideps #{FLAGS}" unless defined?(ERLC_FLAGS)
-
-SRC = FileList['src/*.erl']
-OBJ = SRC.pathmap("%{src,ebin}X.beam")
-
-rule ".beam" => ["%{ebin,src}X.erl"] do |t|
- ebin = File.dirname(t.name)
- sh "erlc -W #{ERLC_FLAGS} -o #{ebin} #{t.source}"
-end
-
-task :default => :compile
-
-desc "Watch files for changes and compile them"
-task :watch do
- sh("bundle exec watchr Watchfile")
-end
-
-desc "Get deps and compile"
-task :compile => ['rebar:get_deps', 'rebar:compile']
-
-task :default => :compile
-
-desc "Run tests"
-task :test => ['rebar:eunit']
-
-namespace :rebar do
- task :compile do
- rebar :compile
- end
-
- task :clean do
- rebar :clean
- end
-
- task :build_plt do
- rebar 'build-plt', { skip_deps: true }
- end
-
- task :check_plt do
- rebar 'check_plt', { skip_deps: true }
- end
-
- task :dialyze do
- rebar :dialyze, { skip_deps: true }
- end
-
- task :xref do
- rebar :xref, { skip_deps: true }
- end
-
- task :get_deps do
- rebar 'get-deps'
- end
-
- task :update_deps do
- rebar 'update-deps'
- end
-
- task :delete_deps do
- rebar 'delete-deps'
- end
-
- task :generate do
- rebar :generate
- end
-
- task :eunit do
- rebar :eunit, { skip_deps: true }
- end
-
- def rebar(cmd, opts = {})
- rebar_opts = opts.map { |k, v| "#{k}=#{v}" }.join(' ')
- sh "./bin/colorize ./rebar #{cmd} #{rebar_opts}"
- end
-end
View
@@ -1,43 +0,0 @@
-RED = "\x1b[31m" unless defined?(RED)
-GREEN = "\x1b[32m" unless defined?(GREEN)
-RESET = "\x1b[0m" unless defined?(RESET)
-
-FILES = [] unless defined?(FILES)
-
-watch('(src|test)/.*\.erl') do |md|
- FILES << file = md[0].gsub('src', 'ebin').gsub('.erl','.beam')
-
- compile(file)
-
- if $?.success?
- FILES.delete(file)
- FILES.each do |f|
- compile(f)
- end
- puts GREEN + "Success compiling `#{md[0]}'" + RESET
- cmd("rake test")
- else
- puts RED + "Error compiling `#{md[0]}'" + RESET
- end
-end
-
-watch('include/.*\.hrl') do |md|
- cmd("rake clean")
- cmd("rake compile")
-
- if $?.success?
- puts GREEN + "Success compiling `#{md[0]}'" + RESET
- cmd("rake test")
- else
- puts RED + "Error compiling `#{md[0]}'" + RESET
- end
-end
-
-def compile(file)
- cmd "rake #{file}"
-end
-
-def cmd(command)
- puts command
- system "./bin/colorize #{command}"
-end
View
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-
-command = ARGV.join(' ')
-
-RED = 31
-GREEN = 32
-YELLOW = 33
-BOLD_YELLOW = "1;33"
-GREY = 37
-MAGENTA = 35
-
-BG_YELLOW = 43
-BG_BLUE = 44
-BG_RED = 41
-BG_MAGENTA = 45
-
-def set_color(fg, bg)
- print "\x1b[#{fg}m" if fg
- print "\x1b[#{bg}m" if bg
-end
-
-def reset_color
- print "\x1b[0m"
-end
-
-def print_color(txt, fg, bg = nil)
- set_color(fg, bg)
- print txt.chomp
- reset_color
- print "\n" if txt =~ /\n$/
-end
-
-output = %x{#{command}}
-exit_status = $?.exitstatus
-
-output.each_line do |line|
- case line
- when /Warning/ then print_color(line, YELLOW)
- when /\*failed\*/, /context setup failed/, /error/i, /function (.*) undefined/ then print_color(line, RED)
- when /={3,}/ then print_color(line, GREEN)
- when /Failed: (\d+)\. Skipped: (\d+)\. Passed: (\d+)\./ then print_color("Failed: #{$1}. ", RED); print_color("Skipped: #{$2}. ", YELLOW); print_color("Passed: #{$3}\n", GREEN)
- when /One or more tests were cancelled./ then print_color(line, YELLOW)
- when /One or more eunit tests failed./ then print_color(line, RED)
- when /There were no tests to run./ then print_color(line, MAGENTA)
- when /tests? passed./i then print_color(line, GREEN)
- else
- print line
- end
-end
-
-exit exit_status

0 comments on commit 012846d

Please sign in to comment.