middleman-cells 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/cells.feature +3 -0
- data/fixtures/view-helpers-app/data/metadata.yml +1 -0
- data/fixtures/view-helpers-app/source/app_shortcuts.html.erb +1 -0
- data/fixtures/view-helpers-app/source/cells/shortcut/show.erb +2 -0
- data/fixtures/view-helpers-app/source/cells/shortcut_cell.rb +5 -0
- data/lib/middleman-cells/extension.rb +7 -0
- data/lib/middleman-cells/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95d219efbd995f336e3c65d89265f8003f16c718
|
4
|
+
data.tar.gz: f6711fe44a1edf5a6e8bc073d825da218681ab1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d22340e5c8d18246918714a214b02c29d526bc2cbe747f70b20c00367c28b9975166e9045aed1506e9ea5434d2454d3fdf7eec3547f0db8a52e4d347c3017ea
|
7
|
+
data.tar.gz: 65ed57d90ee65d93a0a9e2428a56474f108d497ebc32f57966883428dcc460d1d587f8b283de467b97cd604794351b7f284aa6c71c6be0fdc27407c3cef4543c
|
data/features/cells.feature
CHANGED
@@ -45,6 +45,9 @@ Feature: Cells support for Middleman
|
|
45
45
|
<p>This is a parent.</p>
|
46
46
|
<p>This is a child.</p>
|
47
47
|
"""
|
48
|
+
When I go to "/app_shortcuts.html"
|
49
|
+
Then I should see "Awesome Site"
|
50
|
+
Then I should see "Middleman::Cells::Extension"
|
48
51
|
|
49
52
|
Scenario: Hamlit support
|
50
53
|
Given the Server is running at "hamlit-app"
|
@@ -0,0 +1 @@
|
|
1
|
+
site_name: Awesome Site
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= ShortcutCell.().() %>
|
@@ -35,6 +35,7 @@ module Middleman
|
|
35
35
|
def after_configuration
|
36
36
|
cells_dir = File.join(app.root, app.config[:source], options.cells_dir)
|
37
37
|
helper_modules = app.template_context_class.included_modules
|
38
|
+
app_proxy = app
|
38
39
|
|
39
40
|
# Extending Cell::ViewModel to adapt Middleman
|
40
41
|
::Cell::ViewModel.class_eval do
|
@@ -46,6 +47,12 @@ module Middleman
|
|
46
47
|
|
47
48
|
# Include view helpers
|
48
49
|
helper_modules.each {|helper| include helper }
|
50
|
+
|
51
|
+
# Shortcut to global values on the app instance
|
52
|
+
globals = %i[config logger sitemap server? build? environment? data extensions root]
|
53
|
+
globals.each do |name|
|
54
|
+
define_method(name) { app_proxy.send(name) }
|
55
|
+
end
|
49
56
|
end
|
50
57
|
|
51
58
|
if options.autoload
|
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.3
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -101,10 +101,14 @@ files:
|
|
101
101
|
- fixtures/slim-app/source/cells/slim_cell.rb
|
102
102
|
- fixtures/slim-app/source/index.html.erb
|
103
103
|
- fixtures/view-helpers-app/config.rb
|
104
|
+
- fixtures/view-helpers-app/data/metadata.yml
|
105
|
+
- fixtures/view-helpers-app/source/app_shortcuts.html.erb
|
104
106
|
- fixtures/view-helpers-app/source/cells/child/show.erb
|
105
107
|
- fixtures/view-helpers-app/source/cells/child_cell.rb
|
106
108
|
- fixtures/view-helpers-app/source/cells/parent/show.erb
|
107
109
|
- fixtures/view-helpers-app/source/cells/parent_cell.rb
|
110
|
+
- fixtures/view-helpers-app/source/cells/shortcut/show.erb
|
111
|
+
- fixtures/view-helpers-app/source/cells/shortcut_cell.rb
|
108
112
|
- fixtures/view-helpers-app/source/cells/view_helpers/show.erb
|
109
113
|
- fixtures/view-helpers-app/source/cells/view_helpers_cell.rb
|
110
114
|
- fixtures/view-helpers-app/source/index.html.erb
|