Rakefile in beaker-hostgenerator-1.2.10 vs Rakefile in beaker-hostgenerator-1.3.0

- old
+ new

@@ -53,5 +53,29 @@ task 'test:spec' => ['test:spec:run', 'test:spec:minitest'] # global defaults task :test => 'test:spec' task :default => :test + +begin + require 'github_changelog_generator/task' + GitHubChangelogGenerator::RakeTask.new :changelog do |config| + config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file." + config.exclude_labels = %w[duplicate question invalid wontfix wont-fix modulesync skip-changelog] + config.user = 'voxpupuli' + config.project = 'beaker-hostgenerator' + config.future_release = Gem::Specification.load("#{config.project}.gemspec").version + end + + # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 + require 'rbconfig' + if RbConfig::CONFIG['host_os'] =~ /linux/ + task :changelog do + puts 'Fixing line endings...' + changelog_file = File.join(__dir__, 'CHANGELOG.md') + changelog_txt = File.read(changelog_file) + new_contents = changelog_txt.gsub(/\r\n/, "\n") + File.open(changelog_file, 'w') { |file| file.puts new_contents } + end + end +rescue LoadError +end