forked from arbox/tokenizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
65 lines (53 loc) · 1.54 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
lib_path = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
# Rake provides FileUtils and file lists.
require 'rake'
require 'rdoc'
# clean and clobber tasks.
require 'rake/clean'
CLOBBER.include('rdoc',
'ydoc',
'.yardoc',
'**/*.gem')
# Running tests.
require 'rake/testtask'
Rake::TestTask.new do |t|
t.test_files = FileList.new('test/**/*.rb').to_a
end
# Generate documentation
require 'rdoc/task'
RDoc::Task.new do |rdoc|
rdoc.rdoc_files.include('README.rdoc',
'LICENSE.rdoc',
'CHANGELOG.rdoc',
'lib/**/*',
'bin/*'
)
rdoc.rdoc_dir = 'rdoc'
end
require 'yard'
YARD::Rake::YardocTask.new do |ydoc|
ydoc.options +=['-o', 'ydoc']
end
desc 'Document the code using Yard and RDoc.'
task :doc => [:clobber, :rdoc, :yard]
# Custom gem building and releasing tasks.
require 'tokenizer/version'
desc 'Commit pending changes.'
task :commit do
end
desc 'Create a tag in the repository for the current release.'
task :tag do
end
desc "Build the gem package tokenizer-#{Tokenizer::VERSION}.gem"
task :build => :clobber do
system 'bundle exec gem build tokenizer.gemspec'
end
desc 'Deploy the gem package to RubyGems.'
task :release => [:commit, :tag, :build] do
system "gem push tokenizer-#{Tokenizer::VERSION}.gem"
end
desc 'Open an irb session preloaded with this library.'
task :console do
sh "irb -I lib -r tokenizer.rb"
end