lotus-view 0.4.1 → 0.4.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: b321d4151a1e0e2117595364a5ced056dd1e392f
4
- data.tar.gz: 3632ba288305a3e5c872bab66bef57be6bf24dd0
3
+ metadata.gz: 157e33c3501d504b0f477800b0edf1dfda0ed005
4
+ data.tar.gz: d435e901372ec5f8eef01e16a7efa94a9d7fbcf6
5
5
  SHA512:
6
- metadata.gz: 9f28b9f392d7a31f577fdd5cc8a9ee3afaedf3aef95db0525768aad3d4dd3505d4719a5ed46ba9483e267c7c57ab9f0730956c6a98ec95c7c8946c6f98d5773d
7
- data.tar.gz: 5c82053e74076b8ab8e159efdd5ee51702a23f6fb37fd422ca29f7c0bb2ec4f23620af53279ea7d1cfbbb9b9b0312686286501fe7e2e2954828db35abd58b1e0
6
+ metadata.gz: b2b69e70efddf07ce8ac3b034a24a4e2d126db2512b79df640e5aa5c9c6bf5d708e8f5d972777ee235ed47b8a28c2122ccc39a2afe2c5d4aef1da8b6a6c5d542
7
+ data.tar.gz: 4229477e5b5d137e5b83c6aeac8083acf1e1e79f5ba11f9d334adefc9d3d2a58d6cb7d55d67e5137c9b5642ed5b29c2ffe3ffbc968cf9a6a1bca712ddc23c6ff
@@ -1,6 +1,10 @@
1
1
  # Lotus::View
2
2
  View layer for Lotus
3
3
 
4
+ ## v0.4.2 - 2015-06-23
5
+ ### Fixed
6
+ - [Tom Kadwill] Ensure views to use methods defined by the associated layout.
7
+
4
8
  ## v0.4.1 - 2015-05-22
5
9
  ### Added
6
10
  - [Luca Guidi] Introduced `#content` to render optional contents in a different context (eg. a view sets a page specific javascript in the application template footer).
@@ -203,8 +203,8 @@ module Lotus
203
203
  def method_missing(m, *args, &blk)
204
204
  if @scope.respond_to?(m)
205
205
  @scope.__send__(m, *args, &blk)
206
- elsif @layout.respond_to?(m)
207
- @layout.__send__(m, *args, &blk)
206
+ elsif layout.respond_to?(m)
207
+ layout.__send__(m, *args, &blk)
208
208
  else
209
209
  super
210
210
  end
@@ -228,6 +228,12 @@ module Lotus
228
228
  opts[:locals].merge!(options.fetch(:locals){ ::Hash.new })
229
229
  end
230
230
  end
231
+
232
+ # @since 0.4.2
233
+ # @api private
234
+ def layout
235
+ @layout || @layout.class.layout.new(@scope, "")
236
+ end
231
237
  end
232
238
  end
233
239
  end
@@ -21,7 +21,7 @@ module Lotus
21
21
  # @api private
22
22
  # @since 0.1.0
23
23
  def initialize(view, locals = {})
24
- @view, @locals = view, locals
24
+ @view, @locals, @layout = view, locals, layout
25
25
  end
26
26
 
27
27
  # Returns an inspect String
@@ -70,6 +70,18 @@ module Lotus
70
70
  end
71
71
  )
72
72
  end
73
+
74
+ private
75
+
76
+ # @since 0.4.2
77
+ # @api private
78
+ def layout
79
+ if @view.class.respond_to?(:layout)
80
+ @view.class.layout.new(self, "")
81
+ else
82
+ nil
83
+ end
84
+ end
73
85
  end
74
86
  end
75
87
  end
@@ -3,6 +3,6 @@ module Lotus
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '0.4.1'.freeze
6
+ VERSION = '0.4.2'.freeze
7
7
  end
8
8
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.required_ruby_version = '>= 2.0.0'
21
21
 
22
22
  spec.add_runtime_dependency 'tilt', '~> 2.0', '>= 2.0.1'
23
- spec.add_runtime_dependency 'lotus-utils', '~> 0.4'
23
+ spec.add_runtime_dependency 'lotus-utils', '~> 0.5'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.5'
26
26
  spec.add_development_dependency 'minitest', '~> 5'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-22 00:00:00.000000000 Z
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.4'
39
+ version: '0.5'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.4'
46
+ version: '0.5'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.4.5
145
+ rubygems_version: 2.4.8
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: View layer for Lotus, with a separation between views and templates