browserify-rails 0.7.5 → 0.8.0

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: 6c5c5de25c1267253cd55b2f8f74cdd597555567
4
- data.tar.gz: 66a532d5b0ed42587bfd136af0b939dfd01bf5b2
3
+ metadata.gz: 3bc6448eee2f41f16e7d2890b6bb13a0744d2d95
4
+ data.tar.gz: 6f502702cfa91fcd12dfc3654595da4eadeb3b56
5
5
  SHA512:
6
- metadata.gz: 11b3d5fc5a93284435b96b2037fb7f9c39aa8bc7adfd1c1022d5116a2725450230b503665b1bcc97f0d88a5c945f67f3f197bb13b40ce074b2958f3e3867b63c
7
- data.tar.gz: bbe05cec002b6a91459b7d0f07bd2126727a0fd262aafc8b484a1151e19ff67f3d26cca2a2ce8987c5db2c9a30547b424bbb797cf2b9f3e3d72e2ee64900842d
6
+ metadata.gz: e718a75e1987a9b0add262abfda2c7df0807412d1ff8c446f8094544ec10b33cd6ae8803c19d0ce0d821dc5cbf61f27370f0ca235eae34ecbb232ac184825c34
7
+ data.tar.gz: 6aeac3219054f893584e9fddcfe9d5f1d1e16f1e7fb0051edaad0ba44afbcd2a10aff68e75f70099d0782474b3e5033364ef193385530daac27261bce7429665
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file going forward.
3
+
4
+ ## [0.8.0] - 2015-03-17
5
+ ### Changed
6
+ - do not compile source maps for any environment by default (used to default to development-enabled)
7
+ - set NODE_ENV to Rails.env in environment that runs browserify command
8
+ - begin using changelog
data/README.md CHANGED
@@ -99,8 +99,8 @@ class My::Application < Rails::Application
99
99
 
100
100
  # Environments, in which to generate source maps
101
101
  #
102
- # The default is `["development"]`.
103
- config.browserify_rails.source_map_environments << "production"
102
+ # The default is none
103
+ config.browserify_rails.source_map_environments << "development"
104
104
 
105
105
  # Should the node_modules directory be evaluated for changes on page load
106
106
  #
@@ -110,6 +110,21 @@ module BrowserifyRails
110
110
  end
111
111
  end
112
112
 
113
+ # Environtment to run browserify in:
114
+ #
115
+ # NODE_PATH https://nodejs.org/api/all.html#all_loading_from_the_global_folders
116
+ # but basically allows one to have multiple locations for non-relative requires
117
+ # to be resolved to.
118
+ #
119
+ # NODE_ENV is set to the Rails.env. This is used by some modules to determine
120
+ # how to build. Example: https://facebook.github.io/react/downloads.html#npm
121
+ def env
122
+ {
123
+ "NODE_PATH" => asset_paths,
124
+ "NODE_ENV" => Rails.env
125
+ }
126
+ end
127
+
113
128
  # Run the requested version of browserify (browserify or browserifyinc)
114
129
  # based on configuration or the use_browserifyinc parameter if present.
115
130
  #
@@ -142,7 +157,6 @@ module BrowserifyRails
142
157
 
143
158
  # Compose the full command (using browserify or browserifyinc as necessary)
144
159
  command = "#{browserify_command(force_browserifyinc)} #{command_options} -"
145
- env = { "NODE_PATH" => asset_paths }
146
160
 
147
161
  # The directory the command will be executed from
148
162
  base_directory = File.dirname(file)
@@ -15,7 +15,7 @@ module BrowserifyRails
15
15
  config.browserify_rails.evaluate_node_modules = false
16
16
 
17
17
  # Environments to generate source maps in
18
- config.browserify_rails.source_map_environments = ["development"]
18
+ config.browserify_rails.source_map_environments = []
19
19
 
20
20
  # Use browserifyinc instead of browserify
21
21
  config.browserify_rails.use_browserifyinc = true
@@ -1,3 +1,3 @@
1
1
  module BrowserifyRails
2
- VERSION = "0.7.5"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -40,6 +40,18 @@ 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
44
+ assert_equal Rails.env, @processor.send(:env)["NODE_ENV"]
45
+ end
46
+
47
+ test "env should have NODE_PATH set to Rails.application.config.assets.paths" do
48
+ node_env = @processor.send(:env)["NODE_PATH"]
49
+
50
+ Rails.application.config.assets.paths.each do |path|
51
+ assert_equal true, node_env.include?(path)
52
+ end
53
+ end
54
+
43
55
  def stub_engine_config(key, value)
44
56
  @processor.send(:config).stubs(key).returns(value)
45
57
  end
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.7.5
4
+ version: 0.8.0
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-07 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -117,6 +117,7 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".travis.yml"
120
+ - CHANGELOG.md
120
121
  - Gemfile
121
122
  - LICENSE.txt
122
123
  - README.md