require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "ci/reporter/rake/rspec"

task :default => :spec

desc "Run specs"
RSpec::Core::RakeTask.new do |t|
  t.pattern = "./spec/**/*_spec.rb"
end

#---------------------------------------------------------------------------------------------------
# Monkey patch Bundler gem_helper so we release to our gem server instead of rubygems.org
module Bundler
  class GemHelper
    def rubygem_push(path)
      sh("gem push --verbose --host https://artifactory.elstc.co/artifactory/api/gems/swiftype-gems --key elastic '#{path}'")
      Bundler.ui.confirm "Pushed #{name} #{version} to artifactory"
    end
  end
end
