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 +4 -4
- data/lib/tension/context.rb +10 -1
- data/lib/tension/controller.rb +4 -5
- data/lib/tension/environment.rb +5 -1
- data/lib/tension/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8550a2d08689d7631777f9df17d8b943d40ad1f
|
4
|
+
data.tar.gz: bc26def24af87a4eb52366de7ad1cae8148e1f0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dab945b47b1e7e3baeb3a6095c1f7ab950a86308fb4329481bf8745d5a07823544a967606423d66713d561bade8977bd3399a3db967752f177cddc2c601e9d7
|
7
|
+
data.tar.gz: ba6b2135adbb65584a0012a56438f54f4c106111da2616522f59525dbc5963bc861b3317b5e610520ac0eece25a3ed50de08ca0695e09bb2539697ab6627e90d
|
data/lib/tension/context.rb
CHANGED
@@ -48,7 +48,16 @@ module Tension
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def shared_assets
|
51
|
-
controller
|
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
|
|
data/lib/tension/controller.rb
CHANGED
@@ -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
|
-
|
19
|
-
|
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
|
|
data/lib/tension/environment.rb
CHANGED
@@ -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
|
#
|
data/lib/tension/version.rb
CHANGED
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.
|
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:
|
62
|
+
version: '0'
|
63
63
|
requirements: []
|
64
64
|
rubyforge_project:
|
65
65
|
rubygems_version: 2.0.3
|