any_view 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +10 -9
- data/Gemfile.lock +33 -49
- data/any_view-0.2.2.gem +0 -0
- data/any_view.gemspec +1 -1
- data/lib/any_view/form_helpers.rb +1 -1
- data/test/test_form_helpers.rb +5 -0
- metadata +9 -27
data/Gemfile
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
# A sample Gemfile
|
2
1
|
source :rubygems
|
3
|
-
|
4
|
-
gem 'tilt', '>=
|
5
|
-
gem 'ruby-debug'
|
2
|
+
|
3
|
+
gem 'tilt', '>=1'
|
6
4
|
|
7
5
|
group(:test) do
|
8
|
-
gem '
|
6
|
+
gem 'haml', '~>3.0'
|
7
|
+
gem 'mocha', '~>0.9'
|
8
|
+
gem 'rack-test', '~>0.5'
|
9
|
+
gem 'webrat', '~>0.5'
|
9
10
|
gem 'shoulda'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
|
12
|
+
if RUBY_VERSION < '1.9'
|
13
|
+
gem 'ruby-debug'
|
14
|
+
end
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,65 +1,49 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
version: ">= 0"
|
7
|
-
rake:
|
8
|
-
group:
|
9
|
-
- :test
|
10
|
-
version: ">= 0"
|
11
|
-
haml:
|
12
|
-
group:
|
13
|
-
- :test
|
14
|
-
version: ">= 0"
|
15
|
-
shoulda:
|
16
|
-
group:
|
17
|
-
- :test
|
18
|
-
version: ">= 0"
|
19
|
-
webrat:
|
20
|
-
group:
|
21
|
-
- :test
|
22
|
-
version: ">= 0.5.1"
|
23
|
-
mocha:
|
24
|
-
group:
|
25
|
-
- :test
|
26
|
-
version: ">= 0"
|
27
|
-
rack-test:
|
28
|
-
group:
|
29
|
-
- :test
|
30
|
-
version: ">= 0.5.0"
|
31
|
-
tilt:
|
32
|
-
group:
|
33
|
-
- :default
|
34
|
-
version: ">= 0.10"
|
2
|
+
hash: 38900315740c8f66e1de6fa1185a82964c504577
|
3
|
+
sources:
|
4
|
+
- Rubygems:
|
5
|
+
uri: http://gemcutter.org
|
35
6
|
specs:
|
36
7
|
- rake:
|
37
8
|
version: 0.8.7
|
38
|
-
- columnize:
|
39
|
-
version: 0.3.1
|
40
9
|
- haml:
|
41
|
-
version: 3.0.
|
42
|
-
- linecache:
|
43
|
-
version: "0.43"
|
10
|
+
version: 3.0.12
|
44
11
|
- mocha:
|
45
12
|
version: 0.9.8
|
46
13
|
- nokogiri:
|
47
14
|
version: 1.4.2
|
48
15
|
- rack:
|
49
|
-
version: 1.1
|
16
|
+
version: 1.2.1
|
50
17
|
- rack-test:
|
51
18
|
version: 0.5.4
|
52
|
-
- ruby-debug-base:
|
53
|
-
version: 0.10.3
|
54
|
-
- ruby-debug:
|
55
|
-
version: 0.10.3
|
56
19
|
- shoulda:
|
57
|
-
version: 2.
|
20
|
+
version: 2.11.0
|
58
21
|
- tilt:
|
59
|
-
version:
|
22
|
+
version: 1.0.1
|
60
23
|
- webrat:
|
61
24
|
version: 0.7.1
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
25
|
+
dependencies:
|
26
|
+
tilt:
|
27
|
+
version: ">= 1"
|
28
|
+
group:
|
29
|
+
- :default
|
30
|
+
haml:
|
31
|
+
version: ~> 3.0
|
32
|
+
group:
|
33
|
+
- :test
|
34
|
+
mocha:
|
35
|
+
version: ~> 0.9
|
36
|
+
group:
|
37
|
+
- :test
|
38
|
+
rack-test:
|
39
|
+
version: ~> 0.5
|
40
|
+
group:
|
41
|
+
- :test
|
42
|
+
webrat:
|
43
|
+
version: ~> 0.5
|
44
|
+
group:
|
45
|
+
- :test
|
46
|
+
shoulda:
|
47
|
+
version: ">= 0"
|
48
|
+
group:
|
49
|
+
- :test
|
data/any_view-0.2.2.gem
ADDED
Binary file
|
data/any_view.gemspec
CHANGED
@@ -176,7 +176,7 @@ module AnyView
|
|
176
176
|
|
177
177
|
# Returns the options tags for a select based on the given option items
|
178
178
|
def options_for_select(option_items, selected_value=nil)
|
179
|
-
return
|
179
|
+
return [] if option_items.blank?
|
180
180
|
option_items.collect do |caption, value|
|
181
181
|
value ||= caption
|
182
182
|
content_tag(:option, caption, :value => value, :selected => selected_value.to_s =~ /#{value}|#{caption}/)
|
data/test/test_form_helpers.rb
CHANGED
@@ -390,6 +390,11 @@ class TestFormHelpers < Test::Unit::TestCase
|
|
390
390
|
assert_has_selector('select option', :content => 'orange', :value => '2', :selected => 'selected'){result}
|
391
391
|
assert_has_selector('select option', :content => 'purple', :value => '3'){result}
|
392
392
|
end
|
393
|
+
|
394
|
+
should "handle empty collections" do
|
395
|
+
actual_html = view_context.select_tag(:empty, :collection => [], :fields => [:foo, :bar])
|
396
|
+
assert_has_tag(:select, :name => 'empty') { actual_html }
|
397
|
+
end
|
393
398
|
end
|
394
399
|
|
395
400
|
context 'for #submit_tag method' do
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: any_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 19
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Daniel Neighman
|
@@ -15,38 +14,22 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-06-16 00:00:00 +10:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
21
|
+
name: tilt
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
27
|
segments:
|
29
|
-
-
|
30
|
-
version: "
|
31
|
-
name: ruby-debug
|
32
|
-
requirement: *id001
|
33
|
-
prerelease: false
|
28
|
+
- 1
|
29
|
+
version: "1"
|
34
30
|
type: :runtime
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
hash: 31
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
- 10
|
45
|
-
version: "0.10"
|
46
|
-
name: tilt
|
47
|
-
requirement: *id002
|
48
31
|
prerelease: false
|
49
|
-
|
32
|
+
version_requirements: *id001
|
50
33
|
description: View helpers with an absolute minimum of requirements
|
51
34
|
email: has.sox@gmail.com
|
52
35
|
executables: []
|
@@ -57,6 +40,7 @@ extra_rdoc_files: []
|
|
57
40
|
|
58
41
|
files:
|
59
42
|
- ./any_view-0.2.1.gem
|
43
|
+
- ./any_view-0.2.2.gem
|
60
44
|
- ./any_view.gemspec
|
61
45
|
- ./Gemfile
|
62
46
|
- ./Gemfile.lock
|
@@ -124,7 +108,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
108
|
requirements:
|
125
109
|
- - ">="
|
126
110
|
- !ruby/object:Gem::Version
|
127
|
-
hash: 3
|
128
111
|
segments:
|
129
112
|
- 0
|
130
113
|
version: "0"
|
@@ -133,7 +116,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
116
|
requirements:
|
134
117
|
- - ">="
|
135
118
|
- !ruby/object:Gem::Version
|
136
|
-
hash: 3
|
137
119
|
segments:
|
138
120
|
- 0
|
139
121
|
version: "0"
|