css_splitter 0.4.5 → 0.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccd37dc88c15d291f462a0580a87a53e64773939
4
- data.tar.gz: b5e405fcf8f9b38729720e877974e7ff2ed9bb76
3
+ metadata.gz: 859858b1596beb5feb01a1197720a5e463a1e1bc
4
+ data.tar.gz: ffd9aa6611ae252cffe6597f1ca9f6b4fb647c7b
5
5
  SHA512:
6
- metadata.gz: 4b8a6429f7e611ed1a03a9e5f2a949b25b0f6cc4e0bf157537cff10f18ce3e82f952df2def2741296d85757f0e56087fc9b06ba3313b18658ef029abda8f3454
7
- data.tar.gz: 74ec2bd00e17677a1f451c773100562368fe27ae14a87eed6716db648b10bcead0228526a2bc5fc111780c2078c7ad85b1674c520935dde4352d64dbc925aaf5
6
+ metadata.gz: 560f7bf19f745e86810515d8cd2c899f21d59943a8a5bbe253cf8d1ad7a59b3f6336c63fb2c04645fe44a5cf972a01f659660eb846116f27cbdb9aee4439ba15
7
+ data.tar.gz: f8accbbc62ed5faa8c973ea6e7745b2c53d99ff5b6a3ec79069108b85ff731f0f766287f6362ff66c3b18185a18b0e9833b773bad4c6cade69e5f20242e192c7
@@ -12,7 +12,8 @@ module CssSplitter
12
12
 
13
13
  initializer 'css_splitter.action_controller' do |app|
14
14
  ActiveSupport.on_load :action_controller do
15
- helper CssSplitter::ApplicationHelper
15
+ # Not all controllers use helpers (such as API based controllers)
16
+ helper CssSplitter::ApplicationHelper if respond_to?(:helper)
16
17
  end
17
18
  end
18
19
  end
@@ -10,6 +10,22 @@ module CssSplitter
10
10
  def prepare
11
11
  end
12
12
 
13
+ def self.call(input)
14
+ data_in = input[:data]
15
+
16
+ # Instantiate Sprockets::Context to pass along helper methods for Tilt
17
+ # processors
18
+ context = input[:environment].context_class.new(input)
19
+
20
+ # Pass the asset file contents as a block to the template engine,
21
+ # then get the results of the engine rendering
22
+ engine = self.new { data_in }
23
+ rendered_data = engine.render(context, {})
24
+
25
+ # Return the data and any metadata (ie file dependencies, etc)
26
+ context.metadata.merge(data: rendered_data.to_str)
27
+ end
28
+
13
29
  def evaluate(scope, locals, &block)
14
30
  # Evaluate the split if the asset is named with a trailing _split2, _split3, etc.
15
31
  if scope.logical_path =~ /_split(\d+)$/
@@ -1,3 +1,3 @@
1
1
  module CssSplitter
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css_splitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Peters
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-25 00:00:00.000000000 Z
12
+ date: 2016-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  requirements: []
210
210
  rubyforge_project:
211
- rubygems_version: 2.4.7
211
+ rubygems_version: 2.5.1
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: CSS stylesheet splitter for Rails