sinatra_more 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -95,14 +95,14 @@ methods should be very familiar to anyone who has used rails view helpers.
95
95
 
96
96
  * <tt>content_for(key, &block)</tt>
97
97
  * Capture a block of content to be rendered at a later time.
98
- * content_for(:head) { ...content... }
98
+ * <tt>content_for(:head) { ...content... }</tt>
99
99
  * Also supports arguments passed to the content block
100
- * content_for(:head) { |param1, param2| ...content... }
100
+ * <tt>content_for(:head) { |param1, param2| ...content... }</tt>
101
101
  * <tt>yield_content(key, *args)</tt>
102
102
  * Render the captured content blocks for a given key.
103
- * yield_content :head
103
+ * <tt>yield_content :head</tt>
104
104
  * Also supports arguments yielded to the content block
105
- * yield_content :head, param1, param2
105
+ * <tt>yield_content :head, param1, param2</tt>
106
106
  * <tt>capture_html(*args, &block)</tt>
107
107
  * Captures the html from a block of template code for erb or haml
108
108
  * <tt>capture_html(&block)</tt> => "...html..."
data/TODO CHANGED
@@ -7,6 +7,15 @@
7
7
  * Become total warden solution (basically just require warden gem installed, do everything else)
8
8
  * Look into removing overlapping methods and simply leverage sinatra_warden
9
9
  * Take advantage of shared strategies: http://github.com/hassox/warden_strategies/tree/master/lib/
10
+ * Check out the following sinatra extensions:
11
+ * http://github.com/emk/sinatra-url-for/
12
+ * http://github.com/wbzyl/sinatra-static-assets
13
+ * http://github.com/hallison/sinatra-mapping/
14
+ * http://github.com/bcarlso/snap/
15
+ * http://github.com/giraffesoft/classy_resources
16
+ * http://github.com/nakajima/capinatra
17
+ * http://github.com/deadprogrammer/spork
18
+ * http://r18n.rubyforge.org/#sinatra
10
19
 
11
20
  = COMPLETED
12
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.8
1
+ 0.3.9
@@ -24,7 +24,7 @@ module SinatraMore
24
24
  # partial 'photo/_item', :object => @photo
25
25
  # partial 'photo/_item', :collection => @photos
26
26
  def partial(template, options={})
27
- options.merge!(:layout => false)
27
+ options.reverse_merge!(:locals => {}, :layout => false)
28
28
  path = template.to_s.split(File::SEPARATOR)
29
29
  object_name = path[-1].to_sym
30
30
  path[-1] = "_#{path[-1]}"
@@ -33,18 +33,16 @@ module SinatraMore
33
33
  if collection = options.delete(:collection)
34
34
  options.delete(:object)
35
35
  counter = 0
36
- collection.inject([]) do |buffer, member|
36
+ collection.collect do |member|
37
37
  counter += 1
38
- options[:locals] ||= {}
39
38
  options[:locals].merge!(object_name => member, "#{object_name}_counter".to_sym => counter)
40
- buffer << render_template(template_path, options)
39
+ render_template(template_path, options.merge(:layout => false))
41
40
  end.join("\n")
42
41
  else
43
42
  if member = options.delete(:object)
44
- options[:locals] ||= {}
45
43
  options[:locals].merge!(object_name => member)
46
44
  end
47
- render_template(template_path, options)
45
+ render_template(template_path, options.merge(:layout => false))
48
46
  end
49
47
  end
50
48
  alias render_partial partial
data/sinatra_more.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.3.8"
8
+ s.version = "0.3.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi"]
12
- s.date = %q{2009-11-09}
12
+ s.date = %q{2009-11-10}
13
13
  s.default_executable = %q{sinatra_gen}
14
14
  s.description = %q{Expands sinatra with standard helpers and tools to allow for complex applications}
15
15
  s.email = %q{nesquena@gmail.com}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-09 00:00:00 -08:00
12
+ date: 2009-11-10 00:00:00 -08:00
13
13
  default_executable: sinatra_gen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency