Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
- updated readme with latest version and project mode info
Browse files Browse the repository at this point in the history
- started to migrate to 2 space indents
- sql now has a try_connection method to allow other code to be wrapped with it
  • Loading branch information
jhoffner committed Mar 14, 2017
1 parent 0543f16 commit 6b55010
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
87 changes: 44 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,49 +70,50 @@ Many languages are currently supported in various states of completeness. This l

**Legend:** `!!!` = Failing Specs, `???` = Status is unknown, `*` = Any

| Language | Version | Basic Run | Test Integration | Codewars | Qualified | Docker Image | Examples | Notes |
|----------------|---------------|--------------|------------------|---------------|----------------|----------------|--------------|-------------------------------------------------------------------------|
| Assembly (GAS) | | !!! | | | | systems-runner | | Travis is failing, tests pass locally |
| Bash | || | Kumite Only | | * | | |
| C | Clang 3.6/C11 || criterion | criterion | | systems-runner | | |
| Clojure | 1.6.0 || clojure.test | clojure.test | clojure.test | jvm-runner | clojure.test | |
| CoffeeScript | 1.10.0 || cw-2 | cw-2 | cw-2 | node-runner | cw-2 | |
| C++ | 14 || igloo | igloo | | systems-runner | | |
| C# | Mono 4.8 || nunit | nunit | nunit | dotnet-runner | nunit | |
| Crystal | 0.21.1 || spec | spec | spec | crystal-runner | spec | |
| Dart | 1.16.1 || test | Kumite Only | | dart-runner | test | |
| Elixir | 1.2.4 || exunit | exunit | | erlang-runner | | |
| Erlang | 18 || | | | erlang-runner | | |
| F# | 4.0 || fuchu | fuchu | | dotnet-runner | Fuchu | Tests should be placed in a module called "Tests", in a Fuchu testList |
| Go | 1.3.1 || | Kumite Only | | alt-runner | | |
| Groovy | || | Kumite Only | | jvm-runner | | |
| Haskell | 7.6.3 || hspec!!! | hspec | hspec | haskell-runner | hspec | An older version is running on CW & Qualified that is fully functional |
| Java | 1.8.0_91 || junit | Yes | Yes | jvm-runner | junit | |
| JavaScript | 0.10.33 || cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| JavaScript | 0.10.33/Babel || cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| JavaScript | 6.0.0 || cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| JavaScript | 6.0.0/Babel || cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| Julia | 0.4.6 || factcheck | factcheck | | | | |
| Kotlin | 1.0.3 || ??? | | | jvm-runner | | |
| Lisp | || | Kumite Only | | func-runner | | |
| Lua | || | Kumite Only | | alt-runner | | |
| Objective-C | 2.0 || cw | cw | | objc-runner | | |
| OCAML | 4.02.3 || ounit | ounit | | ocaml-runner | | Tests should be placed in a module called "Tests", in an array of OUnit labels named "suite" |
| Perl | || | Kumite Only | | * | | |
| Php | 7.0 || cw-2, phpunit | phpunit | phpunit, cw-2 | alt-runner | | |
| Python | 2.7.6 || cw-2, unittest | cw-2 | cw-2, unittest | python-runner | cw-2 | |
| Python | 3.4.3 || cw-2, unittest | | cw-2, unittest | python-runner | cw-2 | |
| R | || | | | alt-runner | | |
| Racket | || | Kumite Only | | func-runner | | |
| Ruby | 2.3.0 || cw-2, rspec | cw-2 | cw-2, rspec | ruby-runner | cw-2 | |
| Rust | 1.10.0 || rust | rust | | | | |
| Scala | 2.11.2 || | Kumite Only | | jvm-runner | | |
| Scss/Sass | | ??? | ??? | | | | | |
| SQL | SQLite3 || rspec | | | | | Current contribution designed for OSX, need to move to OS linux version |
| SQL | Postgres 9.6 || rspec | | | | | Current contribution designed for OSX, need to move to OS linux version |
| Swift | 3.0-dev || cw-2, xctest | xctest | | | | Current contribution designed for OSX, need to move to OS linux version |
| TypeScript | 1.8.10 || mocha | mocha | | node-runner | | TypeScript utilizes `require` instead of concatenating files |

| Language | Version | Basic Run | Project Mode | Test Integration | Codewars | Qualified | Docker Image | Examples | Notes |
|----------------|---------------|------------|--------------|------------------|----------------|----------------|--------------|---------------| ------------------------------------------------------------------------|
| Assembly (GAS) | | !!! | | | | | systems-runner | | Travis is failing, tests pass locally |
| Bash | ||| | Kumite Only | | * | | |
| C | Clang 3.6/C11 || | criterion | criterion | | systems-runner | | |
| Clojure | 1.6.0 || | clojure.test | clojure.test | clojure.test | jvm-runner | clojure.test | |
| CoffeeScript | 1.10.0 || | cw-2 | cw-2 | cw-2 | node-runner | cw-2 | |
| C++ | 14 || | igloo | igloo | | systems-runner | | |
| C# | Mono 4.8 ||| nunit | nunit | nunit | dotnet-runner | nunit | |
| Crystal | 0.21.1 || | spec | spec | spec | crystal-runner | spec | |
| Dart | 1.16.1 || | test | Kumite Only | | dart-runner | test | |
| Elixir | 1.2.4 || | exunit | exunit | | erlang-runner | | |
| Erlang | 18 || | | | | erlang-runner | | |
| F# | 4.0 || | fuchu | fuchu | | dotnet-runner | Fuchu | Tests should be placed in a module called "Tests", in a Fuchu testList |
| Go | 1.8 || | ginkgo | ginkgo | | go-runner | ginkgo | |
| Groovy | || | | Kumite Only | | jvm-runner | | |
| Haskell | 7.6.3 || | hspec!!! | hspec | hspec | haskell-runner | hspec | An older version is running on CW & Qualified that is fully functional |
| Java | 1.8.0_91 || | junit | Yes | Yes | jvm-runner | junit | |
| JavaScript | 0.10.33 ||| cw-2 | cw-2 | cw-2, | node-runner | cw-2 | |
| JavaScript | 0.10.33/Babel ||| cw-2 | cw-2 | cw-2, | node-runner | cw-2 | |
| JavaScript | 6.0.0 ||| cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| JavaScript | 6.0.0/Babel ||| cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
| Julia | 0.4.6 || | factcheck | factcheck | | | | |
| Kotlin | 1.0.3 || | ??? | | | jvm-runner | | |
| Lisp | || | | Kumite Only | | func-runner | | |
| Lua | 5.2 || | busted | busted | | lua-runner | | |
| Objective-C | 2.0 || | cw | cw | | objc-runner | | |
| OCAML | 4.02.3 || | ounit | ounit | | ocaml-runner | | Tests should be placed in a module called "Tests", in an array of OUnit labels named "suite" |
| Perl | || | | Kumite Only | | * | | |
| Php | 7.0 || | cw-2, phpunit | phpunit | phpunit, cw-2 | alt-runner | | |
| Python | 2.7.6 ||| cw-2, unittest | cw-2 | cw-2, unittest | python-runner | cw-2 | |
| Python | 3.4.3 ||| cw-2, unittest | | cw-2, unittest | python-runner | cw-2 | |
| Python | 3.6 ||| cw-2, unittest | | cw-2, unittest | python-runner | cw-2 | |
| R | || | | | | alt-runner | | |
| Racket | || | | Kumite Only | | func-runner | | |
| Ruby | 2.3.0 ||| cw-2, rspec | cw-2 | cw-2, rspec | ruby-runner | cw-2 | |
| Rust | 1.10.0 || | rust | rust | | | | |
| Scala | 2.11.2 || | | Kumite Only | | jvm-runner | | |
| Scss/Sass | | ??? | | ??? | | | | | |
| SQL | SQLite3 ||| rspec | | | | | Current contribution designed for OSX, need to move to OS linux version |
| SQL | Postgres 9.6 ||| rspec | | | | | Current contribution designed for OSX, need to move to OS linux version |
| Swift | 3.0-dev || | cw-2, xctest | xctest | | | | Current contribution designed for OSX, need to move to OS linux version |
| TypeScript | 1.8.10 || | mocha | mocha | | node-runner | | TypeScript utilizes `require` instead of concatenating files |
## Setup

You should have [Docker](https://www.docker.com/) installed, if not do that first. Before you can run any of the code
Expand Down
35 changes: 22 additions & 13 deletions frameworks/ruby/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def select_cmd?(cmd)
end

def run_cmd(cmd)
select_cmd?(cmd) ? DB[cmd] : DB.run(cmd)
try_connection do
select_cmd?(cmd) ? DB[cmd] : DB.run(cmd)
end
end

def split_sql_commands(sql)
Expand Down Expand Up @@ -122,8 +124,26 @@ def pluck_unique(column_name, results = last_results)
results.map {|r| r[column_name]}.uniq
end

def try_connection
begin
yield
rescue Sequel::DatabaseConnectionError => cex
Display.status "Connection error: #{cex.message}, retrying in 1 second..."
sleep 1
retry
rescue => ex
if defined?(PG::ConnectionBad)
if ex.is_a?(PG::ConnectionBad)
sleep 1
Display.status "Connection not ready, retrying in 1 second..."
retry
end
end
end
end

# connect the database
begin
try_connection do
Display.status "Connecting to database..."
# Setup database connection
DATABASE = ENV['DATABASE_NAME']
Expand All @@ -144,15 +164,4 @@ def expected
end
END
end

rescue => ex
if defined?(PG::ConnectionBad)
if ex.is_a?(PG::ConnectionBad)
sleep 1
Display.status "Connection not ready, retrying in 1 second..."
retry
end
end
end


Loading

0 comments on commit 6b55010

Please sign in to comment.