middleman-cells 0.0.1 → 0.0.2
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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +2 -0
- data/features/cells.feature +14 -0
- data/fixtures/view-helpers-app/config.rb +3 -0
- data/fixtures/view-helpers-app/source/cells/child/show.erb +1 -0
- data/fixtures/view-helpers-app/source/cells/child_cell.rb +5 -0
- data/fixtures/view-helpers-app/source/cells/parent/show.erb +2 -0
- data/fixtures/view-helpers-app/source/cells/parent_cell.rb +5 -0
- data/fixtures/view-helpers-app/source/cells/view_helpers/show.erb +1 -0
- data/fixtures/view-helpers-app/source/cells/view_helpers_cell.rb +5 -0
- data/fixtures/view-helpers-app/source/index.html.erb +1 -0
- data/fixtures/view-helpers-app/source/render_nested_cells.html.erb +1 -0
- data/lib/middleman-cells/extension.rb +12 -1
- data/lib/middleman-cells/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d51fb07d45d15db2b79f75900a857ddd7e724e01
|
4
|
+
data.tar.gz: 4764a1450a1a749ed23e8b176a03a176f1622384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dae900683f8c35408070b2bfed4ef96147b608ae9097e026c18b4595619b5c6aae14c8bfcd082cee6ec8a946e8e972b48eeda64b74b69664fe91cbbb357eb60
|
7
|
+
data.tar.gz: 0a0ddcb4323ca1c0c408f357e74b66aaa96c938470a8eab20af044ab3369c6c88f4eb513bf536d2e1cd78538ec2f6868c4aaaee65b93b1cfea63002253df3216
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
data/features/cells.feature
CHANGED
@@ -32,6 +32,20 @@ Feature: Cells support for Middleman
|
|
32
32
|
When I go to "/index.html"
|
33
33
|
Then I should see "After"
|
34
34
|
|
35
|
+
Scenario: View helpers
|
36
|
+
Given the Server is running at "view-helpers-app"
|
37
|
+
When I go to "/index.html"
|
38
|
+
Then I should see:
|
39
|
+
"""
|
40
|
+
<a href="https://twitter.com/notozeki">Follow me</a>
|
41
|
+
"""
|
42
|
+
When I go to "/render_nested_cells.html"
|
43
|
+
Then I should see:
|
44
|
+
"""
|
45
|
+
<p>This is a parent.</p>
|
46
|
+
<p>This is a child.</p>
|
47
|
+
"""
|
48
|
+
|
35
49
|
Scenario: Hamlit support
|
36
50
|
Given the Server is running at "hamlit-app"
|
37
51
|
When I go to "/index.html"
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>This is a child.</p>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= link_to 'Follow me', 'https://twitter.com/notozeki' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= ViewHelpersCell.().() %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= ParentCell.().() %>
|
@@ -34,8 +34,19 @@ module Middleman
|
|
34
34
|
|
35
35
|
def after_configuration
|
36
36
|
cells_dir = File.join(app.root, app.config[:source], options.cells_dir)
|
37
|
+
helper_modules = app.template_context_class.included_modules
|
37
38
|
|
38
|
-
|
39
|
+
# Extending Cell::ViewModel to adapt Middleman
|
40
|
+
::Cell::ViewModel.class_eval do
|
41
|
+
self.view_paths << cells_dir
|
42
|
+
|
43
|
+
# Required for Padrino's helpers
|
44
|
+
def current_engine
|
45
|
+
end
|
46
|
+
|
47
|
+
# Include view helpers
|
48
|
+
helper_modules.each {|helper| include helper }
|
49
|
+
end
|
39
50
|
|
40
51
|
if options.autoload
|
41
52
|
require 'active_support/dependencies'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- notozeki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -100,6 +100,15 @@ files:
|
|
100
100
|
- fixtures/slim-app/source/cells/slim/show.slim
|
101
101
|
- fixtures/slim-app/source/cells/slim_cell.rb
|
102
102
|
- fixtures/slim-app/source/index.html.erb
|
103
|
+
- fixtures/view-helpers-app/config.rb
|
104
|
+
- fixtures/view-helpers-app/source/cells/child/show.erb
|
105
|
+
- fixtures/view-helpers-app/source/cells/child_cell.rb
|
106
|
+
- fixtures/view-helpers-app/source/cells/parent/show.erb
|
107
|
+
- fixtures/view-helpers-app/source/cells/parent_cell.rb
|
108
|
+
- fixtures/view-helpers-app/source/cells/view_helpers/show.erb
|
109
|
+
- fixtures/view-helpers-app/source/cells/view_helpers_cell.rb
|
110
|
+
- fixtures/view-helpers-app/source/index.html.erb
|
111
|
+
- fixtures/view-helpers-app/source/render_nested_cells.html.erb
|
103
112
|
- lib/middleman-cells.rb
|
104
113
|
- lib/middleman-cells/extension.rb
|
105
114
|
- lib/middleman-cells/version.rb
|