-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
46 lines (37 loc) · 1013 Bytes
/
Rakefile
File metadata and controls
46 lines (37 loc) · 1013 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
RSpec::Core::RakeTask.new do |task|
task.verbose = false
end
RuboCop::RakeTask.new
desc 'Generate README.md from README.md.erb'
task :readme do
puts 'Generating README.md...'
File.write('README.md', generate_readme)
puts 'Done.'
end
namespace :readme do
task :validate do
puts 'Validating README.md...'
unless File.read('README.md') == generate_readme
raise <<-END.gsub(/^\s+\|/, '').chomp
|README.md and README.md.erb are out of sync!
|If you need to modify the content of README.md:
| * Edit README.md.erb.
| * Run `bundle exec rake readme`.
| * Commit both files.
END
end
puts 'Done.'
end
end
def generate_readme
require 'erb'
require 'increments/schedule'
readme = File.read('README.md.erb')
erb = ERB.new(readme, nil, '-')
erb.result(binding)
end
task ci: %w[spec rubocop readme:validate]