trailblazer-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/CHANGES.md +4 -0
- data/lib/trailblazer/cell.rb +21 -4
- data/lib/trailblazer/cells/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a476b694b3056e1053b60f8c40ecc9030602fab
|
4
|
+
data.tar.gz: 443f9020b3a405ac773147f3afdbc4e0d22ebbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b70ddbe3791cd4ca77bbed819af99068b86d4c22d6688a353366cef2c79bf85d05e76c51dfff84b95ab1ad0727815a1c077f2778c75723e7f5d24b305478cd8
|
7
|
+
data.tar.gz: a3d8a2def7fce59cd96619d78592fbd650733bb78c2bb9da2edfd49637a7d16c469db06b2e2ef42f6863ca2b94628bb01089c3b974afb01310bf09c0bd2ac25b
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 0.0.3
|
2
|
+
|
3
|
+
* Introduce `Cell::ViewName::Flat` and `Cell::ViewName::Path`. Note that with a segmented cell suffix, such as in `Comment::Cell::Theme::Sidebar`, this will, per default result in a view name `theme/sidebar.haml` in the cell's `view` directory. Use `ViewName::Flat` for the old behavior (`sidebar.haml`).
|
4
|
+
|
1
5
|
# 0.0.2
|
2
6
|
|
3
7
|
* Stable release for Cells 4.1. We probably move the view name inflector into Cells itself?
|
data/lib/trailblazer/cell.rb
CHANGED
@@ -5,6 +5,26 @@ module Trailblazer
|
|
5
5
|
abstract!
|
6
6
|
self.view_paths = ["app/concepts"]
|
7
7
|
|
8
|
+
module ViewName
|
9
|
+
# View name is everything behind the last `Cell::`.
|
10
|
+
# Comment::Cell::Theme::Sidebar => "theme/sidebar.haml"
|
11
|
+
module Path
|
12
|
+
def _view_name
|
13
|
+
class_path = to_s.split("Cell::").last # E.g. Theme::SideBar
|
14
|
+
util.underscore(class_path).downcase
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# View name is last segment, resulting in flat view hierarchy.
|
19
|
+
# Comment::Cell::Theme::Sidebar => "sidebar.haml"
|
20
|
+
module Flat
|
21
|
+
def _view_name
|
22
|
+
class_name = to_s.split("::").last
|
23
|
+
util.underscore(class_name).downcase
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
8
28
|
# TODO: this should be in Helper or something. this should be the only entry point from controller/view.
|
9
29
|
class << self
|
10
30
|
def class_from_cell_name(name)
|
@@ -24,10 +44,7 @@ module Trailblazer
|
|
24
44
|
@view_name ||= _view_name
|
25
45
|
end
|
26
46
|
|
27
|
-
|
28
|
-
class_name = to_s.split("::").last
|
29
|
-
util.underscore(class_name).downcase
|
30
|
-
end
|
47
|
+
include ViewName::Path
|
31
48
|
end
|
32
49
|
|
33
50
|
# Comment::Cell::Show #=> show
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-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
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|