Skip to content

Instantly share code, notes, and snippets.

@johnmcdowall
Created April 22, 2013 02:03
Show Gist options
  • Save johnmcdowall/5431985 to your computer and use it in GitHub Desktop.
Save johnmcdowall/5431985 to your computer and use it in GitHub Desktop.
# A simple rake task to update Ember and Ember Data to latest official build from S3.
#
# Assumptions:
# - You're using the `ember-rails` gem
# - You are requiring rember with sprockets with something like `require ember`
#
# Usage:
#
# $ rake ember:update
#
# This will place a development build (with comments and debug tags) into:
# vendor/assets/ember/development/ember.js
# and a production minified build (no comments or debug tags) into:
# vendor/assets/ember/production/ember.js
#
# Idea by Ivan Vanderbyl (ivan@crashlog.io) December, 2012
# This implementation by John McDowall (john@mcdowall.info) April, 2013
def say(msg, &block)
print "#{msg}..."
if block_given?
quietly do
yield
end
puts " Done."
end
end
namespace :ember do
desc "Update Ember.js from latest Builds on S3."
task :update => [:core, :data]
task :core do
say "Grabbing Core from S3..." do
sh "curl -# http://builds.emberjs.com.s3.amazonaws.com/ember-latest.js -o vendor/assets/ember/development/ember.js"
sh "curl -# http://builds.emberjs.com.s3.amazonaws.com/ember-latest.min.js -o vendor/assets/ember/production/ember.js"
end
end
task :data do
say "Grabbing Data from S3..." do
sh "curl -# http://builds.emberjs.com.s3.amazonaws.com/ember-data-latest.js -o vendor/assets/ember/development/ember-data.js"
sh "curl -# http://builds.emberjs.com.s3.amazonaws.com/ember-data-latest.min.js -o vendor/assets/ember/production/ember-data.js"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment