-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
executable file
·85 lines (68 loc) · 2.07 KB
/
Rakefile
File metadata and controls
executable file
·85 lines (68 loc) · 2.07 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
73
74
75
76
77
78
79
80
81
82
83
84
85
# vim: set ft=ruby :
require 'corundum/tasklibs'
require 'caliph'
module Corundum
Corundum::register_project(__FILE__)
core = Core.new
core.in_namespace do
GemspecFiles.new(core) do |files|
files.extra_files = Rake::FileList["default_configuration/base_app/**/*"]
end
#Also available: 'unfinished': TODO and XXX
["debug", "profanity", "ableism", "racism", "gender"].each do |type|
QuestionableContent.new(core) do |content|
content.type = type
end
end
rspec = RSpec.new(core)
SimpleCov.new(core, rspec) do |cov|
cov.threshold = 70
end
gem = GemBuilding.new(core)
GemCutter.new(core,gem)
Git.new(core) do |vc|
vc.branch = "master"
end
task :list_files do
core.gemspec.files.each do |file|
puts file
end
end
end
end
task :default => [:release, :publish_docs]
BASE_PROJECT_URL = "git@github.com:XingFramework/xing-application-base.git"
namespace :app_base do
name = "default_configuration/base_app"
shell = Caliph.new()
task :clobber do
shell.run("rm", "-rf", name)
end
task :fetch => [:clone, :ungit]
task :cleanup => :fetch do
require 'find'
migrations_dir = File.join(name, "backend/db/migrate")
shell.run('rm', '-rf', File.join(migrations_dir, "*"))
shell.run('rm', File.join(name, "CODE_OF_CONDUCT.md"))
shell.run('touch', File.join(migrations_dir, '.gitkeep'))
Find.find(name) do |path|
if path =~ /\.git(ignore|attributes)\z/
dest = path.sub(/\A#{name}/, "default_configuration/templates").gsub(".","")
shell.run("mv", "-f", path, dest)
end
end
end
desc "Update the live base files from the application base repo"
task :refetch => [:clobber, :fetch, :cleanup]
task :clone do
if File.exist?(name)
fail "Can't fetch: #{name} exists. Try app_base:refetch"
end
shell.run('git', 'clone', '--depth=1', '--branch=master', BASE_PROJECT_URL, name).must_succeed!
end
task :ungit do
git_dir = File.join("#{name}", ".git")
puts git_dir
shell.run('rm', '-rf', git_dir)
end
end