Sha256: c2a286d65a422235fef5a5e35682d72aeaaa1ff31477f8f9e356914eefdc923a

Contents?: true

Size: 816 Bytes

Versions: 6

Compression:

Stored size: 816 Bytes

Contents

namespace :test do
  task :build_rails do
    require 'fileutils'

    def cmd(str, clean_env = true)
      puts "* #{str}"
      retval = clean_env ? Bundler.with_clean_env { `#{str}` } : `#{str}`
      puts retval.strip
      retval
    end

    rpush_root = Dir.pwd
    path = '/tmp/rails_test'
    cmd("rm -rf #{path}")
    FileUtils.mkdir_p(path)
    pwd = Dir.pwd

    cmd("bundle exec rails --version", false)
    cmd("bundle exec rails new #{path} --skip-bundle", false)

    begin
      Dir.chdir(path)
      cmd('echo "gem \'rake\'" >> Gemfile')
      cmd("echo \"gem 'rpush', :path => '#{rpush_root}'\" >> Gemfile")
      cmd('bundle install')
      cmd('bundle exec rails g rpush')
      cmd('bundle exec rake db:migrate')
    ensure
      Dir.chdir(pwd)
    end

    puts "Built into #{path}"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rpush-2.0.1-java lib/tasks/test.rake
rpush-2.0.1 lib/tasks/test.rake
rpush-2.0.0-java lib/tasks/test.rake
rpush-2.0.0 lib/tasks/test.rake
rpush-2.0.0.rc1-java lib/tasks/test.rake
rpush-2.0.0.rc1 lib/tasks/test.rake