-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
128 lines (106 loc) · 3.33 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
require 'vendor/gems/environment'
require 'rake'
require 'ci/reporter/rake/rspec'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "shenandoah"
gem.summary = %Q{A javascript test framework for buildr, rails, and other ruby-built projects}
gem.email = "[email protected]"
gem.homepage = "http://github.com/rsutphin/shenandoah"
gem.authors = ["Rhett Sutphin"]
gem.rubyforge_project = "detailedbalance"
# Exclude test-only vendored buildr & bundled gems
gem.files.exclude("vendor/**/*")
gem.files.exclude("gem_bin/*")
# TODO: submit this to jeweler
(Class.new do
def initialize(gemspec)
@gem = gemspec
instance_eval File.read('Gemfile')
end
def method_missing(msg, *args)
# skip unimplemented bits
end
def gem(*args)
if @only && @only.include?(:development)
@gem.add_development_dependency(*args)
else
@gem.add_runtime_dependency(*args)
end
end
def only(*kinds)
@only = kinds
yield
@only = nil
end
end).new(gem)
end
Jeweler::GemcutterTasks.new
Jeweler::RubyforgeTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.verbose = true
spec.spec_files = FileList['spec/**/*_spec.rb']
end
Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
# rcov can't tell that /Library/Ruby is a system path
spec.rcov_opts = ['--exclude', "spec/*,/Library/Ruby/*"]
end
begin
require 'cucumber'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
end
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
task :default => :spec
def version
if File.exist?('VERSION.yml')
config = YAML.load(File.read('VERSION.yml'))
"#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
else
""
end
end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "shenandoah #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc "Uninstall the current (development) version of the gem"
task :uninstall do |t|
system("sudo gem uninstall shenandoah -v #{version}")
end
# Disable github release since I don't want to commit the gemspec
Rake::Task[:release].prerequisites.delete 'github:release'
# Disable rubyforge releasing, but keep rdoc deployment task
Rake::Task[:release].prerequisites.delete 'rubyforge:release'
task :build => [:gemspec]
task :install => [:uninstall]
namespace :ci do
ENV["CI_REPORTS"] ||= "reports/spec-xml"
task :all => [:features, :spec]
Spec::Rake::SpecTask.new(:spec => :"ci:setup:rspec") do |spec|
spec.libs << 'lib' << 'spec'
spec.verbose = true
spec.spec_files = FileList['spec/**/*_spec.rb']
end
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format progress --strict --format junit --out reports/cucumber-xml --format html --out reports/features.html"
end
end