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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4dcf3eb3bc52f7b2cd40c8c6acddc9a0553d6dc
4
- data.tar.gz: 2f58e322cc3574fc3f2b3940353d7345016d4dff
3
+ metadata.gz: 069dd733ee8b82ce039b8cab493224a3f2766817
4
+ data.tar.gz: 514b3064cab147c0cf67562fff3a2139a3484ebe
5
5
  SHA512:
6
- metadata.gz: 05ee233810dbc83ed84e4d4c1045f7ff80aaba4cc0e618477639bcd3fdeb79c0773f286317b1af1eee79b43c84f8a8fee6a442b74669384192c1d318a1fcef10
7
- data.tar.gz: ef402cd88e6f4d4ab40f212a1fe28a924badca4d2a518e64f93b2626e6920f53642c942bf55bddf7cf7808dc1842dc2030ae66613ff5102c81f6ce1d20782637
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)
@@ -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 < Tilt::Template
9
- attr_accessor :config
7
+ class BrowserifyProcessor
8
+ attr_accessor :config, :data, :file
10
9
 
11
- def initialize(template)
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 prepare
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(context.environment.paths).each do |path|
27
- context.depend_on(path)
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(context.logical_path)
40
+ new_data = run_browserify(input[:name])
41
+ { data: new_data, dependencies: dependencies }
31
42
  end
32
43
 
33
44
  private
@@ -1,3 +1,3 @@
1
1
  module BrowserifyRails
2
- VERSION = "1.5.0"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -6,11 +6,8 @@ class BrowserifyProcessorTest < ActiveSupport::TestCase
6
6
  end
7
7
 
8
8
  setup do
9
- template = "empty_module.js"
10
- @empty_module = fixture(template)
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: 1.5.0
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-10-08 00:00:00.000000000 Z
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: