browserify-rails 1.5.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/browserify-rails.gemspec +0 -1
- data/lib/browserify-rails/browserify_processor.rb +22 -11
- data/lib/browserify-rails/version.rb +1 -1
- data/test/browserify_processor_test.rb +2 -5
- metadata +3 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 069dd733ee8b82ce039b8cab493224a3f2766817
|
4
|
+
data.tar.gz: 514b3064cab147c0cf67562fff3a2139a3484ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a918a61e0974438b877f97de5c04dca1e7f1a046255195bbde529d8ecce3eba6ee26ade6c34170a85e6e52d9dfc12137562ece7a9a59f3d3f3f3fe372ab209e
|
7
|
+
data.tar.gz: e76f0128cb8ae076789884b941eaa2bc4323bca8c3fb9c3d300899bf855b3b295d032d7b9421205714af265fafda464a4e6af78fcc0ea808bd6a01404dcdcc0c
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file going forward.
|
3
3
|
|
4
|
+
## [2.0.2] - 2015-11-23
|
5
|
+
- fix bug in dependencies passed to sprockets which broke change detection
|
6
|
+
|
7
|
+
## [2.0.1] - 2015-11-17
|
8
|
+
- remove tilt gem from gemspec and no longer require it in processor
|
9
|
+
|
10
|
+
## [2.0.0] - 2015-11-17
|
11
|
+
- remove dependency on tilt gem and use callable sprockets api (thanks to guiceolin)
|
12
|
+
|
4
13
|
## [1.5.0] - 2015-10-07
|
5
14
|
- add jruby support for file name resolution (thanks to jmagoon)
|
6
15
|
- make config.force more flexible by allowing it to be a proc (thanks to rosendi)
|
data/browserify-rails.gemspec
CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_runtime_dependency "railties", ">= 4.0.0", "< 5.0"
|
23
23
|
spec.add_runtime_dependency "sprockets", "> 3.0.2"
|
24
|
-
spec.add_runtime_dependency "tilt", ">= 1.1", "< 3"
|
25
24
|
|
26
25
|
spec.add_development_dependency "bundler", ">= 1.3"
|
27
26
|
spec.add_development_dependency "rake"
|
@@ -1,33 +1,44 @@
|
|
1
|
-
require "tilt"
|
2
1
|
require "open3"
|
3
2
|
require "fileutils"
|
4
3
|
require "tempfile"
|
5
4
|
require "shellwords"
|
6
5
|
|
7
6
|
module BrowserifyRails
|
8
|
-
class BrowserifyProcessor
|
9
|
-
attr_accessor :config
|
7
|
+
class BrowserifyProcessor
|
8
|
+
attr_accessor :config, :data, :file
|
10
9
|
|
11
|
-
def
|
10
|
+
def self.instance
|
11
|
+
@instance ||= new
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.call(input)
|
15
|
+
instance.call(input)
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize
|
12
19
|
self.config = Rails.application.config.browserify_rails
|
13
|
-
super(template)
|
14
20
|
end
|
15
21
|
|
16
|
-
def
|
22
|
+
def call(input)
|
23
|
+
self.data = input[:data]
|
24
|
+
self.file = input[:filename]
|
25
|
+
|
17
26
|
ensure_tmp_dir_exists!
|
18
27
|
ensure_commands_exist!
|
19
|
-
end
|
20
28
|
|
21
|
-
def evaluate(context, locals, &block)
|
22
29
|
# If there's nothing to do, we just return the data we received
|
23
30
|
return data unless should_browserify?
|
24
31
|
|
32
|
+
dependencies = Set.new(input[:metadata][:dependencies])
|
33
|
+
|
25
34
|
# Signal dependencies to sprockets to ensure we track changes
|
26
|
-
evaluate_dependencies(
|
27
|
-
|
35
|
+
evaluate_dependencies(input[:environment].paths).each do |path|
|
36
|
+
resolved = input[:environment].resolve(path)
|
37
|
+
dependencies << "file-digest://#{resolved}" if resolved
|
28
38
|
end
|
29
39
|
|
30
|
-
run_browserify(
|
40
|
+
new_data = run_browserify(input[:name])
|
41
|
+
{ data: new_data, dependencies: dependencies }
|
31
42
|
end
|
32
43
|
|
33
44
|
private
|
@@ -6,11 +6,8 @@ class BrowserifyProcessorTest < ActiveSupport::TestCase
|
|
6
6
|
end
|
7
7
|
|
8
8
|
setup do
|
9
|
-
|
10
|
-
@
|
11
|
-
@processor = BrowserifyRails::BrowserifyProcessor.new(template) do |p|
|
12
|
-
@empty_module
|
13
|
-
end
|
9
|
+
@processor = BrowserifyRails::BrowserifyProcessor.new
|
10
|
+
@processor.file = "empty_module.js"
|
14
11
|
end
|
15
12
|
|
16
13
|
test "should run command without options if none provided" do
|
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:
|
4
|
+
version: 2.0.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-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -44,26 +44,6 @@ dependencies:
|
|
44
44
|
- - ">"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 3.0.2
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: tilt
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.1'
|
54
|
-
- - "<"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '3'
|
57
|
-
type: :runtime
|
58
|
-
prerelease: false
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - ">="
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '1.1'
|
64
|
-
- - "<"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '3'
|
67
47
|
- !ruby/object:Gem::Dependency
|
68
48
|
name: bundler
|
69
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -342,3 +322,4 @@ test_files:
|
|
342
322
|
- test/fixtures/plain.out.js
|
343
323
|
- test/fixtures/secondary.out.js
|
344
324
|
- test/test_helper.rb
|
325
|
+
has_rdoc:
|