forked from nov/jose-php
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
30 lines (27 loc) · 692 Bytes
/
Rakefile
File metadata and controls
30 lines (27 loc) · 692 Bytes
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
def exec(command, stdout_required = false)
if stdout_required
`#{command}`
else
system command
end
end
desc 'run test'
task :spec do
exec 'php composer.phar install --dev'
exec './vendor/bin/phpunit -c test/phpunit.xml --coverage-html coverage'
exec 'open coverage/index.html'
end
desc 'release new version'
task :release do
require 'json'
version = JSON.parse(File.read('composer.json'))['version']
tags = exec('git tag', :stdout_required).split
if tags.include?(version)
puts "v.#{version} is already released."
else
puts "releasing v#{version} .."
exec "git tag -a #{version}"
exec "git push origin #{version}"
end
end
task default: :spec