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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12d3fc2c4ed542d7588828ef2d6aa0433fbe9adb
4
- data.tar.gz: 353a9ee96194b3abe151d8d41efe684bd613fb8d
3
+ metadata.gz: 7a476b694b3056e1053b60f8c40ecc9030602fab
4
+ data.tar.gz: 443f9020b3a405ac773147f3afdbc4e0d22ebbcf
5
5
  SHA512:
6
- metadata.gz: 89ded3c915da84bb3fc2b44553cdb2d98695d5f38161dbd83bcbb85addd52ca41c8ad82466a0e3b4b3c0822b6b2464334fb3c26ee7a015236285db4614113a2f
7
- data.tar.gz: 0fda90975aad1e26554091d7f7529b01fddd3f05b09a1c030405c08cc925591e4966c3974b9442298310ee3bba7875e2d81a5e6935e719e24c71c4e89bc9dd70
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?
@@ -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
- def _view_name
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
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Cells
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
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.2
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-04 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler