-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathRakefile
38 lines (33 loc) · 912 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require "bundler/gem_tasks"
desc "Run test"
task :test do
ruby("test/run.rb")
end
release_task = Rake.application["release"]
release_task.prerequisites.delete("build")
release_task.prerequisites.delete("release:rubygem_push")
release_task_comment = release_task.comment
if release_task_comment
release_task.clear_comments
release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
end
namespace :version do
desc "Bump version"
task :bump do
version_rb_path = "lib/fiddle/version.rb"
version_rb = File.read(version_rb_path).gsub(/VERSION = "(.+?)"/) do
version = $1
"VERSION = \"#{version.succ}\""
end
File.write(version_rb_path, version_rb)
end
end
if RUBY_ENGINE == "ruby"
require 'rake/extensiontask'
Rake::ExtensionTask.new("fiddle")
Rake::ExtensionTask.new("-test-/memory_view")
task test: :compile
else
task :compile
end
task default: :test