-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
58 lines (47 loc) · 1.61 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
require 'rubygems'
require 'rubygems/package_task'
require 'rdoc/task'
require './lib/morph'
require 'rspec'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = %w(--format documentation --colour)
end
task :default => ['spec']
spec = Gem::Specification.new do |s|
s.name = 'morph'
s.version = Morph::VERSION
s.summary = 'Morph allows you to emerge Ruby class definitions from data or by calling assignment methods.'
s.author = 'Rob McKinnon'
s.email = 'rob ~@nospam@~ movingflow'
s.homepage = 'https://github.com/robmckinnon/morph'
s.has_rdoc = true
s.extra_rdoc_files = %w(README.md)
s.rdoc_options = %w(--main README.md)
s.license = 'MIT'
s.files = %w(CHANGELOG LICENSE) + Dir.glob('{lib}/**/*')
s.require_paths = ['lib']
s.add_runtime_dependency('activesupport', '>= 4.1.11')
s.add_development_dependency('rspec')
end
# This task actually builds the gem.
Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Build the gemspec file #{spec.name}.gemspec"
task :gemspec do
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
File.open(file, 'w') {|f| f << spec.to_ruby }
end
# If you don't want to generate the .gemspec file, just remove this line.
task :package => :gemspec
# Generate documentation
RDoc::Task.new do |rd|
rd.main = 'README.md'
rd.rdoc_files.include('README.md', 'lib/**/*.rb')
rd.rdoc_dir = 'rdoc'
end
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end