diff --git a/vendor/plugins/semi_formal/MIT-LICENSE b/vendor/plugins/semi_formal/MIT-LICENSE new file mode 100644 index 0000000..9376605 --- /dev/null +++ b/vendor/plugins/semi_formal/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009 [name of plugin creator] + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/plugins/semi_formal/README.markdown b/vendor/plugins/semi_formal/README.markdown new file mode 100644 index 0000000..1b1a722 --- /dev/null +++ b/vendor/plugins/semi_formal/README.markdown @@ -0,0 +1,57 @@ +SemiFormal +========== + +A FormBuilder meant to play well with [Coulda](http://github.com/dancroak/coulda) and [Evergreen](http://github.com/dancroak/evergreen). + +Examples +-------- + +I had been writing this: + + <% form_for :session, :url => session_path do |form| %> +
+
+ <%= form.label :email %> + <%= form.text_field :email %> +
+
+ <%= form.label :password %> + <%= form.password_field :password %> +
+
+ <%= form.check_box :remember_me %> + <%= form.label :remember_me %> +
+
+
+ <%= form.submit "Sign in", :disable_with => "Please wait..." %> +
+ <% end %> + +With SemiFormal, I write this: + + <% form_for :session, :url => session_path do |form| %> +
+ <%= form.string :email %> + <%= form.password :password %> + <%= form.boolean :remember_me %> +
+
+ <%= form.submit "Sign in", :disable_with => "Please wait..." %> +
+ <% end %> + +Hey, slightly better. + +Also available: + + form.text + form.numeric + +numeric is also aliased as integer, decimal, and float to feel migration-like. + +Installation +------------ + + script/plugin install git://github.com/dancroak/semi_formal.git + diff --git a/vendor/plugins/semi_formal/Rakefile b/vendor/plugins/semi_formal/Rakefile new file mode 100644 index 0000000..2efe7ee --- /dev/null +++ b/vendor/plugins/semi_formal/Rakefile @@ -0,0 +1,23 @@ +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +desc 'Default: run unit tests.' +task :default => :test + +desc 'Test the semi_formal plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = true +end + +desc 'Generate documentation for the semi_formal plugin.' +Rake::RDocTask.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'SemiFormal' + rdoc.options << '--line-numbers' << '--inline-source' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/vendor/plugins/semi_formal/init.rb b/vendor/plugins/semi_formal/init.rb new file mode 100644 index 0000000..d89c81f --- /dev/null +++ b/vendor/plugins/semi_formal/init.rb @@ -0,0 +1,2 @@ +require File.join(File.dirname(__FILE__), 'lib', 'semi_formal') + diff --git a/vendor/plugins/semi_formal/install.rb b/vendor/plugins/semi_formal/install.rb new file mode 100644 index 0000000..e0fc3e4 --- /dev/null +++ b/vendor/plugins/semi_formal/install.rb @@ -0,0 +1,2 @@ +puts IO.read(File.join(File.dirname(__FILE__), 'README.textile')) + diff --git a/vendor/plugins/semi_formal/lib/semi_formal.rb b/vendor/plugins/semi_formal/lib/semi_formal.rb new file mode 100644 index 0000000..a7ba8a3 --- /dev/null +++ b/vendor/plugins/semi_formal/lib/semi_formal.rb @@ -0,0 +1,47 @@ +class SemiFormal < ActionView::Helpers::FormBuilder + def string(field, *args) + options = args.extract_options! + "
" + + label(field, options[:label] || {}) + + text_field(field, options[:text_field] || {}) + + "
" + end + + def password(field, *args) + options = args.extract_options! + "
" + + label(field, options[:label] || {}) + + password_field(field, options[:password_field] || {}) + + "
" + end + + def boolean(field, *args) + options = args.extract_options! + "
" + + check_box(field, options[:check_box] || {}) + + label(field, options[:label] || {}) + + "
" + end + + def numeric(field, *args) + options = args.extract_options! + "
" + + label(field, options[:label] || {}) + + text_field(field, options[:text_field] || {}) + + "
" + end + alias :integer :numeric + alias :float :numeric + alias :decimal :numeric + + def text(field, *args) + options = args.extract_options! + "
" + + label(field, options[:label] || {}) + + text_area(field, options[:text_area] || {}) + + "
" + end +end + +ActionView::Base.default_form_builder = SemiFormal + diff --git a/vendor/plugins/semi_formal/tasks/semi_formal_tasks.rake b/vendor/plugins/semi_formal/tasks/semi_formal_tasks.rake new file mode 100644 index 0000000..b45ddff --- /dev/null +++ b/vendor/plugins/semi_formal/tasks/semi_formal_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :semi_formal do +# # Task goes here +# end diff --git a/vendor/plugins/semi_formal/test/semi_formal_test.rb b/vendor/plugins/semi_formal/test/semi_formal_test.rb new file mode 100644 index 0000000..5c35f64 --- /dev/null +++ b/vendor/plugins/semi_formal/test/semi_formal_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class SemiFormalTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/vendor/plugins/semi_formal/test/test_helper.rb b/vendor/plugins/semi_formal/test/test_helper.rb new file mode 100644 index 0000000..cf148b8 --- /dev/null +++ b/vendor/plugins/semi_formal/test/test_helper.rb @@ -0,0 +1,3 @@ +require 'rubygems' +require 'active_support' +require 'active_support/test_case' \ No newline at end of file -- libgit2 0.21.2