browserify-rails 0.8.1 → 0.8.2

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: c4e833f60ddfd44e1c1c4af7e7f6238667d630e4
4
- data.tar.gz: 22cf219d2d13b81a6aa37232835dba90da424171
3
+ metadata.gz: cd5fc637d1dda848a5973d43d6dea615753eb0c2
4
+ data.tar.gz: 4a8fa4c524a48c5adc5715bc78fdc13b5616b08f
5
5
  SHA512:
6
- metadata.gz: bda27a59ae871de6fdeeb6d7a1e6e48f102712647d3103236a2335345dc1b0b489ddcc4013a784ed4a37cef337e1fb2339c4865a3c39eca289967f835498eb38
7
- data.tar.gz: a00f43d0187a1124cee3b3ce057e68c5720fc8e29d29b158e51b0a5752de1a75aff097ec1010822ba05da3c5a097b04d468445488380707191b278177c5419f8
6
+ metadata.gz: f765df8bc46c0433e7b52553681eeb8efbe8f314ff7d864074ad91029f95a3cfe245ac6c0805eea1f48398cfc93af6f0e36924fc17ad053249628cd581866301
7
+ data.tar.gz: 4899779f24c38748428e21341c81bae82e1cc15dec0cb70c685c207551beb5052b089254f49dc071b10cd8c2f1d5f3037fe2f2a3b22f15b2fc76ab90cc8d25f3
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # browserify-rails
2
2
  [![Build Status](https://travis-ci.org/browserify-rails/browserify-rails.svg?branch=master)](https://travis-ci.org/browserify-rails/browserify-rails)
3
+ [![Gem Version](https://badge.fury.io/rb/browserify-rails.svg)](http://badge.fury.io/rb/browserify-rails)
3
4
 
4
5
  This library adds CommonJS module support to Sprockets (via Browserify).
5
6
 
@@ -119,6 +120,11 @@ class My::Application < Rails::Application
119
120
 
120
121
  # or as a string:
121
122
  config.browserify_rails.commandline_options = "-t browserify-shim --fast"
123
+
124
+ # Define NODE_ENV to be used with envify
125
+ #
126
+ # defaults to Rails.env
127
+ config.browserify_rails.node_env = "production"
122
128
  ```
123
129
 
124
130
  ### browserify-incremental
@@ -121,7 +121,7 @@ module BrowserifyRails
121
121
  def env
122
122
  {
123
123
  "NODE_PATH" => asset_paths,
124
- "NODE_ENV" => Rails.env
124
+ "NODE_ENV" => config.node_env || Rails.env
125
125
  }
126
126
  end
127
127
 
@@ -1,3 +1,3 @@
1
1
  module BrowserifyRails
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -40,7 +40,13 @@ class BrowserifyProcessorTest < ActiveSupport::TestCase
40
40
  assert_equal "-d -i test4.js", @processor.send(:options)
41
41
  end
42
42
 
43
- test "env should have NODE_ENV set" do
43
+ test "env should have NODE_ENV set to Rails.application.config.browserify_rails.node_env" do
44
+ Rails.application.config.browserify_rails.node_env = "staging"
45
+ assert_equal "staging", @processor.send(:env)["NODE_ENV"]
46
+ end
47
+
48
+ test "env should have NODE_ENV default to Rails.env" do
49
+ Rails.application.config.browserify_rails.node_env = nil
44
50
  assert_equal Rails.env, @processor.send(:env)["NODE_ENV"]
45
51
  end
46
52
 
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.8.1
4
+ version: 0.8.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: 2015-03-17 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  version: '0'
217
217
  requirements: []
218
218
  rubyforge_project:
219
- rubygems_version: 2.2.2
219
+ rubygems_version: 2.4.5
220
220
  signing_key:
221
221
  specification_version: 4
222
222
  summary: 'Get the best of both worlds: Browserify + Rails = CommonJS Heaven'