Permalink
Browse files

upgrade coffee-script to 1.6.2

test plan:
  - make sure you have the coffee binary from npm:
    `npm install -g coffee-script@1.6.2`
  - run rake js:generate, make sure all coffeescript still compiles
    correctly
  - open a coffeescript file and make sure it still gets automatically
    compiled when saved by guard.
  - rejoice at the arrival of source maps.

Change-Id: I06ce9e83a76be9d4cc0e2b2c80566a0db19f9d7e
Reviewed-on: https://gerrit.instructure.com/18842
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
  • Loading branch information...
1 parent 117adb2 commit 8045a5931397337a14655c5faaa5b197d9bba16c Stanley Stuart committed Mar 21, 2013
View
1 .gitignore
@@ -21,6 +21,7 @@
/exports/
/Gemfile.lock
/log/
+/public/app/
/public/assets/
/public/doc/api/
/public/javascripts/compiled/
View
2 Gemfile
@@ -142,7 +142,7 @@ end
group :development, :test do
gem 'coffee-script'
- gem 'coffee-script-source', '1.4.0' #pinned so everyone's compiled output matches
+ gem 'coffee-script-source', '1.6.2' #pinned so everyone's compiled output matches
gem 'parallel', '0.5.16'
end
View
11 config/initializers/coffee_script_sourcemaps_symlinks.rb
@@ -0,0 +1,11 @@
+if Rails.env.development?
+ app_dir = File.expand_path "#{Rails.root}/public/app"
+ FileUtils.makedirs(app_dir) unless File.exists?(app_dir)
+ symlink = File.expand_path "#{Rails.root}/public/app/coffeescripts"
+ target = File.expand_path "#{Rails.root}/app/coffeescripts"
+ unless File.symlink?(symlink) && File.readlink(symlink) == target
+ File.unlink(symlink) if File.exists?(symlink)
+ File.symlink(target,symlink)
+ end
+end
+
View
2 guard/coffeescript.rb
@@ -73,7 +73,7 @@ def compile_files(files, watchers, options)
if Canvas::CoffeeScript.coffee_script_binary_is_available?
Parallel.each(directories.map, :in_threads => Parallel.processor_count) do |(directory, scripts)|
FileUtils.mkdir_p(File.expand_path(directory)) if !File.directory?(directory) && !options[:noop]
- system('coffee', '-c', '-o', directory, *scripts)
+ system('coffee', '-m', '-c', '-o', directory, *scripts)
if $?.exitstatus != 0
Formatter.error("Unable to compile coffeescripts in #{directory}")
else
View
2 lib/tasks/js.rake
@@ -80,7 +80,7 @@ namespace :js do
Parallel.each(dirs, :in_threads => Parallel.processor_count) do |dir|
destination = coffee_destination(dir)
FileUtils.mkdir_p(destination)
- system("coffee -c -o #{destination} #{dir}/*.coffee")
+ system("coffee -m -c -o #{destination} #{dir}/*.coffee")
raise "Unable to compile coffeescripts in #{dir}" if $?.exitstatus != 0
end
else
View
2 spec/coffeescripts/collections/PaginatedCollectionSpec.coffee
@@ -7,7 +7,7 @@ define [
module 'PaginatedCollection',
setup: ->
@server = sinon.fakeServer.create()
- @collection = new PaginatedCollection null
+ @collection = new PaginatedCollection null,
params:
multi: ['foos', 'bars']
single: 1
View
4 spec/coffeescripts/collections/RolesCollectionSpec.coffee
@@ -12,7 +12,7 @@ define [
@account_id = null
test "generate the correct url for a collection of roles", 1, ->
- roles_collection = new RolesCollection null
+ roles_collection = new RolesCollection null,
contextAssetString: "account_#{@account_id}"
equal roles_collection.url(), "/api/v1/accounts/#{@account_id}/roles", "roles collection url"
@@ -23,7 +23,7 @@ define [
role1 = new Role
role2 = new Role
- roles_collection = new RolesCollection null
+ roles_collection = new RolesCollection null,
contextAssetString: "account_#{@account_id}"
roles_collection.fetch success: =>
View
4 spec/coffeescripts/views/SyllabusViewSpec.coffee
@@ -46,7 +46,7 @@ define [
links = "<#{request.url}>; rel=\"first\""
links += ",<#{request.url}>; rel=\"next\"" if more
- request.respond 200
+ request.respond 200,
'Content-Type': 'application/json'
'Link': links
JSON.stringify response
@@ -61,7 +61,7 @@ define [
links = "<#{request.url}>; rel=\"first\""
links += ",<#{request.url}>; rel=\"next\"" if more
- request.respond 200
+ request.respond 200,
'Content-Type': 'application/json'
'Link': links
JSON.stringify response
View
2 spec/coffeescripts/xhr/remoteSelectSpec.coffee
@@ -3,7 +3,7 @@ define [
'compiled/xhr/RemoteSelect'
'helpers/loadFixture'
], (_, RemoteSelect, loadFixture) ->
- module 'RemoteSelect'
+ module 'RemoteSelect',
setup: ->
@response = [200, { 'Content-Type': 'application/json' }, '[{ "label": "one", "value": 1 }, {"label": "two", "value": 2 }]']
@fixture = loadFixture 'RemoteSelect'

0 comments on commit 8045a59

Please sign in to comment.