blockpile 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/blockpile.gemspec +2 -2
- data/lib/blockpile/base.rb +1 -15
- data/lib/blockpile/setup.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/blockpile.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{blockpile}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tyler Flint"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-06}
|
13
13
|
s.description = %q{This module attempts to create structured view helpers. Essentially, a blockpile consists of a ruby class file, and a template. This allows for isolated blocks of view logic, that can maintain a clean separation of markup language from ruby code. Blocks can be inherited from to DRY up view logic.}
|
14
14
|
s.email = %q{tylerflint@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/blockpile/base.rb
CHANGED
@@ -22,21 +22,7 @@ protected
|
|
22
22
|
|
23
23
|
# Assumes /views/helper/ as base
|
24
24
|
def render_template
|
25
|
-
render(
|
26
|
-
end
|
27
|
-
|
28
|
-
def get_template
|
29
|
-
get_paths.each do |path|
|
30
|
-
if File::exists?( path + "/" + @template + ".html.erb")
|
31
|
-
return path + "/" + @template
|
32
|
-
puts path + "/" + @template
|
33
|
-
end
|
34
|
-
end
|
35
|
-
raise "Unable to find template for this blockpile"
|
36
|
-
end
|
37
|
-
|
38
|
-
def get_paths
|
39
|
-
Blockpile::Paths.get_paths
|
25
|
+
@rendered_template ||= render(:partial => @template, :locals => {:pile => self, :p => self})
|
40
26
|
end
|
41
27
|
|
42
28
|
def method_missing(*args, &block)
|
data/lib/blockpile/setup.rb
CHANGED
@@ -8,7 +8,7 @@ module Blockpile
|
|
8
8
|
pile_methods = %{
|
9
9
|
def #{file_name.gsub(/\_pile/, '')}(*args, &block)
|
10
10
|
blockpile = #{class_name}.new(self, *args, &block)
|
11
|
-
|
11
|
+
blockpile.to_html
|
12
12
|
end
|
13
13
|
|
14
14
|
def #{file_name.gsub(/\_pile/, '')}_instance(*args, &block)
|
@@ -16,7 +16,7 @@ module Blockpile
|
|
16
16
|
end
|
17
17
|
}
|
18
18
|
ActionView::Base.class_eval pile_methods
|
19
|
-
ActionController::Base.class_eval
|
19
|
+
ActionController::Base.class_eval %{delegate :#{file_name.gsub(/\_pile/, '')}, :#{file_name.gsub(/\_pile/, '')}_instance,:to => :view_context}
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 1
|
9
|
+
version: 0.5.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tyler Flint
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-06 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|