sinatra-tag-helpers 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGEyZDNmNmY2NTgyYmZhMWY4YTE4MjQ3ZGYzODhmZWQwNWJiMGZjZQ==
4
+ YjhkNDNjMTczZjU0ZWU5YmE0Y2FkNTU5YWU0MTI5MWYyNTI5OTdiNA==
5
5
  data.tar.gz: !binary |-
6
- NWQyY2U0MTJjYTg4MjE4N2Q5YTFiYWUyYTBiMDEyZWViMTQ3YWQxNw==
6
+ MzNkM2NhNjdkMTZhZmRiMWNkNDNlNTRhN2Y3NDM1ZDVkZDA2M2VjYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWM5MGMxMTU4ZjkyNTEyNTVmODVmMzNmZWI0YmY4MjYwMmE5ZGUyZDUzZTg0
10
- ZmRiNmY3NjYzNWI0NDgxYzIwM2M3Yzc0NzAxM2MzYjhmMjc3MzllZTQ4NTJk
11
- YjIxZDY5MGU0NTg5NDkzZWIxODg1MTk1MGM2ZjFmOWUzNmU2OWM=
9
+ YjMzMDVlZGIyYWZmMTZhMmEwNjgzYjZkODc5MzI1ODM5ZWNkNDdkMTM5M2Vh
10
+ NTI0NjAwNDI4ZDVkMjcwZTA4ZGY4Y2RlN2JkMTRiYTE0YjA3Njk4NjlkYWM5
11
+ MjdjOTUxZGU4YzM0MmVmMDA2YmE5Y2YyMjg4MDE1YTIwMmE5Yjg=
12
12
  data.tar.gz: !binary |-
13
- YjVjZDkxMWI5Y2U0MzQwZDQ2MjU4NTU2ZTMyNDdlNDg0ZWI2ZDNjYzBkYjg0
14
- NWNmMTRjMjBiOWIwNGMyNTZjN2Q3YWY3NTYwZWFiOWVkN2Y4ZjRlMmU1ZTlm
15
- ZTQwOTVkNjU1MDUxYjFmMDMyM2Y4NjM0MDdmNDM5N2M2M2JjM2I=
13
+ NzQwMzY0M2I3Njc4Yjc4MGY5MWMxZGVmN2ExMjVjZDlkODg4ZmYyZGVjZmY1
14
+ YmFhOWMzMTQ5ZWY4ZDQ4YTdiZDYxZTg3Y2Y1ZmRlYzU2ZGVhMjIyMjRjNDYw
15
+ MGI4Y2ZkMmI2MzIxYjdmMjhjMDU2MWY3MmQzY2Q0YzdhZjgyNjA=
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module TagHelpers
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -163,7 +163,18 @@ module Sinatra
163
163
  select = ["<select #{ to_attributes(attributes) }>"]
164
164
 
165
165
  options.collect do |key, val|
166
- select.push option_for(param, :key => key, :value => val, :default => attributes[:default])
166
+ # groups...
167
+ if val.is_a?(Hash)
168
+ select.push "<optgroup label='#{ key }'>"
169
+
170
+ val.each do |group_key, group_val|
171
+ select.push option_for(param, :key => group_key, :value => group_val, :default => attributes[:default])
172
+ end
173
+
174
+ select.push "</optgroup>"
175
+ else
176
+ select.push option_for(param, :key => key, :value => val, :default => attributes[:default])
177
+ end
167
178
  end
168
179
 
169
180
  select.push('</select>').join(' ').chomp
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-tag-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Lecklider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-06 00:00:00.000000000 Z
11
+ date: 2013-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra