Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Support require.js and r.js 2.0 #54

Merged
merged 7 commits into from
Jun 16, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<!--
Marked Style: GitHub
-->
# v0.9.0

- **BREAKING CHANGE**: Upgrade RequireJS and r.js to v2.0.0
- order.js was removed. See the new [RequireJS 2.0 shim config](https://github.com/jrburke/requirejs/wiki/Upgrading-to-RequireJS-2.0#wiki-shim).
- Build support for `empty:` is now handled by r.js 2.0 natively.

# v0.8.2

- Fix for `requirejs_include_tag` error when `config/requirejs.yml` has no
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
requirejs-rails (0.8.2)
requirejs-rails (0.9.0)
railties (>= 3.1.1, < 3.3)

GEM
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ Usage changes that may break functionality for those upgrading along the 0.x
series are documented here. See [the Changelog](https://github.com/jwhitley/requirejs-rails/blob/master/CHANGELOG.md) for the full
list of feature additions, bugfixes, etc.

### v0.9.0

- The upgrade to RequireJS and r.js 2.0 includes changes that will break some
apps.

### v0.5.1

- `requirejs_include_tag` now generates a data-main attribute if given an argument, ala:
Expand Down Expand Up @@ -291,4 +296,4 @@ to see what's upcoming and to file feature requests and bug reports.

----

Copyright 2011 John Whitley. See the file MIT-LICENSE for terms.
Copyright 2011-2012 John Whitley. See the file MIT-LICENSE for terms.
11 changes: 1 addition & 10 deletions app/helpers/requirejs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _requirejs_data(name, &block)
{}.tap do |data|
if name
name += ".js" unless name =~ /\.js$/
data['main'] = _javascript_path(name)
data['main'] = _javascript_path(name).sub(/\.js$/,'')
end

data.merge!(yield controller) if block_given?
Expand All @@ -20,15 +20,6 @@ def _requirejs_data(name, &block)
end.join(" ")
end

def _data_main(name)
if name
name += ".js" unless name =~ /\.js$/
%Q{data-main="#{_javascript_path(name)}"}
else
""
end
end

def requirejs_include_tag(name=nil, &block)
requirejs = Rails.application.config.requirejs

Expand Down
Loading