pinkman 0.9.9 → 0.9.9.1
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/app/helpers/pinkman_helper.rb +22 -2
- data/lib/pinkman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8594d71908248b387d76ae776ee2645a0260a5a8
|
|
4
|
+
data.tar.gz: fda03fd83b397414f49792eff5936d119c31359c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c135c46bf27d68423c2515ef4134ddecfb34583d47a0c80f662f0e87110b0020756a8067432540353b3a943fe339c8f9ec928e56262983b3ff83fc712d216a82
|
|
7
|
+
data.tar.gz: 98f3eeee9cb5e77389c6e6cc7006aa0a165c928f68ef9b4d0a7aee2274b04c899f837fa2faa40fe9140fbb32a532d94f3a4860355acbee5c67f1ac84a01946fa
|
|
@@ -13,8 +13,28 @@ module PinkmanHelper
|
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def template path
|
|
17
|
-
|
|
16
|
+
def template path, &block
|
|
17
|
+
# definition mode
|
|
18
|
+
if block_given?
|
|
19
|
+
name = path.to_s
|
|
20
|
+
id = (/(?:-template)$/ =~ name) ? name : (name +'-template')
|
|
21
|
+
content_tag('script',{id: id, type: 'text/p-template'}, &block)
|
|
22
|
+
# rendering template partial mode
|
|
23
|
+
else
|
|
24
|
+
render partial: "pinkman/#{path}"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def load_templates
|
|
29
|
+
if Rails
|
|
30
|
+
dir = Rails.root.join('app','views','pinkman')
|
|
31
|
+
files = Dir.glob(dir.join('**/_*')).map do |f|
|
|
32
|
+
f.sub(Regexp.new("#{dir.to_s}(?:[\\\/])"),'').sub(/_/,'')
|
|
33
|
+
end
|
|
34
|
+
raw(files.map{|f| template(f)}.join("\n"))
|
|
35
|
+
else
|
|
36
|
+
raise 'Rails application not found.'
|
|
37
|
+
end
|
|
18
38
|
end
|
|
19
39
|
|
|
20
40
|
def wrap_in tag, &block
|
data/lib/pinkman/version.rb
CHANGED