-
Notifications
You must be signed in to change notification settings - Fork 472
/
Rakefile
56 lines (45 loc) · 1.47 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 'rubygems'
begin
require "bundler/gem_tasks"
rescue LoadError
end
require 'rdoc/task'
require 'rake/testtask'
task :prerelease => [:clobber_rdoc, :test]
desc "Update SSL Certificate"
task('ssl_cert') do |p|
sh "openssl genrsa -des3 -out server.key 1024"
sh "openssl req -new -key server.key -out server.csr"
sh "cp server.key server.key.org"
sh "openssl rsa -in server.key.org -out server.key"
sh "openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt"
sh "cp server.key server.pem"
sh "mv server.key server.csr server.crt server.pem test/data/"
sh "rm server.key.org"
end
RDoc::Task.new do |rdoc|
rdoc.main = "README.md"
rdoc.rdoc_dir = 'doc'
rdoc.rdoc_files.include( "CHANGELOG.md", "EXAMPLES.rdoc", "GUIDE.rdoc", "LICENSE.txt", "README.md", "lib/**/*.rb")
end
desc "Run tests"
Rake::TestTask.new { |t|
t.test_files = Dir['test/**/test*.rb']
t.verbose = true
}
task publish_docs: %w[rdoc] do
sh 'rsync', '-avzO', '--delete', 'doc/', 'docs-push.seattlerb.org:/data/www/docs.seattlerb.org/mechanize/'
end
desc "Run rubocop checks"
task :rubocop => ["rubocop:security", "rubocop:frozen_string_literals"]
namespace "rubocop" do
desc "Run rubocop security check"
task :security do
sh "rubocop lib --only Security"
end
desc "Run rubocop string literals check"
task :frozen_string_literals do
sh "rubocop lib test --auto-correct-all --only Style/FrozenStringLiteralComment"
end
end
task default: [:rubocop, :test]