summaryrefslogtreecommitdiffhomepage
path: root/Rakefile
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-10-09 15:58:30 -0400
committerTom Black <[email protected]>2016-10-09 15:58:30 -0400
commit4b3cd2c81ad8c03dd25bbb8617e54e349054fcf5 (patch)
treeb96ebeb06630ad154378bde61718629291e3a41e /Rakefile
parent96bdd3584cb3818474fc01b50444dadbe5e85fbe (diff)
downloadruby2d-4b3cd2c81ad8c03dd25bbb8617e54e349054fcf5.tar.gz
ruby2d-4b3cd2c81ad8c03dd25bbb8617e54e349054fcf5.zip
Update Rakefile
`run_test` now only runs the test (not build or run spec); now separate tasks for uninstall, build, install.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile26
1 files changed, 17 insertions, 9 deletions
diff --git a/Rakefile b/Rakefile
index fa3ad4c..e3c43a6 100644
--- a/Rakefile
+++ b/Rakefile
@@ -23,9 +23,7 @@ def run_cmd(cmd)
end
def run_test(file)
- Rake::Task['build'].invoke
- Rake::Task['spec'].invoke
- print "==> ".blue, "running tests/#{file}.rb".bold, "\n"
+ print "\n==> ".blue, "running tests/#{file}.rb".bold, "\n"
system "( cd tests/ ; ruby #{file}.rb )"
end
@@ -33,19 +31,27 @@ end
task default: 'all'
-desc "Run the RSpec tests"
-RSpec::Core::RakeTask.new do |t|
- print "\n==> ".blue, "running RSpec".bold, "\n\n"
- t.pattern = "spec/*spec.rb"
+desc "Uninstall gem"
+task :uninstall do
+ run_cmd "gem uninstall ruby2d --executables"
end
desc "Build gem"
task :build do
- run_cmd "gem uninstall ruby2d --executables"
run_cmd "gem build ruby2d.gemspec --verbose"
+end
+
+desc "Install gem"
+task :install do
run_cmd "gem install ruby2d-#{Ruby2D::VERSION}.gem --local --verbose"
end
+desc "Run the RSpec tests"
+RSpec::Core::RakeTask.new do |t|
+ print "\n==> ".blue, "running RSpec".bold, "\n\n"
+ t.pattern = "spec/*spec.rb"
+end
+
desc "Run testcard"
task :testcard do
run_test 'testcard'
@@ -61,8 +67,10 @@ task :controller do
run_test 'controller'
end
-desc "Test and build"
+desc "Uninstall, build, install, and test"
task :all do
+ Rake::Task['uninstall'].invoke
Rake::Task['build'].invoke
+ Rake::Task['install'].invoke
Rake::Task['spec'].invoke
end