require 'geminabox-release'
require 'bundler'

GeminaboxRelease.patch(host: 'http://rubygems.knf.local')

# Don't push the gem to rubygems
ENV['gem_push'] = 'false' # Utilizes feature in bundler 1.3.0
# Let bundler's release task do its job, minus the push to Rubygems,
# and after it completes, use "gem inabox" to publish the gem to our
# internal gem server.
Rake::Task['release'].enhance do
  sh "BUNDLE_APP_CONFIG=#{Dir.pwd}/config bundle install --path #{Dir.pwd}/vendor/bundle"
  spec = Gem::Specification.load(Dir.glob('*.gemspec').first)
  # sh "gem inabox pkg/#{spec.name}-#{spec.version}.gem"
end

begin
  require 'rspec/core/rake_task'
  RSpec::Core::RakeTask.new(:spec)
rescue LoadError
end
