1- #!/usr/bin/env rake
2- # encoding: utf-8
1+ # frozen_string_literal: true
32
43require 'rake/testtask'
54require 'rubocop/rake_task'
@@ -20,23 +19,30 @@ task default: [:lint, 'test:check']
2019namespace :test do
2120 # run inspec check to verify that the profile is properly configured
2221 task :check do
23- dir = File . join ( File . dirname ( __FILE__ ) )
24- sh ( "bundle exec inspec check #{ dir } " )
22+ require 'inspec'
23+ puts "Checking profile with InSpec Version: #{ Inspec ::VERSION } "
24+ profile = Inspec ::Profile . for_target ( '.' , backend : Inspec ::Backend . create ( Inspec ::Config . mock ) )
25+ pp profile . check
2526 end
2627end
2728
28- # Automatically generate a changelog for this project. Only loaded if
29- # the necessary gem is installed. By default its picking up the version from
30- # inspec.yml. You can override that behavior with s`rake changelog to=1.2.0`
31- begin
32- require 'yaml'
33- metadata = YAML . load_file ( 'inspec.yml' )
34- v = ENV [ 'to' ] || metadata [ 'version' ]
35- puts "Generate changelog for version #{ v } "
36- require 'github_changelog_generator/task'
37- GitHubChangelogGenerator ::RakeTask . new :changelog do |config |
38- config . future_release = v
29+ task :changelog do
30+ # Automatically generate a changelog for this project. Only loaded if
31+ # the necessary gem is installed. By default its picking up the version from
32+ # inspec.yml. You can override that behavior with `rake changelog to=1.2.0`
33+ begin
34+ require 'yaml'
35+ metadata = YAML . load_file ( 'inspec.yml' )
36+ v = ENV [ 'to' ] || metadata [ 'version' ]
37+ puts " * Generating changelog for version #{ v } "
38+ require 'github_changelog_generator/task'
39+ GitHubChangelogGenerator ::RakeTask . new :changelog do |config |
40+ config . future_release = v
41+ config . user = 'dev-sec'
42+ config . project = 'php-baseline'
43+ end
44+ Rake ::Task [ :changelog ] . execute
45+ rescue LoadError
46+ puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
3947 end
40- rescue LoadError
41- puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
4248end
0 commit comments