Rakefile in telepost-0.3.2 vs Rakefile in telepost-0.4.0

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -# Copyright (c) 2018-2019 Yegor Bugayenko +# Copyright (c) 2018-2024 Yegor Bugayenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -32,28 +32,27 @@ def version Gem::Specification.load(Dir['*.gemspec'].first).version end -task default: %i[clean test rubocop] +task default: %i[clean test yard rubocop] require 'rake/testtask' desc 'Run all unit tests' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' test.pattern = 'test/**/test_*.rb' test.verbose = false end -require 'rdoc/task' -RDoc::Task.new do |rdoc| - rdoc.main = 'README.md' - rdoc.rdoc_dir = 'rdoc' - rdoc.rdoc_files.include('README.md', 'lib/**/*.rb') -end - require 'rubocop/rake_task' desc 'Run RuboCop on all directories' RuboCop::RakeTask.new(:rubocop) do |task| task.fail_on_error = true task.requires << 'rubocop-rspec' +end + +require 'yard' +desc 'Build Yard documentation' +YARD::Rake::YardocTask.new do |t| + t.files = ['lib/**/*.rb'] end