-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
51 lines (45 loc) · 1.32 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
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
# Add default task. When you type just rake command this would run. Travis CI runs this. Making this run spec
desc 'Default: run specs.'
task :default => :spec
# Defining spec task for running spec
desc "Run specs"
RSpec::Core::RakeTask.new('spec') do |spec|
# Pattern filr for spec files to run. This is default btw.
spec.pattern = "./spec/**/*_spec.rb"
end
# Run the rdoc task to generate rdocs for this gem
require 'rdoc/task'
RDoc::Task.new do |rdoc|
require "logstuff/version"
version = Logstuff::VERSION
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "logstuff #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
# Code coverage tasks. Different for Ruby 1.8 vs 1.9
if RUBY_VERSION =~ /^1\.8/
# Ruby 1.8 uses rcov for code coverage
RSpec::Core::RakeTask.new(:coverage) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
spec.rcov_opts = %w{--exclude pkg\/,spec\/,features\/}
end
else
# Ruby 1.9+ using simplecov. Note: Simplecov config defined in spec_helper
desc "Code coverage detail"
task :coverage do
ENV['COVERAGE'] = "true"
Rake::Task['spec'].execute
end
end
task :console do
require 'irb'
require 'irb/completion'
require 'logger'
require 'logstuff'
ARGV.clear
IRB.start
end