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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ecc72e3047d4f19638411881b76b9d98c3485b4
4
- data.tar.gz: fda1cb2e275d8aed2f5edd6afb154f02817891b2
3
+ metadata.gz: 753653fe9ebcc36fcbfe9ebcb4a44050ecc8e382
4
+ data.tar.gz: 8f7f954f0c7b9f4d254e4e5e7cb0324f9a06a266
5
5
  SHA512:
6
- metadata.gz: 4f7aebc86ad7bf65e9ef22e55f5e4f64df8969457297f9da5823b79a1752efc2e17d6f8d87c6456b7b12c60b38e26c040b4e1fedfc9ca45a05c0c0e44e3d5d32
7
- data.tar.gz: 2d4e548b82061ffc5c06d84d31c7e189d20d4774ca5f376df4ba208970d915d133faa68531ded7e88973352d15d5c465c91b15de0f39394920f2bf3f75bdae87
6
+ metadata.gz: 78bfe52c9f4c44658b35ea15116a5b5c26328b5c990b8c70d30bba305bbd0378c6d9e15901f5c8d7a828e122b40903c6b3f5f6301ce39b21a61a49085c2fa1b9
7
+ data.tar.gz: 970bfab72485509afa047b616c40f78623352c3f052816b44bcdd56ae61914534e3de54d46e903340a39a980f15385cf0fc6a9d5284d92f682b0b6f6a31888e2
@@ -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 += Array(config.commandline_options) if config.commandline_options.present?
208
+ options += options_to_array(config.commandline_options, file) if config.commandline_options.present?
201
209
 
202
210
  options.uniq.join(" ")
203
211
  end
@@ -1,3 +1,3 @@
1
1
  module BrowserifyRails
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  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.0
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-16 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets