-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
49 lines (40 loc) · 1.38 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
# frozen_string_literal: true
require_relative 'lib/ruby_raider'
require_relative 'lib/commands/scaffolding_commands'
require_relative 'lib/utilities/logger'
desc 'Creates a page'
task :page, [:name, :path] do |_t, args|
ScaffoldingCommands.new.invoke(:page, nil, %W[:#{args.name} --path #{args.path}])
end
desc 'Sets a browser'
task :browser, [:type, :options] do |_t, args|
ScaffoldingCommands.new.invoke(:browser, nil, %W[:#{args.type} --opts #{args.options}])
end
desc 'Updates a path'
task :path, [:path] do |_t, args|
ScaffoldingCommands.new.invoke(:path, nil, %W[#{args.path} -s])
end
desc 'Logs a warning'
task :log, [:message] do |_t, args|
RubyRaider::Logger.warn(args.message)
end
desc 'Runs integration tests'
task :integration, [:type, :name] do |_t, args|
path = args.type ? "spec/integration/#{args.type}" : 'spec/integration'
full_path = if args.type == 'generators' && args.name
"#{path}/#{args.name.downcase}_generator_spec.rb"
elsif args.type == 'commands' && args.name
"#{path}/#{args.name.downcase}_commands_spec.rb"
else
path
end
system "rspec #{full_path}"
end
desc 'Runs system tests'
task :system do |_t|
system 'rspec spec/system'
end
desc 'Create framework with parameters'
task :new, [:name, :params] do |_t, args|
system "bin/raider -n #{args.name} -p #{args.params}"
end