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

Commit 098bf0f

Browse files
committed
This change is no longer needed with r.js 2.0.
This logic was pushed upstream into r.js. Reverted "Rewrite urls in paths to 'empty:' during build" This reverts commit ec67111.
1 parent ac32f2a commit 098bf0f

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

lib/requirejs/rails/config.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def build_config
108108
mod['name'] = 'almond'
109109
mod['include'] = name
110110
end
111-
self.rewrite_urls_in_paths self[:build_config]
112111
end
113112
self[:build_config]
114113
end
@@ -150,13 +149,5 @@ def asset_allowed?(asset)
150149
accum || (matcher =~ asset)
151150
end ? true : false
152151
end
153-
154-
def rewrite_urls_in_paths(cfg)
155-
if cfg.has_key? 'paths'
156-
cfg['paths'] = cfg['paths'].each_with_object({}) do |(k, v), h|
157-
h[k] = (v =~ /^https?:/) ? 'empty:' : v
158-
end
159-
end
160-
end
161152
end
162153
end

test/requirejs-rails_test.rb

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,7 @@ def setup
8585
assert_nil @cfg.build_config['priority']
8686
end
8787

88-
test "build config should replace urls in paths with 'empty:'" do
89-
@cfg.user_config = { 'paths' =>
90-
{
91-
'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
92-
'jqueryssl' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'
93-
}
94-
}
95-
assert_equal 'empty:', @cfg.build_config['paths']['jquery']
96-
assert_equal 'empty:', @cfg.build_config['paths']['jqueryssl']
97-
end
98-
99-
test "build_config should not modify non-urls in paths" do
100-
@cfg.user_config = { 'paths' =>
101-
{
102-
'foo' => 'components/foo'
103-
}
104-
}
105-
assert_equal 'components/foo', @cfg.build_config['paths']['foo']
106-
end
107-
108-
## Almond-specific tests
88+
## Almond tests
10989
test "build_config with almond should accept one module" do
11090
@cfg.loader = :almond
11191
@cfg.user_config = { 'modules' => [ { 'name' => 'foo' } ] }

0 commit comments

Comments
 (0)