1 # -*- coding: utf-8 -*-
3 require 'spec/rake/spectask'
4 require 'rake/gempackagetask'
5 require 'rake/rdoctask'
7 # For code statistics (use rails task)
8 rails_path = Gem.path.map {|d| Dir[d + '/gems/rails-*'] }.flatten.reverse.
9 find {|d| File.exist?(File.join(d, 'lib', 'code_statistics.rb')) }
13 STATS_DIRECTORIES = [ %w[Apps lib], %w[Specs spec] ]
15 desc "Report code statistics (KLOCs, etc) from the application"
17 require File.join(rails_path, 'lib', 'code_statistics.rb')
18 require 'tasks/spec_statistics'
19 SpecStatistics.new(*STATS_DIRECTORIES).to_s
23 desc 'Run all specs (default)'
24 task :default => :spec
27 Spec::Rake::SpecTask.new do |t|
28 t.spec_files = FileList['spec/**/*_spec.rb']
32 desc 'Run generator specs'
33 Spec::Rake::SpecTask.new('spec:generator') do |t|
34 t.spec_files = FileList['spec/generator/**/*_spec.rb']
38 desc 'Run solver specs'
39 Spec::Rake::SpecTask.new('spec:solver') do |t|
40 t.spec_files = FileList['spec/solver/**/*_spec.rb']
50 spec = Gem::Specification.new do |s|
53 s.author = 'Good-Day, Inc.'
54 s.email = 'info@good-day.co.jp'
55 s.homepage = 'http://www.good-day.jp/'
56 s.platform = Gem::Platform::RUBY
57 s.summary = 'Generates mathematical problem and solves it'
58 s.files = PKG_FILES.to_a
59 s.require_path = 'lib'
61 s.extra_rdoc_files = ['README.rdoc']
64 desc 'Turn this library into a gem.'
65 Rake::GemPackageTask.new(spec) do |pkg|
69 desc 'Generate documentation for the mint-lib.'
70 Rake::RDocTask.new(:rdoc) do |rdoc|
71 rdoc.rdoc_dir = 'rdoc'
72 rdoc.title = 'mint-lib'
73 rdoc.options << '--line-numbers' << '--inline-source'
74 rdoc.rdoc_files.include('README.rdoc')
75 rdoc.rdoc_files.include('lib/**/*.rb')
76 rdoc.rdoc_files.exclude('lib/**/mint_expression_parser.rb')
80 desc 'Uninstall and Install mint-lib (for dev)'
84 system 'gem uninstall mint-lib'
85 system 'gem install pkg/mint-lib --no-rdoc --no-ri'