tension 0.9.16.pre → 0.10.0

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: 24de161fcb938eff0187dbd00f57303069e91f30
4
- data.tar.gz: 3c80a48d9e2a993b674a8a013a683844c5c8d8e3
3
+ metadata.gz: b8550a2d08689d7631777f9df17d8b943d40ad1f
4
+ data.tar.gz: bc26def24af87a4eb52366de7ad1cae8148e1f0c
5
5
  SHA512:
6
- metadata.gz: c7ca25fdaec1bfb1662ae15cf76695db9941ab8a3ff34dced421abfd1d4f8b67bc7179385cc121030ad6f113bacbab274575a5b236c02ffe98e311a220267488
7
- data.tar.gz: 7987f999f4ca991e21692d3c27a06578a24b16fd6e8a6ecc7d32bdcf3ec841458859dee13a72243f9c9c464e5346cdf531e4dd9da9415497d99abc8beecf7b79
6
+ metadata.gz: 7dab945b47b1e7e3baeb3a6095c1f7ab950a86308fb4329481bf8745d5a07823544a967606423d66713d561bade8977bd3399a3db967752f177cddc2c601e9d7
7
+ data.tar.gz: ba6b2135adbb65584a0012a56438f54f4c106111da2616522f59525dbc5963bc861b3317b5e610520ac0eece25a3ed50de08ca0695e09bb2539697ab6627e90d
@@ -48,7 +48,16 @@ module Tension
48
48
  end
49
49
 
50
50
  def shared_assets
51
- controller._tension_assets
51
+ klass = controller
52
+
53
+ while true
54
+ break {} if klass == ActionController::Base
55
+
56
+ assets = Tension.environment.controllers[ klass.name.underscore ]
57
+ break assets if assets.present?
58
+
59
+ klass = klass.superclass
60
+ end
52
61
  end
53
62
 
54
63
 
@@ -7,16 +7,15 @@ module Tension
7
7
  included do
8
8
  # Make these methods available in helpers too.
9
9
  helper_method :asset_context, :action_javascript, :action_stylesheet
10
-
11
- class_attribute :_tension_assets, instance_accessor: false
12
- self._tension_assets = {}
13
10
  end
14
11
 
15
12
 
16
13
  module ClassMethods
17
14
  def include_assets(options)
18
- self._tension_assets[ Tension::CSS ] = options[:css]
19
- self._tension_assets[ Tension::JS ] = options[:js]
15
+ Tension.environment.controllers[ self.name.underscore ] = {
16
+ Tension::CSS => options[:css],
17
+ Tension::JS => options[:js]
18
+ }
20
19
  end
21
20
  end
22
21
 
@@ -5,7 +5,7 @@ module Tension
5
5
  #
6
6
  class Environment
7
7
 
8
- attr_reader :assets
8
+ attr_reader :assets, :controllers
9
9
 
10
10
  def initialize(assets_path)
11
11
  if assets_cached?
@@ -37,6 +37,10 @@ module Tension
37
37
  @contexts ||= Hash.new
38
38
  end
39
39
 
40
+ def controllers
41
+ @controllers ||= Hash.new
42
+ end
43
+
40
44
  # Determines whether or not a given path refers to an asset that requires
41
45
  # precompilation.
42
46
  #
@@ -1,3 +1,3 @@
1
1
  module Tension
2
- VERSION = "0.9.16.pre".freeze
2
+ VERSION = "0.10.0".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.16.pre
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piers Mainwaring
@@ -57,9 +57,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.3.1
62
+ version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
65
  rubygems_version: 2.0.3