Sha256: 2da6ba188d252070af3e2fc29988caab84b4a96ac977df5ef705d0506a434ff0

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

# encoding: utf-8
Dir.chdir(File.dirname(__FILE__))

require 'shellwords'
require 'rspec/core/rake_task'
require_relative 'lib/helpers/redis'
require_relative 'lib/helpers/ec2'
require_relative 'lib/helpers/init'
require_relative 'lib/helpers/rehash'

DH = Gaptool::Data
EC2 = Gaptool::EC2
$stdout.sync = true

def sys(cmd)
  IO.popen(cmd) do |f|
    until f.eof?
      puts f.gets
    end
  end
  $?.to_i
end

Dir.glob('tasks/*.rb').each { |r| load r}

unless File.exists?('/.dockerenv')
  desc "Start the shell"
  task :shell do
    exec "racksh #{Shellwords.join(ARGV[1..-1])}"
  end
  task :sh => :shell

  desc "Start the HTTP server"
  task :server do
    exec "puma -p 3000 --preload -t 8:32 -w 3 #{Shellwords.join(ARGV[1..-1])}"
  end

  desc "Bump the version"
  task :bump do
    version = File.read('VERSION').strip
    nver = version.next
    f = File.open('VERSION', 'w')
    f.write(nver)
    f.close
    puts "Bumped #{version} => #{nver}"
    exec "git commit -m 'Bump version to v#{nver}' VERSION"
    Rake::Task["tag"].invoke
    Rake::Task["gem:build"].invoke
  end

  desc "Tag git with VERSION"
  task :tag do
    exec "git tag v$(cat VERSION)"
  end

  desc "Push the git tag and the gem version"
  task :push => :tag do
    exec "git push origin v$(cat VERSION)"
    Rake::Task["gem:push"].invoke
  end
end

task :help do
  puts "Available tasks"
  exec "rake -T"
end

RSpec::Core::RakeTask.new :test do |task|
  task.pattern = Dir['test/*_test.rb']
end

task :default => :help

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gaptool-server-0.7.4 Rakefile
gaptool-server-0.7.3 Rakefile
gaptool-server-0.7.1 Rakefile
gaptool-server-0.7.0 Rakefile