diff --git a/Rakefile b/Rakefile index 2995527..ac51014 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,62 @@ require "bundler/gem_tasks" + +task(:default) { system "rake --tasks" } +task :test => 'test:unit' + +# ----- Test tasks ------------------------------------------------------------ + +require 'rake/testtask' +namespace :test do + + Rake::TestTask.new(:unit) do |test| + Rake::Task['test:ci_reporter'].invoke if ENV['CI'] + test.libs << 'lib' << 'test' + test.test_files = FileList["test/unit/**/*_test.rb"] + # test.verbose = true + # test.warning = true + end + + Rake::TestTask.new(:integration) do |test| + Rake::Task['test:ci_reporter'].invoke if ENV['CI'] + test.libs << 'lib' << 'test' + test.test_files = FileList["test/integration/**/*_test.rb"] + end + + desc "Run unit and integration tests" + task :all do + Rake::Task['test:ci_reporter'].invoke if ENV['CI'] + Rake::Task['test:unit'].invoke + Rake::Task['test:integration'].invoke + end + + namespace :cluster do + desc "Start Elasticsearch nodes for tests" + task :start do + $LOAD_PATH << File.expand_path('../../elasticsearch-transport/lib', __FILE__) << File.expand_path('../test', __FILE__) + require 'elasticsearch/extensions/test/cluster' + Elasticsearch::Extensions::Test::Cluster.start + end + + desc "Stop Elasticsearch nodes for tests" + task :stop do + $LOAD_PATH << File.expand_path('../../elasticsearch-transport/lib', __FILE__) << File.expand_path('../test', __FILE__) + require 'elasticsearch/extensions/test/cluster' + Elasticsearch::Extensions::Test::Cluster.stop + end + end +end + +# ----- Documentation tasks --------------------------------------------------- + +require 'yard' +YARD::Rake::YardocTask.new(:doc) do |t| + t.options = %w| --embed-mixins --markup=markdown | +end + +# ----- Code analysis tasks --------------------------------------------------- + +require 'cane/rake_task' +Cane::RakeTask.new(:quality) do |cane| + cane.abc_max = 15 + cane.no_style = true +end diff --git a/elasticsearch-dsl.gemspec b/elasticsearch-dsl.gemspec index ba5a7ec..ae5c20c 100644 --- a/elasticsearch-dsl.gemspec +++ b/elasticsearch-dsl.gemspec @@ -3,21 +3,38 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'elasticsearch/dsl/version' -Gem::Specification.new do |spec| - spec.name = "elasticsearch-dsl" - spec.version = Elasticsearch::DSL::VERSION - spec.authors = ["Karel Minarik"] - spec.email = ["karel.minarik@elasticsearch.org"] - spec.description = %q{Elasticsearch Ruby DSL sugar (WIP)} - spec.summary = spec.description - spec.homepage = "" - spec.license = "Apache 2" +Gem::Specification.new do |s| + s.name = "elasticsearch-dsl" + s.version = Elasticsearch::DSL::VERSION + s.authors = ["Karel Minarik"] + s.email = ["karel.minarik@elasticsearch.com"] + s.description = %q{A Ruby DSL builder for Elasticsearch} + s.summary = s.description + s.homepage = "https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-dsl" + s.license = "Apache 2" - spec.files = `git ls-files`.split($/) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + s.files = `git ls-files`.split($/) + s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } + s.test_files = s.files.grep(%r{^(test|spec|features)/}) + s.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" + s.extra_rdoc_files = [ "README.md", "LICENSE.txt" ] + s.rdoc_options = [ "--charset=UTF-8" ] + + s.add_development_dependency "bundler", "~> 1.3" + s.add_development_dependency "rake" + + s.add_development_dependency "elasticsearch" + s.add_development_dependency "elasticsearch-extensions" + + s.add_development_dependency 'shoulda-context' + s.add_development_dependency 'mocha' + s.add_development_dependency 'minitest', '~> 4.0' + s.add_development_dependency 'minitest-reporters' + s.add_development_dependency 'simplecov' + s.add_development_dependency 'simplecov-rcov' + s.add_development_dependency 'ci_reporter', '~> 1.9' + s.add_development_dependency 'yard' + s.add_development_dependency 'cane' + s.add_development_dependency 'pry' end