Sha256: eb71f86546c5de3df432f7dc8ff0e3fed907f7002729525380e9975163780812

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

#!/usr/bin/env rake
require "bundler/gem_tasks"

desc 'Update Projekktor from http://www.projekktor.com/'
task :update_projekktor do
  rm_rf Dir["/tmp/projekktor", "/tmp/projekktor.zip"]
  sh "curl http://www.projekktorxl.com/api/player/download/format/zip/id/projekktor -o /tmp/projekktor.zip"
  sh "unzip /tmp/projekktor.zip -d /tmp/projekktor"
  rm_rf "app/assets"
  mkdir_p "app/assets/projekktor"
  mv Dir["/tmp/projekktor/projekktor*.js"].first, "app/assets/projekktor/projekktor.js"
  mv "/tmp/projekktor/jarisplayer.swf", "app/assets/projekktor/"
  mv Dir["/tmp/projekktor/theme/maccaco/*.{png,gif}"], "app/assets/projekktor/"

  css_filepath = '/tmp/projekktor/theme/maccaco/projekktor.style.css'
  erb_filepath = 'app/assets/projekktor/projekktor.css.erb'
  puts "Compiling #{css_filepath} -> #{erb_filepath}"
  text = File.read(css_filepath).gsub(/url\("([^"]*)"\)/, 'url(<%= asset_path "\1" %>)')
  File.open(erb_filepath, "w") { |file| file.puts text }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
projekktor-rails-0.0.7 Rakefile
projekktor-rails-0.0.6 Rakefile