-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
72 lines (59 loc) · 1.31 KB
/
Rakefile
File metadata and controls
72 lines (59 loc) · 1.31 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env ruby
# task :default => :test
module Gem
# This is necessary for TTY functions in linting.
module_function
def gunzip(*args)
Gem::Util.gunzip(*args)
end
end
require 'bundler/setup'
require 'rspec/core/rake_task'
require './lib/core'
require 'rake/notes/rake_task'
desc "Run tests"
task :spec do
RSpec::Core::RakeTask.new(:spec)
end
desc "Render rules"
task :rules do
require 'github/markup'
rules_text = GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, File.read('doc/rules.md'))
layout = File.read('export/rules_layout.html')
puts layout.gsub('CONTENTS', rules_text)
end
namespace :export do
task :setup do
require_relative './lib/export'
end
desc "All"
task :all => :setup do
%w[
# add asset names here, e.g. cards
].each do |asset|
`rake export:#{asset} > ./export/#{asset}.csv`
end
end
# desc "Asset name"
# task :asset_name => :setup do
# puts Export::Cards.new('asset_name').to_csv
#end
end
namespace :lint do
task :setup do
require_relative './lib/lint'
end
desc "All"
task :all => :setup do
Rake::Task['lint:cards:all'].invoke
end
namespace :cards do
task :load => :setup do
@cards = Lint::Cards.new
end
desc "Cards [all]"
task :all => :load do
@cards.render
end
end
end