-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
38 lines (32 loc) · 894 Bytes
/
Rakefile
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
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'yard'
require 'dotenv/load'
# Test tasks
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
t.warning = false
end
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb'] # optional
t.options = %w{--private} # optional
t.stats_options = ['--list-undoc'] # optional
end
# Default task
task :default => :test
Rake::Task['build'].enhance do
require 'digest/sha2'
built_gem_path = 'pkg/newznab-api-'+Newznab::Api::VERSION+'.gem'
checksum = Digest::SHA256.new.hexdigest(File.read(built_gem_path))
checksum_path = 'checksum/newznab-api-'+Newznab::Api::VERSION+'.gem.sha256'
File.open(checksum_path, 'w') { |f| f.write(checksum) }
end
task :console do
require 'irb'
require 'irb/completion'
require 'newznab/api'
ARGV.clear
IRB.start
end