tension 0.9.10 → 0.9.11

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: 6039624381a0d73836dfa4caced220027b665dc2
4
- data.tar.gz: f0b3aa15739e27340cf7e60fcb361332807d5d1c
3
+ metadata.gz: d79990890e3efdb3e301b8a25d1aea118d536167
4
+ data.tar.gz: 41117c436948f6aef93d09652fdb3a1c503dfc08
5
5
  SHA512:
6
- metadata.gz: 1297e086e71c4e771ea6f01bfef803bfbd9e0173678dc1c949223c2930a2c62ab0d028ee65188e479d02c0fee43b7ba23b82ee407c0e422f391b2f8e9b447588
7
- data.tar.gz: 2cdca84e54a796751a41f74ab2dc14ca8f14bcec8d1337c1a5264cc52dd65787b1f9ea225fb99e746fd827de6730c9010c884029ee1234ed3fef81edc9ab328e
6
+ metadata.gz: d42c14d2bc9d8bb9d787b4a05d5fd94bdcfe35e48f25d09a8cf92eadf68427af0b5f38583bb4566064cd2b24fc32917a6e64d284dc49a72bd167aa49dc639c36
7
+ data.tar.gz: 691cb93f49e58aefe0c54fa892dac95b2ca7d6a2b9c57cd9fd394fd4b7fe2afde6a566480a6b963a84176f88feddd5f163db269d4d57e9f677e3f46c5ab464ed
@@ -12,21 +12,21 @@ module Tension
12
12
  # Returns the Context for the current controller.
13
13
  #
14
14
  def asset_context
15
- find_asset_context( request.symbolized_path_parameters[:controller] )
15
+ find_asset_context( request.path_parameters['controller'] )
16
16
  end
17
17
 
18
18
  # Returns the Sprockets Asset for the current action's JavaScript
19
19
  # to be written into the template.
20
20
  #
21
21
  def action_javascript
22
- asset_context.js( request.symbolized_path_parameters[:action] )
22
+ asset_context.js( request.path_parameters['action'] )
23
23
  end
24
24
 
25
25
  # Returns the Sprockets Asset for the current action's stylesheet
26
26
  # to be written into the template.
27
27
  #
28
28
  def action_stylesheet
29
- asset_context.css( request.symbolized_path_parameters[:action] )
29
+ asset_context.css( request.path_parameters['action'] )
30
30
  end
31
31
 
32
32
  # Proxy to Tension::Environment.find.
@@ -24,19 +24,14 @@ module Tension
24
24
  private
25
25
 
26
26
  def asset_for(type, *args)
27
- controller = request.symbolized_path_parameters[:controller]
28
- action = request.symbolized_path_parameters[:action]
27
+ return nil if asset_context.nil?
29
28
 
30
- asset = Tension::Environment.find( controller ).send( action, type )
31
-
32
- include_method = case type.to_s
33
- when "js"
34
- :javascript_include_tag
35
- when "css"
36
- :stylesheet_link_tag
29
+ case type.to_sym
30
+ when :js
31
+ javascript_include_tag( action_javascript.logical_path, *args )
32
+ when :css
33
+ stylesheet_link_tag( action_stylesheet.logical_path, *args )
37
34
  end
38
-
39
- send( include_method, asset.logical_path, *args )
40
35
  end
41
36
  end
42
37
 
@@ -1,3 +1,3 @@
1
1
  module Tension
2
- VERSION = "0.9.10".freeze
2
+ VERSION = "0.9.11".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piers Mainwaring