rubyhtmlapp 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/rubyhtmlapp/helpers.rb +4 -4
- data/lib/rubyhtmlapp/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: d7c7b1e73ca1e3257928028192f45f4fcfeff433
|
4
|
+
data.tar.gz: 18c856b58081d421e5c289a36edd2d5026ab1120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 150f2ba84b699a081ae6e8bd43af602556517cbfde9eec174b1a29e70db96437fd7d1b933132feaea621fddc62982d57542ec054c8988d8186001d2718c707ab
|
7
|
+
data.tar.gz: a8cd7bbf1158f60ee2cb50ab3e9ba055a4d8ed483f9b2863ca3e991097cc580a331fb08f2e50e269ecaf784147e3de2b5145d9f680feb491eabc73ad2ddd99a3
|
data/.gitignore
CHANGED
data/lib/rubyhtmlapp/helpers.rb
CHANGED
@@ -5,12 +5,12 @@ require 'find'
|
|
5
5
|
module RubyHtmlApp
|
6
6
|
module Helpers
|
7
7
|
def render(partial, locals={}, &block)
|
8
|
-
Tilt.new(find_f(@partial_path,
|
8
|
+
Tilt.new(find_f(@partial_path, /_#{partial}.html[a-z\.0-9]*$/i)).render(self, locals, &block)
|
9
9
|
end
|
10
10
|
|
11
11
|
def include_dir(dir, locals={}, &block)
|
12
12
|
html = ""
|
13
|
-
find_f_each(File.join(@partial_path, dir),
|
13
|
+
find_f_each(File.join(@partial_path, dir), /[0-9a-z]{1}\.html[a-z\.0-9]*$/i) do |f|
|
14
14
|
html.concat(Tilt.new(f).render(self, locals, &block))
|
15
15
|
end
|
16
16
|
return html
|
@@ -23,14 +23,14 @@ module RubyHtmlApp
|
|
23
23
|
|
24
24
|
def find_f(path, pattern)
|
25
25
|
Find.find(path) do |f|
|
26
|
-
return f if File.
|
26
|
+
return f if File.basename(f).match(pattern)
|
27
27
|
end
|
28
28
|
nil
|
29
29
|
end
|
30
30
|
|
31
31
|
def find_f_each(path, pattern)
|
32
32
|
Find.find(path) do |f|
|
33
|
-
yield(f) if File.
|
33
|
+
yield(f) if File.basename(f).match(pattern)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
data/lib/rubyhtmlapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyhtmlapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Curtis Bissonnette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|