-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
56 lines (48 loc) · 1.41 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
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'lib/version'
GEM_NAME = 'fruby'
spec = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = FRuby::VERSION
s.has_rdoc = true
s.extra_rdoc_files = ['README.rdoc', 'LICENSE']
s.summary = 'Some functional programming features for ruby'
s.description = s.summary
s.author = 'Mikhail Shakhanov'
s.email = 'mshakhan@gmail.com'
s.files = %w(LICENSE README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*")
s.require_path = "lib"
s.add_dependency 'rake'
s.add_dependency 'rspec'
s.required_ruby_version = ">= 1.8.4"
end
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end
Rake::RDocTask.new do |rdoc|
files =['README.rdoc', 'LICENSE', 'lib/**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README.rdoc"
rdoc.title = "FRuby Docs"
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.options << '--line-numbers'
end
desc 'Run specs'
task :spec do
spec_path = ENV['SPEC_PATH'] || 'spec'
system("spec #{spec_path} -c")
end
desc "Generate *.gemspec file"
task :gemspec do
gemspec = %{require 'rubygems' unless defined?(Gem)
spec = #{spec.to_ruby.to_s.sub(/^#.*$/, '')}} # remove encoding comment
path = File.join(File.dirname(__FILE__), "#{GEM_NAME}.gemspec")
puts %{Writing "#{path}"}
File.open(path, "w") { |file| file.write(gemspec) }
end