Sha256: 0310c96f697ac8d8d6f827e8f706447a2306a488474408f97f6ad1371a98fb7b

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

ENV['SINATRA_ENV'] ||= 'development'

require 'rubygems'
require 'standalone_migrations'
require 'rubygems/package_task'
require 'rubygems/specification'
require 'rake/testtask'
require 'pry'
require 'fileutils'
require 'bundler/setup'
require 'dry-container'
require 'sinatra/activerecord'
require 'sinatra/activerecord/rake'
require 'rubydns'
require_relative 'lib/mkit/version.rb'
require_relative 'lib/mkit/utils'
require_relative 'lib/mkit'

$LOAD_PATH.unshift File.expand_path('lib')
rails_env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
# db migrations, use database config
ENV['DATABASE_URL'] = MKIt::Utils.db_config_to_uri(rails_env)

desc 'Builds the gem'
task :package do
  sh %(gem build "mkit.gemspec")
end

task install: [:package] do
  sh %(gem install mkit-#{MKIt::VERSION}.gem)
end

desc 'Copy rb to packaging dir'
task build: [:init] do
  FileUtils.cp_r('app', 'target/build', { remove_destination: true })
  FileUtils.cp_r('config', 'target/build', { remove_destination: true })
  FileUtils.cp_r('bin', 'target/build', { remove_destination: true })
  FileUtils.cp_r('lib', 'target/build', { remove_destination: true })
  FileUtils.cp_r('config.ru', 'target/build', { remove_destination: true })
end

desc 'Create build dirs'
task :init do
  FileUtils.mkdir_p('target/build')
  FileUtils.mkdir_p('target/package')
end

desc 'Rake Console'
task :console do
  Pry.start
end

StandaloneMigrations::Tasks.load_tasks

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mkit-0.4.2 Rakefile