browserify-rails 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/browserify-rails/browserify_processor.rb +10 -2
- data/lib/browserify-rails/version.rb +1 -1
- data/test/browserify_processor_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 753653fe9ebcc36fcbfe9ebcb4a44050ecc8e382
|
4
|
+
data.tar.gz: 8f7f954f0c7b9f4d254e4e5e7cb0324f9a06a266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78bfe52c9f4c44658b35ea15116a5b5c26328b5c990b8c70d30bba305bbd0378c6d9e15901f5c8d7a828e122b40903c6b3f5f6301ce39b21a61a49085c2fa1b9
|
7
|
+
data.tar.gz: 970bfab72485509afa047b616c40f78623352c3f052816b44bcdd56ae61914534e3de54d46e903340a39a980f15385cf0fc6a9d5284d92f682b0b6f6a31888e2
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file going forward.
|
3
3
|
|
4
|
+
## [0.9.1] - 2015-04-20
|
5
|
+
- options can be set to a proc
|
6
|
+
|
4
7
|
## [0.9.0] - 2015-04-16
|
5
8
|
- bumped a more significant version due to potential issues with Rails 4.x compatibility
|
6
9
|
|
@@ -192,12 +192,20 @@ module BrowserifyRails
|
|
192
192
|
rails_path(uses_browserifyinc(force) ? browserifyinc_cmd : browserify_cmd)
|
193
193
|
end
|
194
194
|
|
195
|
-
def options
|
195
|
+
def options_to_array(options, file)
|
196
|
+
if options.respond_to? :call
|
197
|
+
options.call(file)
|
198
|
+
else
|
199
|
+
Array(options)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def options(file = file)
|
196
204
|
options = []
|
197
205
|
|
198
206
|
options.push("-d") if config.source_map_environments.include?(Rails.env)
|
199
207
|
|
200
|
-
options +=
|
208
|
+
options += options_to_array(config.commandline_options, file) if config.commandline_options.present?
|
201
209
|
|
202
210
|
options.uniq.join(" ")
|
203
211
|
end
|
@@ -33,6 +33,11 @@ class BrowserifyProcessorTest < ActiveSupport::TestCase
|
|
33
33
|
assert_equal "-d -i test3.js", @processor.send(:options)
|
34
34
|
end
|
35
35
|
|
36
|
+
test "should allow command line options to be a function" do
|
37
|
+
stub_engine_config :commandline_options, -> file { ["-d", "-i #{file}.js"] }
|
38
|
+
assert_equal "-d -i foo.js", @processor.send(:options, "foo")
|
39
|
+
end
|
40
|
+
|
36
41
|
test "should add -d option if current env is in source_maps_env list" do
|
37
42
|
stub_engine_config :commandline_options, ["-i test4.js"]
|
38
43
|
stub_engine_config :source_map_environments, [Rails.env]
|
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.9.
|
4
|
+
version: 0.9.1
|
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: 2015-04-
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|