Sha256: 35a336bd84b241a75572764c46df48bba7675030bf2aa8d2f7f78d93548c4324

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 KB

Contents

# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rubocop/rake_task'
require 'ronn'
require 'github_changelog_generator/task'
require 'yard'

GitHubChangelogGenerator::RakeTask.new :changelog do |config|
  config.user = 'servian'
  config.project = 'awskeyring'
  config.future_release = "v#{Awskeyring::VERSION}"
  config.since_tag = 'v0.10.0'
end

RuboCop::RakeTask.new do |rubocop|
  rubocop.options = %w[-D --enable-pending-cops]
  rubocop.requires << 'rubocop-performance'
  rubocop.requires << 'rubocop-rake'
  rubocop.requires << 'rubocop-rspec'
  rubocop.requires << 'rubocop-rubycw'
end

desc 'Run RSpec code examples'
task :spec do
  puts 'Running RSpec...'
  require 'rspec/core'
  runner = RSpec::Core::Runner
  xcode = runner.run(%w[--pattern spec/**{,/*/**}/*_spec.rb --order rand --format documentation --color])
  abort 'RSpec failed' if xcode.positive?
end

desc 'Check filemode bits'
task :filemode do
  puts 'Running FileMode...'
  files = Set.new(`git ls-files -z`.split("\x0"))
  dirs = Set.new(files.map { |file| File.dirname(file) })
  failure = []
  files.merge(dirs).each do |file|
    mode = File.stat(file).mode
    print '.'
    failure << file if (mode & 0x7) != ((mode >> 3) & 0x7)
  end
  abort "\nError: Incorrect file mode found\n#{failure.join("\n")}" unless failure.empty?
  print "\n"
end

desc 'generate manpage'
task :ronn do
  puts 'Running Ronn...'
  doc = Ronn::Document.new('man/awskeyring.5.ronn')
  doc.date = Time.parse(`git show -s --format=%ad --date=short`)
  File.write('man/awskeyring.5', doc.to_roff)
  puts "done\n\n"
end

YARD::Rake::YardocTask.new do |t|
  t.options = ['--fail-on-warning', '--no-progress', '--files', '*.md']
  t.stats_options = ['--list-undoc']
end

desc 'Run Linting, Tests and Documetation tasks'
task default: %i[filemode rubocop spec ronn yard]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
awskeyring-1.9.3 Rakefile