forked from thoughtbot/trail-map
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
41 lines (32 loc) · 1.02 KB
/
Rakefile
File metadata and controls
41 lines (32 loc) · 1.02 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
require 'rake'
require 'bundler/setup'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :environment do
script_directory = File.dirname(__FILE__)
helper_files = script_directory + '/lib/helpers/*.rb'
Dir[helper_files].each { |file| require File.expand_path(file) }
end
desc 'Run RSpec code examples, UUID generation, and validations'
task test: [:spec, :generate, :validate]
desc 'Run validations'
task validate: %w(validate:json validate:uris)
desc 'Generate UUIDs'
task generate: %w(generate:uuid)
namespace :validate do
desc 'Run JSON validations'
task json: :environment do
TrailRunner.new.run('JSON validation') { |file| JSONValidator.new(file).run }
end
desc 'Run URI validations'
task uris: :environment do
TrailRunner.new.run('URI validation') { |file| URIValidator.new(file).run }
end
end
namespace :generate do
desc 'Generate UUIDs'
task uuid: :environment do
TrailRunner.new.run('UUID generation') { |file| UUIDGenerator.new(file).run }
end
end
task default: :test