-
Notifications
You must be signed in to change notification settings - Fork 40
/
Rakefile
56 lines (47 loc) · 1.43 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'bundler/gem_tasks'
require 'rake'
require 'rake/testtask'
begin
require 'rdoc/task'
rescue LoadError
require 'rake/rdoctask'
end
RDOC_OPTIONS = [
'--line-numbers',
'--inline-source',
"--main", "README.md",
"-c UTF-8",
]
Rake::RDocTask.new("doc") do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "ROMA documents"
rdoc.options.concat RDOC_OPTIONS
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.include("README.md")
rdoc.rdoc_files.include("ChangeLog.md")
end
Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/**/test_*.rb']
t.verbose = true
t.options = '--verbose'
end
namespace :changelog do
task :update do
last_released_tag = `git tag -l --sort=-creatordate | head -n1`.chomp
prs = `git log --oneline #{last_released_tag}...master | grep --color=never -G -e 'Merge pull request' | awk '{gsub("#",""); print $5}'`.chomp
require 'net/http'
require 'json'
http = Net::HTTP.new('api.github.com', 443)
http.use_ssl = true
prs.each_line do |pr|
req = Net::HTTP::Get.new("/repos/roma/roma/pulls/#{pr.chomp}")
res = http.request(req)
if Net::HTTPSuccess === res
json = JSON.parse(res.body)
puts "* #{json['title']}, [#{json['user']['login']}](#{json['user']['html_url']}), [##{json['number']}](#{json['html_url']})"
end
end
end
end
task default: :test