darkhelmet-darkext 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +4 -0
  2. data/VERSION.yml +1 -1
  3. data/lib/darkext/sinatra.rb +13 -3
  4. metadata +1 -1
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.8.6 2009-2-25
2
+
3
+ * better partials
4
+
1
5
  == 0.8.5 2009-2-25
2
6
 
3
7
  * enable(:sessions) for sinatra stuff since flash needs it
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 8
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 0
@@ -9,9 +9,19 @@ module Sinatra
9
9
  html
10
10
  end
11
11
 
12
- def partial(page, options = {})
13
- # Can't make this use view() because of the flash.clear
14
- haml(page, options.merge!(:layout => false))
12
+ def partial(template, options = {})
13
+ options = args.extract_options!
14
+ options.merge!(:layout => false)
15
+ if collection = options.delete(:collection) then
16
+ collection.inject([]) do |buffer, member|
17
+ buffer << haml(template, options.merge(:layout => false,
18
+ :locals => {template.to_sym => member}))
19
+ end.join("\n")
20
+ else
21
+ haml(template, options)
22
+ end
23
+ end
24
+
15
25
  end
16
26
 
17
27
  def css_link_tag(sheet, media = 'screen,projection')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkhelmet-darkext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Huckstep