-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathRakefile
66 lines (56 loc) · 1.71 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
require 'rubygems'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rubygems/specification'
require 'rspec/core/rake_task'
require 'lib/active_enum/version'
GEM_NAME = "active_enum"
GEM_VERSION = ActiveEnum::VERSION
spec = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.rubyforge_project = "active_enum"
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc"]
s.summary = "Define enum classes in Rails and use them to enumerate ActiveRecord attributes"
s.description = s.summary
s.author = "Adam Meehan"
s.email = "adam.meehan@gmail.com"
s.homepage = "http://github.com/adzap/active_enum"
s.require_path = 'lib'
s.autorequire = GEM_NAME
s.files = %w(active_enum.gemspec MIT-LICENSE CHANGELOG README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*")
end
desc 'Default: run specs.'
task :default => :spec
desc "Run specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
end
desc "Generate code coverage"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
desc 'Generate documentation for plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ActiveEnum'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "install the gem locally"
task :install => [:package] do
sh %{gem install pkg/#{GEM_NAME}-#{GEM_VERSION}}
end
desc "create a gemspec file"
task :make_spec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end