-
Notifications
You must be signed in to change notification settings - Fork 89
/
Rakefile
82 lines (69 loc) · 2.95 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
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
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("lib", __dir__)
desc "Default task running Tests"
task default: :test
desc "Run test suite"
task test: ["test:standard", "test:rspec"]
task "test:ci" => ["bootstrap:gem_requirements", :test]
namespace :test do
task :rspec do
sh "rspec"
end
task "inch" do
sh "inch"
end
require "standard/rake"
end
namespace :gem do
require "bundler/gem_tasks"
end
unless ENV.key?("CI")
require "geo_pattern/geo_pattern_task"
namespace :fixtures do
string = "Mastering Markdown"
GeoPattern::GeoPatternTask.new(
name: "generate",
description: "Generate patterns to make them available as fixtures",
data: {
"fixtures/generated_patterns/chevrons.svg" => {input: string, patterns: [:chevrons]},
"fixtures/generated_patterns/concentric_circles.svg" => {input: string, patterns: [:concentric_circles]},
"fixtures/generated_patterns/diamonds.svg" => {input: string, patterns: [:diamonds]},
"fixtures/generated_patterns/hexagons.svg" => {input: string, patterns: [:hexagons]},
"fixtures/generated_patterns/mosaic_squares.svg" => {input: string, patterns: [:mosaic_squares]},
"fixtures/generated_patterns/nested_squares.svg" => {input: string, patterns: [:nested_squares]},
"fixtures/generated_patterns/octagons.svg" => {input: string, patterns: [:octagons]},
"fixtures/generated_patterns/overlapping_circles.svg" => {input: string, patterns: [:overlapping_circles]},
"fixtures/generated_patterns/overlapping_rings.svg" => {input: string, patterns: [:overlapping_rings]},
"fixtures/generated_patterns/plaid.svg" => {input: string, patterns: [:plaid]},
"fixtures/generated_patterns/plus_signs.svg" => {input: string, patterns: [:plus_signs]},
"fixtures/generated_patterns/sine_waves.svg" => {input: string, patterns: [:sine_waves]},
"fixtures/generated_patterns/squares.svg" => {input: string, patterns: [:squares]},
"fixtures/generated_patterns/tessellation.svg" => {input: string, patterns: [:tessellation]},
"fixtures/generated_patterns/triangles.svg" => {input: string, patterns: [:triangles]},
"fixtures/generated_patterns/xes.svg" => {input: string, patterns: [:xes]},
"fixtures/generated_patterns/diamonds_with_color.svg" => {input: string, patterns: [:diamonds], color: "#00ff00"},
"fixtures/generated_patterns/diamonds_with_base_color.svg" => {input: string, patterns: [:diamonds], base_color: "#00ff00"}
}
)
end
end
desc "Bootstrap project"
task bootstrap: %w[bootstrap:bundler]
desc "Bootstrap project for ci"
task "bootstrap:ci" do
Rake::Task["bootstrap"].invoke
end
namespace :bootstrap do
desc "Bootstrap bundler"
task :bundler do |t|
puts t.comment
sh "gem install bundler"
sh "bundle install"
end
desc "Require gems"
task :gem_requirements do |t|
puts t.comment
require "bundler"
Bundler.require
end
end