File: Rakefile

package info (click to toggle)
ruby-prawn 2.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,380 kB
  • sloc: ruby: 15,820; sh: 43; makefile: 20
file content (54 lines) | stat: -rw-r--r-- 1,268 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# frozen_string_literal: true

require 'rake'
require 'rspec/core/rake_task'
require 'yard'
require 'rubygems/package_task'
require 'rubocop/rake_task'

task default: %i[spec rubocop]

desc 'Run all rspec files'
RSpec::Core::RakeTask.new('spec') do |c|
  c.rspec_opts = '-t ~unresolved'
end

YARD::Rake::YardocTask.new do |t|
  t.options = ['--output-dir', 'doc/html']
end
task docs: :yard

desc "Generate the 'Prawn by Example' manual"
task :manual do
  puts 'Building manual...'
  require File.expand_path(File.join(__dir__, %w[manual contents]))
  prawn_manual_document.render_file('manual.pdf')
  puts 'The Prawn manual is available at manual.pdf. Happy Prawning!'
end

spec = Gem::Specification.load 'prawn.gemspec'
Gem::PackageTask.new(spec) do |pkg|
  pkg.need_zip = true
  pkg.need_tar = true
end

desc 'Run a console with Prawn loaded'
task :console do
  require 'irb'
  require 'irb/completion'
  require_relative 'lib/prawn'
  Prawn.debug = true

  ARGV.clear
  IRB.start
end

RuboCop::RakeTask.new

task :checksum do
  require 'digest/sha2'
  built_gem_path = "prawn-#{Prawn::VERSION}.gem"
  checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
  checksum_path = "checksums/#{built_gem_path}.sha512"
  File.write(checksum_path, checksum)
end