sinatra_more 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -3,8 +3,8 @@
3
3
  == Introduction
4
4
 
5
5
  Note: This library is still experimental and may not be ready for production just yet.
6
- That being said, work is being put into reaching solid test coverage and the gem is being actively used
7
- on a number of sinatra projects. This notice will be removed once sufficient testing has been done.
6
+ That being said the gem is being actively used on a number of sinatra projects.
7
+ In addition, the gem has fairly solid test coverage ensuring that everything works as expected.
8
8
 
9
9
  This will be a plugin which expands sinatra's capabilities in a variety of ways.
10
10
  Note that as much as possible, all helpers have been created to work with haml, erb, and erubis.
@@ -290,7 +290,7 @@ provided to make interacting with warden dead simple.
290
290
 
291
291
  == Known Issues
292
292
 
293
- * Tag helper methods that accept blocks work unreliably in ERB.
293
+ * No serious issues known
294
294
 
295
295
  == Note on Patches/Pull Requests
296
296
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -56,7 +56,7 @@ module SinatraMore
56
56
  # NOTE: This doesn't actually work yet because the variable __in_erb_template
57
57
  # hasn't been defined in ERB. We need to find a way to fix this.
58
58
  def block_is_erb?(block)
59
- block && eval('defined? __in_erb_template', block)
59
+ has_erb_buffer? || block && eval('defined? __in_erb_template', block)
60
60
  end
61
61
 
62
62
  # Used to direct the buffer for the erb capture
data/sinatra_more.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
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"]
@@ -37,11 +37,7 @@ class MarkupDemo < Sinatra::Base
37
37
  end
38
38
 
39
39
  def determine_block_is_template(name, &block)
40
- if block_given?
41
- concat_content "<p class='is_template'>The #{name} block passed in is a template</p>" if block_is_template?(block)
42
- else
43
- concat_content "<p class='is_template'>The #{name} block passed in is a template</p>" if block_is_template?(block)
44
- end
40
+ concat_content "<p class='is_template'>The #{name} block passed in is a template</p>" if block_is_template?(block)
45
41
  end
46
42
  end
47
43
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% concat_in_p('Concat Line 3') %>
8
8
 
9
- <% determine_block_is_template('haml') do %>
9
+ <% determine_block_is_template('erb') do %>
10
10
  <span>This is erb</span>
11
11
  <span>This is erb</span>
12
12
  <% end %>
@@ -42,8 +42,7 @@ class TestAssetTagHelpers < Test::Unit::TestCase
42
42
  should "display link block element in erb" do
43
43
  visit '/erb/link_to'
44
44
  assert_have_selector :a, :content => "Test 1 No Block", :href => '/test1', :class => 'test', :id => 'test1'
45
- #TODO fix this selector below in erb
46
- # assert_have_selector :a, :content => "Test 2 With Block", :href => '/test2', :class => 'test', :id => 'test2'
45
+ assert_have_selector :a, :content => "Test 2 With Block", :href => '/test2', :class => 'test', :id => 'test2'
47
46
  end
48
47
  end
49
48
 
@@ -35,9 +35,9 @@ class TestOutputHelpers < Test::Unit::TestCase
35
35
  context 'for #block_is_template?' do
36
36
  should "work for erb templates" do
37
37
  visit '/erb/capture_concat'
38
- # TODO Get ERB template detection working
39
- # assert_have_selector 'p', :content => "The erb block passed in is a template", :class => 'is_template'
40
- assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
38
+ assert_have_selector 'p', :content => "The erb block passed in is a template", :class => 'is_template'
39
+ # TODO Get ERB template detection working (fix block_is_erb? method)
40
+ # assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
41
41
  end
42
42
 
43
43
  should "work for haml templates" do
@@ -36,9 +36,8 @@ class TestTagHelpers < Test::Unit::TestCase
36
36
  visit '/erb/content_tag'
37
37
  assert_have_selector :p, :content => "Test 1", :class => 'test', :id => 'test1'
38
38
  assert_have_selector :p, :content => "Test 2"
39
- # TODO get these to work in erb
40
- # assert_have_selector :p, :content => "Test 3"
41
- # assert_have_selector :p, :content => "Test 4"
39
+ assert_have_selector :p, :content => "Test 3"
40
+ assert_have_selector :p, :content => "Test 4"
42
41
  end
43
42
  should "support tags with haml" do
44
43
  visit '/haml/content_tag'
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.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi