kelredd-sinatra-helpers 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
17
17
  s.files = %w(README.rdoc Rakefile) + Dir.glob("{bin,lib}/**/*")
18
18
  s.executables = ['sinatra']
19
19
 
20
- s.add_dependency('kelredd-useful', '>= 0.2.0')
20
+ s.add_dependency('kelredd-useful', '>= 0.2.3')
21
21
  end
22
22
 
23
23
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -22,12 +22,13 @@ module SinatraHelpers::Erb::Partials
22
22
  raise 'partial collection specified but is nil' if options.has_key?(:collection) && options[:collection].nil?
23
23
  if collection = options.delete(:collection)
24
24
  options.delete(:object) # ignore any object passed in when using :collection
25
+ options[:locals] ||= {}
25
26
  counter = 0
26
27
  collection.inject([]) do |buffer, member|
27
28
  counter += 1
28
- options[:locals] ||= {}
29
- options[:locals].merge!({object => member, "#{object}_counter".to_sym => counter})
30
- buffer << erb(template, options)
29
+ erb_opts = options.dup
30
+ erb_opts[:locals].merge!({object => member, "#{object}_counter".to_sym => counter})
31
+ buffer << erb(template, erb_opts)
31
32
  end.join("\n")
32
33
  else
33
34
  if member = options.delete(:object)
@@ -3,7 +3,7 @@ module SinatraHelpers
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 2
6
+ TINY = 3
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-sinatra-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-11 00:00:00 -06:00
12
+ date: 2009-11-22 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.2.0
23
+ version: 0.2.3
24
24
  version:
25
25
  description:
26
26
  email: kelly@kelredd.com