browserify-rails 0.7.3 → 0.7.4
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 +4 -4
- data/lib/browserify-rails/browserify_processor.rb +7 -5
- data/lib/browserify-rails/version.rb +1 -1
- 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: 803ccbf56f752df266b181a3144237c1953760c4
|
4
|
+
data.tar.gz: de94a0184ede13f2314ef00e347c86b8c4dccf39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b220fd503614f7ff964bcd6691777d4f052732cec99374ae19fd5310618baa520a5428309c7a1ffc5d5502cc564132bb3725e4d71a889f7cbf60828ab3e7aa
|
7
|
+
data.tar.gz: 2d8dd6bcd548af74734513f6929e74d49fb8e6c78034264d4208bbc18a3dd2416780971c5d4b6d0168702efe725b0c8687bf7d12f55412831f95671fb27dc594
|
@@ -4,8 +4,6 @@ require "tempfile"
|
|
4
4
|
|
5
5
|
module BrowserifyRails
|
6
6
|
class BrowserifyProcessor < Tilt::Template
|
7
|
-
TMP_PATH = File.join("tmp/browserify-rails").freeze
|
8
|
-
|
9
7
|
def prepare
|
10
8
|
ensure_tmp_dir_exists!
|
11
9
|
ensure_commands_exist!
|
@@ -29,6 +27,10 @@ module BrowserifyRails
|
|
29
27
|
Rails.application.config.browserify_rails
|
30
28
|
end
|
31
29
|
|
30
|
+
def tmp_path
|
31
|
+
@tmp_path ||= Rails.root.join("tmp", "browserify-rails").freeze
|
32
|
+
end
|
33
|
+
|
32
34
|
def browserfy_cmd
|
33
35
|
@browserfy_cmd ||= File.join(config.node_bin, "browserify").freeze
|
34
36
|
end
|
@@ -38,7 +40,7 @@ module BrowserifyRails
|
|
38
40
|
end
|
39
41
|
|
40
42
|
def ensure_tmp_dir_exists!
|
41
|
-
FileUtils.mkdir_p(rails_path(
|
43
|
+
FileUtils.mkdir_p(rails_path(tmp_path))
|
42
44
|
end
|
43
45
|
|
44
46
|
def ensure_commands_exist!
|
@@ -129,13 +131,13 @@ module BrowserifyRails
|
|
129
131
|
# Browserifyinc uses a special cache file. We set up the path for it if
|
130
132
|
# we're going to use browserifyinc.
|
131
133
|
if uses_browserifyinc(force_browserifyinc)
|
132
|
-
cache_file_path = rails_path(
|
134
|
+
cache_file_path = rails_path(tmp_path, "browserifyinc-cache.json")
|
133
135
|
command_options << " --cachefile=#{cache_file_path.inspect}"
|
134
136
|
end
|
135
137
|
|
136
138
|
# Create a temporary file for the output. Such file is necessary when
|
137
139
|
# using browserifyinc, but we use it in all instances for consistency
|
138
|
-
output_file = Tempfile.new("output", rails_path(
|
140
|
+
output_file = Tempfile.new("output", rails_path(tmp_path))
|
139
141
|
command_options << " -o #{output_file.path.inspect}"
|
140
142
|
|
141
143
|
# Compose the full command (using browserify or browserifyinc as necessary)
|
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.
|
4
|
+
version: 0.7.4
|
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-02-
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|