homeschool 0.0.1.16 → 0.0.1.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/form_buildr.rb +8 -3
  3. metadata +1 -1
data/Rakefile CHANGED
@@ -85,7 +85,7 @@ desc "Publish the release files to RubyForge."
85
85
  task :release => :package do
86
86
  rubyforge do
87
87
  login
88
- throw RubyForgeNotConfigured if userconfig[:username] == 'username'
88
+ raise "rubyforge not configured" if userconfig[:username] == 'username'
89
89
  puts %{Preparing to release #{PKG_NAME}-#{PKG_VERSION}}
90
90
  [:gem, :tgz, :zip].each_with_index do |ext, index|
91
91
  send(index<1? :add_release : :add_file, PKG_RUBYFORGE_PROJECT, PKG_NAME, [PKG_NAME, PKG_VERSION]*'-', "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}")
data/lib/form_buildr.rb CHANGED
@@ -38,8 +38,13 @@
38
38
  #
39
39
  class ActionView::Helpers::FormBuilder
40
40
 
41
- def labeled_check_box(method, options={})
42
- return send(:check_box, method, options.without(:label, :no_colon)) + send(:label_for, method, options)
41
+ def labeled_radio_button(method, tag_value, options={})
42
+ id = %{#{@object_name}_#{method}_#{tag_value}}
43
+ return send(:radio_button, method, tag_value, {:id => id}.update(options.without(:label, :no_colon))) + send(:label_for, method, {:no_colon => true, :label => tag_value.humanize, :id => id}.update(options))
44
+ end
45
+
46
+ def labeled_check_box(method, options={}, checked_value="1", unchecked_value="0")
47
+ return send(:check_box, method, options.without(:label, :no_colon), checked_value, unchecked_value) + send(:label_for, method, options.update(:no_colon => true))
43
48
  end
44
49
 
45
50
  rdef(/labeled_(.*)/) do |match, *args|
@@ -48,6 +53,6 @@ class ActionView::Helpers::FormBuilder
48
53
 
49
54
  def label_for(method, options={})
50
55
  options = {:label => options} if options.is_a? String
51
- %{<label class="fieldLabel" for="#{@object_name}_#{method}">#{options[:label] || method.to_s.humanize}#{":" if !options[:no_colon]}</label>}
56
+ %{<label class="fieldLabel" for="#{options[:id] || "#{@object_name}_#{method}"}">#{options[:label] || method.to_s.humanize}#{":" if !options[:no_colon]}</label>}
52
57
  end
53
58
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: homeschool
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1.16
6
+ version: 0.0.1.21
7
7
  date: 2007-09-11 00:00:00 -04:00
8
8
  summary: The homeschool gem
9
9
  require_paths: