-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38625b0
commit 614c970
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
/book/build | ||
/book/build | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "tomlrb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'tomlrb' | ||
|
||
# Helper functions | ||
def ensure_build | ||
system "cargo build --release" | ||
if $?.exitstatus != 0 | ||
puts "Oops, we could not build the project!" | ||
exit 1 | ||
end | ||
end | ||
|
||
def select_stage | ||
toml_data = Tomlrb.load_file('Course.toml') | ||
return toml_data['test']['level'] | ||
end | ||
|
||
# Build the project | ||
puts "Building the project..." | ||
ensure_build | ||
|
||
# Run the tests | ||
puts "Running tests..." | ||
stage = select_stage | ||
system "cargo test --release --features stage#{stage}" | ||
|
||
# Congrats! | ||
puts "All Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters