simple_show 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -1
- data/app/helpers/simple_show/application_helper.rb +1 -1
- data/lib/simple_show/version.rb +1 -1
- data/simple_show.gemspec +2 -2
- data/test/test_simple_show_for.rb +4 -4
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
== Description:
|
6
6
|
|
7
|
-
SimpleShow is to #show as SimpleForm is to #
|
7
|
+
SimpleShow is to #show as SimpleForm is to #edit.
|
8
8
|
|
9
9
|
== Requirements:
|
10
10
|
|
@@ -83,6 +83,8 @@ if you don't want that BR tag then set SimpleShow.clear_on_close to false.
|
|
83
83
|
|
84
84
|
- Add support for associations.
|
85
85
|
- Add options for formatting and booleans.
|
86
|
+
- Add option :if/:unless => :method_sym so we can say things like "s.show...
|
87
|
+
:unless => :blank?" to hide the field entirely.
|
86
88
|
|
87
89
|
== License:
|
88
90
|
|
@@ -8,7 +8,7 @@ module SimpleShow
|
|
8
8
|
options[:html][:class] = "#{SimpleShow.show_class} #{dom_class(record)} #{options[:html][:class]}".strip
|
9
9
|
|
10
10
|
output = capture(SimpleShow::Base.new(self, record, options), &block)
|
11
|
-
output.concat
|
11
|
+
output.concat content_tag(:div, '', :class => 'clear') if SimpleShow.clear_on_close
|
12
12
|
|
13
13
|
content_tag(:div, output, :id => options[:html][:id], :class => options[:html][:class])
|
14
14
|
end
|
data/lib/simple_show/version.rb
CHANGED
data/simple_show.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Philip Hallstrom"]
|
10
10
|
s.email = ["philip@pjkh.com"]
|
11
11
|
s.homepage = ""
|
12
|
-
s.summary = %q{SimpleShow is #
|
13
|
-
s.description = %q{SimpleShow is #
|
12
|
+
s.summary = %q{SimpleShow is to #show what SimpleForm is to #edit}
|
13
|
+
s.description = %q{SimpleShow is to #show what SimpleForm is to #edit}
|
14
14
|
|
15
15
|
s.rubyforge_project = "simple_show"
|
16
16
|
|
@@ -23,17 +23,17 @@ class SimpleShowForTest < SimpleShowTestCase
|
|
23
23
|
''
|
24
24
|
end)
|
25
25
|
SimpleShow::clear_on_close = clear_on_close
|
26
|
-
assert_equal '
|
27
|
-
assert_equal '
|
26
|
+
assert_equal 'div', doc.at('div').elements.last.name
|
27
|
+
assert_equal 'clear', doc.at('div').elements.last.attr('class')
|
28
28
|
end
|
29
29
|
|
30
|
-
test 'last tag is not a
|
30
|
+
test 'last tag is not a div/clear when disabled' do
|
31
31
|
clear_on_close = SimpleShow::clear_on_close
|
32
32
|
SimpleShow::clear_on_close = false
|
33
33
|
doc = Nokogiri::HTML.fragment(simple_show_for @philip do |s|
|
34
34
|
''
|
35
35
|
end)
|
36
|
-
assert_not_equal '
|
36
|
+
assert_not_equal 'clear', doc.at('div').elements.last.try(:attr, 'class')
|
37
37
|
SimpleShow::clear_on_close = clear_on_close
|
38
38
|
end
|
39
39
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_show
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Philip Hallstrom
|
@@ -19,7 +19,7 @@ date: 2011-08-01 00:00:00 -07:00
|
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
22
|
-
description: "SimpleShow is #
|
22
|
+
description: "SimpleShow is to #show what SimpleForm is to #edit"
|
23
23
|
email:
|
24
24
|
- philip@pjkh.com
|
25
25
|
executables: []
|
@@ -81,7 +81,7 @@ rubyforge_project: simple_show
|
|
81
81
|
rubygems_version: 1.4.2
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
|
-
summary: "SimpleShow is #
|
84
|
+
summary: "SimpleShow is to #show what SimpleForm is to #edit"
|
85
85
|
test_files:
|
86
86
|
- test/test_helper.rb
|
87
87
|
- test/test_simple_show.rb
|