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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jwhitley/requirejs-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: acquaintable/requirejs-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jul 15, 2012

  1. Copy the full SHA
    5b9916f View commit details

Commits on Aug 13, 2012

  1. Upgrade to Require 2.0.5

    leppert committed Aug 13, 2012
    Copy the full SHA
    8e58c53 View commit details

Commits on Sep 10, 2012

  1. Copy the full SHA
    e441279 View commit details

Commits on Nov 2, 2012

  1. Copy the full SHA
    757be3b View commit details

Commits on Dec 28, 2012

  1. added prefix functions

    Doctor Ripples committed Dec 28, 2012
    Copy the full SHA
    53de341 View commit details

Commits on Dec 30, 2012

  1. added cache bust to js requests in development

    Doctor Ripples committed Dec 30, 2012
    Copy the full SHA
    884ce02 View commit details

Commits on Jan 10, 2013

  1. Merge remote-tracking branch 'upstream/master'

    Doctor Ripples committed Jan 10, 2013
    Copy the full SHA
    8fcca11 View commit details

Commits on Jan 20, 2013

  1. added js to html

    Doctor Ripples committed Jan 20, 2013
    Copy the full SHA
    a356256 View commit details

Commits on Jan 23, 2013

  1. added modernizr

    Doctor Ripples committed Jan 23, 2013
    Copy the full SHA
    3b1e3bf View commit details
  2. changed class prefix for modernizr

    Doctor Ripples committed Jan 23, 2013
    Copy the full SHA
    bf34f81 View commit details

Commits on Jan 26, 2013

  1. removed prefix and modernizr

    Doctor Ripples committed Jan 26, 2013
    Copy the full SHA
    ed5be02 View commit details

Commits on Feb 6, 2013

  1. updated almond

    Doctor Ripples committed Feb 6, 2013
    Copy the full SHA
    8acc786 View commit details
  2. Copy the full SHA
    5a9fef1 View commit details

Commits on Feb 10, 2013

  1. Rails 4 support

    Aaron Rutkovsky committed Feb 10, 2013
    Copy the full SHA
    f0791dd View commit details

Commits on Feb 12, 2013

  1. Copy the full SHA
    77cf93a View commit details
  2. removed bust

    yxmatic committed Feb 12, 2013
    Copy the full SHA
    26233b6 View commit details

Commits on Feb 22, 2013

  1. Copy the full SHA
    5524172 View commit details
  2. Find the correct asset pathname

    arlm committed Feb 22, 2013
    Copy the full SHA
    b9b0528 View commit details
  3. Copy the full SHA
    7eaa1a9 View commit details

Commits on Feb 25, 2013

  1. Copy the full SHA
    c4268ab View commit details

Commits on Mar 2, 2013

  1. Update rvmrc

    pboling committed Mar 2, 2013
    Copy the full SHA
    9f7c893 View commit details
  2. Copy the full SHA
    71e853b View commit details
  3. Copy the full SHA
    4240aba View commit details
  4. Copy the full SHA
    2af4e4a View commit details
  5. Allow Rails 4

    pboling committed Mar 2, 2013
    Copy the full SHA
    3bff5d6 View commit details
  6. Fixed things; works for me

    pboling committed Mar 2, 2013
    Copy the full SHA
    c2563dd View commit details

Commits on Mar 8, 2013

  1. updated r.js and assets

    yxmatic committed Mar 8, 2013
    Copy the full SHA
    715a014 View commit details
  2. raise r.js errors

    yxmatic committed Mar 8, 2013
    Copy the full SHA
    84638bd View commit details
  3. Copy the full SHA
    86e70c3 View commit details

Commits on Mar 20, 2013

  1. Copy the full SHA
    ada79cf View commit details

Commits on Apr 3, 2013

  1. merged upstream

    yxmatic committed Apr 3, 2013
    Copy the full SHA
    745b9e5 View commit details
  2. precompile primary

    yxmatic committed Apr 3, 2013
    Copy the full SHA
    900af62 View commit details

Commits on Apr 10, 2013

  1. configurable bootstrap file

    yxmatic committed Apr 10, 2013
    Copy the full SHA
    c036453 View commit details
  2. Copy the full SHA
    eef97c6 View commit details

Commits on Apr 11, 2013

  1. remove base url

    yxmatic committed Apr 11, 2013
    Copy the full SHA
    029158a View commit details
  2. add baseUrl

    yxmatic committed Apr 11, 2013
    Copy the full SHA
    ab9a4ae View commit details
  3. added custom config

    yxmatic committed Apr 11, 2013
    Copy the full SHA
    9c5441c View commit details

Commits on Apr 12, 2013

  1. separate requirejs config and include script

    Doctor Ripples committed Apr 12, 2013
    Copy the full SHA
    d7dbd14 View commit details

Commits on Apr 19, 2013

  1. turbolinks support

    yxmatic committed Apr 19, 2013
    Copy the full SHA
    96207e2 View commit details
  2. merged

    yxmatic committed Apr 19, 2013
    Copy the full SHA
    31452ea View commit details

Commits on Apr 21, 2013

  1. allow protocol relative paths

    yxmatic committed Apr 21, 2013
    Copy the full SHA
    266aae3 View commit details

Commits on May 1, 2013

  1. removed ruby version

    Doctor Ripples committed May 1, 2013
    Copy the full SHA
    baa556b View commit details

Commits on May 18, 2013

  1. updated r.js

    yxmatic committed May 18, 2013
    Copy the full SHA
    1367aef View commit details
  2. updated require.js

    yxmatic committed May 18, 2013
    Copy the full SHA
    e3e2f0f View commit details
  3. Copy the full SHA
    6477426 View commit details

Commits on May 22, 2013

  1. added config

    yxmatic committed May 22, 2013
    Copy the full SHA
    4fafcd7 View commit details

Commits on May 25, 2013

  1. remove coffeescript wrapper

    yxmatic committed May 25, 2013
    Copy the full SHA
    1831453 View commit details

Commits on Jun 11, 2013

  1. Copy the full SHA
    cbfc760 View commit details

Commits on Aug 13, 2013

  1. Copy the full SHA
    f802f31 View commit details
  2. Copy the full SHA
    17f4949 View commit details
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

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.9.1)
requirejs-rails (0.9.1.1)
railties (>= 3.1.1, < 4.1)

GEM
65 changes: 33 additions & 32 deletions app/helpers/requirejs_helper.rb
Original file line number Diff line number Diff line change
@@ -23,52 +23,53 @@ def _requirejs_data(name, &block)
end.join(" ")
end

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

if requirejs.loader == :almond
name = requirejs.module_name_for(requirejs.build_config['modules'][0])
return _almond_include_tag(name, &block)
end

html = ""

_once_guard do
unless requirejs.run_config.empty?
run_config = requirejs.run_config.dup
unless _priority.empty?
run_config = run_config.dup
run_config[:priority] ||= []
run_config[:priority].concat _priority
end
if Rails.application.config.assets.digest
modules = requirejs.build_config['modules'].map { |m| requirejs.module_name_for m }
html = ActiveSupport::SafeBuffer.new
html.safe_concat "<script>#{requirejs_config_js(name)}</script>\n" unless options[:skip_config]
html.safe_concat %Q|<script #{_requirejs_data(name, &block)} src="#{_javascript_path requirejs.bootstrap_file}" data-turbolinks-track></script>|
html
end
end

# Generate digestified paths from the modules spec
paths = {}
modules.each { |m| paths[m] = _javascript_path(m).sub /\.js$/,'' }
def requirejs_config_js(name = nil, config_data = {})
requirejs = Rails.application.config.requirejs

unless requirejs.run_config.empty?
run_config = requirejs.run_config.dup
unless _priority.empty?
run_config = run_config.dup
run_config[:priority] ||= []
run_config[:priority].concat _priority
end
if Rails.application.config.assets.digest
modules = requirejs.build_config['modules'].map { |m| requirejs.module_name_for m }

if run_config.has_key? 'paths'
# Add paths for assets specified by full URL (on a CDN)
run_config['paths'].each { |k,v| paths[k] = v if v =~ /^https?:/ }
end
# Generate digestified paths from the modules spec
paths = {}
modules.each { |m| paths[m] = _javascript_path(m).sub /\.js$/,'' }

# Override user paths, whose mappings are only relevant in dev mode
# and in the build_config.
run_config['paths'] = paths
if run_config.has_key? 'paths'
# Add paths for assets specified by full URL (on a CDN)
run_config['paths'].each { |k,v| paths[k] = v if v =~ %r{\A(https?:|//)} }
end

run_config['baseUrl'] = baseUrl(name)
html.concat <<-HTML
<script>var require = #{run_config.to_json};</script>
HTML
# Override user paths, whose mappings are only relevant in dev mode
# and in the build_config.
run_config['paths'] = paths
end
run_config['config'] ||= {}
run_config['config'].merge! config_data

html.concat <<-HTML
<script #{_requirejs_data(name, &block)} src="#{_javascript_path 'require.js'}"></script>
HTML

html.html_safe
run_config['baseUrl'] = baseUrl(name)
"var require = #{run_config.to_json};".html_safe
end
end

@@ -98,7 +99,7 @@ def _javascript_path(name)
def baseUrl(js_asset)
js_asset_path = javascript_path(js_asset)
uri = URI.parse(js_asset_path)
asset_host = uri.host && js_asset_path.sub(uri.request_uri, '')
asset_host = uri.host && js_asset_path.sub(uri.path, '')
[asset_host, Rails.application.config.assets.prefix].join
end
end
Loading