browserify-rails 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MWI0YWIwN2I0YzQxZmZlMGI2MGU1NzE2OWQzMjk2YjkyNTExOGNmNg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c8fc489be291bbeb57acb5004f86574a3254fe2f
|
4
|
+
data.tar.gz: 3dac86e18f58cf52c91dbe1a8166ff59b5cdf70b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NGRjNGY5N2Q4YWFiZjJiYWQ2MWFiODYxOThjNjkyMDZlYzAxYmVhYjcxZTRj
|
11
|
-
YmExZGUxMjM1MzJkYTYwYTJjYzcyM2Y1ZTA1OWVmODM4NWE1OTc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
M2E2OWM5NTVlZDY0YWVmZjkyODU1NTRjMWFjZDg1YjllNjhkNTc1ZTViYWJi
|
14
|
-
MTM3MjhkYjUyYjhlZmIxMGE1ZmNlNjQ5ODhlODg0NzBjYjQyNjA5M2E2N2Qw
|
15
|
-
YjYxZWIwYjg2ZTA4ZjMyNDI0MTkzNjE0MmE3ZDIzNjYwZTA5OTQ=
|
6
|
+
metadata.gz: 923b205738755acb59616ddea742f1cc57f554d3c02c664bd6db905e61b0eeb9ab8f324b193b8963cb56676b93f0542c68cf8fa9e48fa0b3f960cd7cc9514c5f
|
7
|
+
data.tar.gz: defd05b16d32bfd53b3b3831cdd65dd506cdf41f44e6f735bf65dc061c5af18ed76fc1d104f070888c4402b7206c6aebe7e3ad1889ea4b5fe6e31b2423697e00
|
@@ -35,7 +35,7 @@ module BrowserifyRails
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def should_browserify?
|
38
|
-
in_path? && commonjs_module?
|
38
|
+
in_path? && !browserified? && commonjs_module?
|
39
39
|
end
|
40
40
|
|
41
41
|
# Is this file in any of the configured paths?
|
@@ -45,6 +45,11 @@ module BrowserifyRails
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
# Is this file already packaged for the browser?
|
49
|
+
def browserified?
|
50
|
+
data.to_s.include?("define.amd") || data.to_s.include?("_dereq_")
|
51
|
+
end
|
52
|
+
|
48
53
|
# Is this a commonjs module?
|
49
54
|
#
|
50
55
|
# Be here as strict as possible, so that non-commonjs files are not
|
data/test/compilation_test.rb
CHANGED
@@ -21,6 +21,7 @@ class BrowserifyTest < ActionController::IntegrationTest
|
|
21
21
|
copy_example_file "secondary.js.example"
|
22
22
|
copy_example_file "a_huge_library.js.example"
|
23
23
|
copy_example_file "some_folder/answer.js.example"
|
24
|
+
copy_example_file "browserified.js.example"
|
24
25
|
end
|
25
26
|
|
26
27
|
test "asset pipeline should serve application.js" do
|
@@ -107,6 +108,11 @@ class BrowserifyTest < ActionController::IntegrationTest
|
|
107
108
|
assert_equal false, @response.body.include?("Error: Cannot find module 'some_folder/answer'")
|
108
109
|
end
|
109
110
|
|
111
|
+
test "skips files that are already browserified" do
|
112
|
+
get "/assets/browserified.js"
|
113
|
+
assert_equal fixture("browserified.out.js"), @response.body.strip
|
114
|
+
end
|
115
|
+
|
110
116
|
test "uses config/browserify.yml to mark a module as globally available via --require" do
|
111
117
|
expected_output = fixture("main.out.js")
|
112
118
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.Foo=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2
|
+
module.exports = true;
|
3
|
+
|
4
|
+
},{}]},{},[1])
|
5
|
+
(1)
|
6
|
+
});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.Foo=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2
|
+
module.exports = true;
|
3
|
+
|
4
|
+
},{}]},{},[1])
|
5
|
+
(1)
|
6
|
+
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browserify-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Hsu, Cymen Vig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -70,42 +70,42 @@ dependencies:
|
|
70
70
|
name: coffee-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mocha
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Browserify + Rails = CommonJS Heaven
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- test/dummy/app/assets/javascripts/app_main.js.example
|
138
138
|
- test/dummy/app/assets/javascripts/app_secondary.js.example
|
139
139
|
- test/dummy/app/assets/javascripts/application.js.example
|
140
|
+
- test/dummy/app/assets/javascripts/browserified.js.example
|
140
141
|
- test/dummy/app/assets/javascripts/coffee.js.coffee.example
|
141
142
|
- test/dummy/app/assets/javascripts/foo.js.example
|
142
143
|
- test/dummy/app/assets/javascripts/main.js.example
|
@@ -181,6 +182,7 @@ files:
|
|
181
182
|
- test/fixtures/application.changed.out.js
|
182
183
|
- test/fixtures/application.foo_changed.out.js
|
183
184
|
- test/fixtures/application.out.js
|
185
|
+
- test/fixtures/browserified.out.js
|
184
186
|
- test/fixtures/empty_module.js
|
185
187
|
- test/fixtures/foo.out.js
|
186
188
|
- test/fixtures/main.out.js
|
@@ -198,12 +200,12 @@ require_paths:
|
|
198
200
|
- lib
|
199
201
|
required_ruby_version: !ruby/object:Gem::Requirement
|
200
202
|
requirements:
|
201
|
-
- -
|
203
|
+
- - '>='
|
202
204
|
- !ruby/object:Gem::Version
|
203
205
|
version: '0'
|
204
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
207
|
requirements:
|
206
|
-
- -
|
208
|
+
- - '>='
|
207
209
|
- !ruby/object:Gem::Version
|
208
210
|
version: '0'
|
209
211
|
requirements: []
|
@@ -211,7 +213,7 @@ rubyforge_project:
|
|
211
213
|
rubygems_version: 2.2.2
|
212
214
|
signing_key:
|
213
215
|
specification_version: 4
|
214
|
-
summary:
|
216
|
+
summary: 'Get the best of both worlds: Browserify + Rails = CommonJS Heaven'
|
215
217
|
test_files:
|
216
218
|
- test/browserify_processor_test.rb
|
217
219
|
- test/compilation_test.rb
|
@@ -221,6 +223,7 @@ test_files:
|
|
221
223
|
- test/dummy/app/assets/javascripts/app_main.js.example
|
222
224
|
- test/dummy/app/assets/javascripts/app_secondary.js.example
|
223
225
|
- test/dummy/app/assets/javascripts/application.js.example
|
226
|
+
- test/dummy/app/assets/javascripts/browserified.js.example
|
224
227
|
- test/dummy/app/assets/javascripts/coffee.js.coffee.example
|
225
228
|
- test/dummy/app/assets/javascripts/foo.js.example
|
226
229
|
- test/dummy/app/assets/javascripts/main.js.example
|
@@ -265,6 +268,7 @@ test_files:
|
|
265
268
|
- test/fixtures/application.changed.out.js
|
266
269
|
- test/fixtures/application.foo_changed.out.js
|
267
270
|
- test/fixtures/application.out.js
|
271
|
+
- test/fixtures/browserified.out.js
|
268
272
|
- test/fixtures/empty_module.js
|
269
273
|
- test/fixtures/foo.out.js
|
270
274
|
- test/fixtures/main.out.js
|