forked from alphagov/govuk-dependencies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
40 lines (32 loc) · 1.02 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
require_relative "dependapanda"
require "vcr"
require "net/http"
begin
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task default: :spec
rescue LoadError
p "Could not load RSpec"
end
desc "Send short form dependency audit"
task :dependapanda do
Dependapanda.new.send_simple_message
end
desc "Send complete dependency audit"
task :dependapanda_loud do
Dependapanda.new.send_full_message
end
desc "Recreate the vcr cassettes. For example `rake record_cassette[org:alphagov topic:govuk]`"
task :record_cassette, [:search_string] do |_, args|
octokit = Octokit::Client.new(auto_paginate: true)
puts "Deleting old cassette"
File.delete("spec/fixtures/vcr_cassettes/repositories.yml") if File.exist?("spec/fixtures/vcr_cassettes/repositories.yml")
VCR.configure do |config|
config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
config.hook_into :webmock
end
puts "Recording new cassette"
VCR.use_cassette("repositories") do
octokit.search_repos(args[:search_string])
end
end