building-blocks 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/building_blocks/base.rb +10 -4
  3. metadata +18 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.1.0
@@ -73,8 +73,8 @@ module BuildingBlocks
73
73
  # anonymous blocks don't override its definition
74
74
  name = args.first ? args.shift : self.anonymous_block_name
75
75
 
76
- self.define_block_container(name, options, &block) if block_given?
77
- self.render_block name, args, options
76
+ # self.define_block_container(name, options, &block) if block_given?
77
+ self.render_block name, args, options, &block
78
78
  end
79
79
 
80
80
  def queue(*args, &block)
@@ -176,7 +176,7 @@ module BuildingBlocks
176
176
  "block_#{anonymous_block_number}"
177
177
  end
178
178
 
179
- def render_block(name_or_container, args, runtime_options={})
179
+ def render_block(name_or_container, args, runtime_options={}, &block)
180
180
  buffer = ActiveSupport::SafeBuffer.new
181
181
 
182
182
  block_options = {}
@@ -226,7 +226,13 @@ module BuildingBlocks
226
226
  buffer << view.render("#{self.global_options[:templates_folder]}/#{name.to_s}", global_options.merge(block_options).merge(runtime_options))
227
227
  end
228
228
  rescue ActionView::MissingTemplate
229
- # This block does not exist and no partial can be found to satify it
229
+ if block_given
230
+ if block.arity > 1
231
+ buffer << view.capture(*args, &block)
232
+ else
233
+ buffer << view.capture(args.first, &block)
234
+ end
235
+ end
230
236
  end
231
237
  end
232
238
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: building-blocks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 9
10
- version: 0.0.9
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Hunter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-25 00:00:00 -05:00
18
+ date: 2012-01-26 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -76,6 +76,20 @@ dependencies:
76
76
  prerelease: false
77
77
  type: :development
78
78
  requirement: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: jeweler
81
+ version_requirements: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ prerelease: false
91
+ type: :development
92
+ requirement: *id005
79
93
  description: ""
80
94
  email: hunterae@gmail.com
81
95
  executables: []