Sha256: 516f599063e3f5f959d7e69ca65904c93e64d3ed8bc499f294f15f9cdae3f373

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/lib/active_snapshot/version.rb')

require "bundler/gem_tasks"
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
  t.libs << "test"
  t.libs << "lib"
  t.test_files = FileList["test/**/*_test.rb"]
end

task :db_prepare do
  # if ENV['CI'] != "true"
  #   begin
  #     require 'pg'

  #     ### FOR LOCAL TESTING
  #     `dropdb active_snapshot_test && createdb active_snapshot_test` rescue true
  #   rescue LoadError
  #     # Do nothing
  #   end
  # end

  ### RUN GENERATOR
  # Dir.chdir("test/dummy_app") do
  #   ### Instantiates Rails
  #   require File.expand_path("test/dummy_app/config/environment.rb", __dir__)

  #   migration_path = "db/migrate"

  #   ### Generate Migration
  #   require "generators/active_snapshot/install/install_generator"

  #   generator = ActiveSnapshot::InstallGenerator.new

  #   Dir.glob(Rails.root.join(migration_path, "*#{generator.class::MIGRATION_NAME}.rb")).each do |f|
  #     FileUtils.rm(f)
  #   end

  #   generator.create_migration_file
  # end ### END chdir
end

#task default: [:db_prepare, :test]
task default: [:test]

task :console do
  require 'active_snapshot'

  require_relative 'test/dummy_app/app/models/post'

  require 'irb'
  binding.irb
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_snapshot-0.3.0 Rakefile
active_snapshot-0.2.4 Rakefile
active_snapshot-0.2.3 Rakefile
active_snapshot-0.2.2 Rakefile
active_snapshot-0.2.1 Rakefile
active_snapshot-0.2.0 Rakefile
active_snapshot-0.1.1 Rakefile