-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
57 lines (50 loc) · 1.87 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
require 'rubygems'
gem 'rspec', '>= 1.1.4'
require 'rake'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'spec/rake/verify_rcov'
desc 'Default: run unit tests.'
task :default => :spec
task :pre_commit => [:spec, 'coverage:verify']
desc 'Run all specs under spec/**/*_spec.rb'
Spec::Rake::SpecTask.new(:spec => 'coverage:clean') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ["-c", "--diff"]
t.rcov = true
t.rcov_opts = ["--include-file", "lib\/*\.rb", "--exclude", "spec\/"]
end
desc 'Generate documentation for the yaml_waml plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'YamlWaml'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
namespace :coverage do
desc "Delete aggregate coverage data."
task(:clean) { rm_f "coverage" }
desc "verify coverage threshold via RCov"
RCov::VerifyTask.new(:verify => :spec) do |t|
t.threshold = 100.0 # Make sure you have rcov 0.7 or higher!
t.index_html = 'coverage/index.html'
end
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "yaml_waml"
gem.summary = "'to_yaml' workaround for multibyte UTF-8 string."
gem.description = "Plugin gem to workaround for fixing output result of 'to_yaml' method treats multibyte UTF-8 string(such as japanese) as binary. "
gem.has_rdoc = false
gem.email = "[email protected]"
gem.homepage = "http://github.com/kakutani/yaml_waml"
gem.authors = ["KAKUTANI Shintaro", "Akira Ikeda"]
gem.add_development_dependency "rspec", ">= 1.2.9"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end