Permalink
Browse files

add rails validation to readme

  • Loading branch information...
joelparkerhenderson committed Apr 26, 2011
1 parent 8c4e812 commit 4822d5388dbbf67ad62c3e169aa02f0b3e65949d
Showing with 1,857 additions and 70 deletions.
  1. +3 −0 CHANGELOG.txt
  2. +23 −7 README.rdoc
  3. +8 −0 Rakefile
  4. +1 −0 VERSION
  5. +66 −0 coverage/assets/0.4.4/app.js
  6. BIN coverage/assets/0.4.4/fancybox/blank.gif
  7. BIN coverage/assets/0.4.4/fancybox/fancy_close.png
  8. BIN coverage/assets/0.4.4/fancybox/fancy_loading.png
  9. BIN coverage/assets/0.4.4/fancybox/fancy_nav_left.png
  10. BIN coverage/assets/0.4.4/fancybox/fancy_nav_right.png
  11. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_e.png
  12. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_n.png
  13. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_ne.png
  14. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_nw.png
  15. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_s.png
  16. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_se.png
  17. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_sw.png
  18. BIN coverage/assets/0.4.4/fancybox/fancy_shadow_w.png
  19. BIN coverage/assets/0.4.4/fancybox/fancy_title_left.png
  20. BIN coverage/assets/0.4.4/fancybox/fancy_title_main.png
  21. BIN coverage/assets/0.4.4/fancybox/fancy_title_over.png
  22. BIN coverage/assets/0.4.4/fancybox/fancy_title_right.png
  23. BIN coverage/assets/0.4.4/fancybox/fancybox-x.png
  24. BIN coverage/assets/0.4.4/fancybox/fancybox-y.png
  25. BIN coverage/assets/0.4.4/fancybox/fancybox.png
  26. +363 −0 coverage/assets/0.4.4/fancybox/jquery.fancybox-1.3.1.css
  27. +44 −0 coverage/assets/0.4.4/fancybox/jquery.fancybox-1.3.1.pack.js
  28. BIN coverage/assets/0.4.4/favicon.png
  29. +155 −0 coverage/assets/0.4.4/jquery-1.4.2.min.js
  30. +152 −0 coverage/assets/0.4.4/jquery.dataTables.min.js
  31. +141 −0 coverage/assets/0.4.4/jquery.timeago.js
  32. +174 −0 coverage/assets/0.4.4/jquery.url.js
  33. BIN coverage/assets/0.4.4/loading.gif
  34. BIN coverage/assets/0.4.4/magnify.png
  35. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
  36. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
  37. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
  38. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
  39. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_glass_75_dadada_1x400.png
  40. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
  41. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
  42. BIN coverage/assets/0.4.4/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  43. BIN coverage/assets/0.4.4/smoothness/images/ui-icons_222222_256x240.png
  44. BIN coverage/assets/0.4.4/smoothness/images/ui-icons_2e83ff_256x240.png
  45. BIN coverage/assets/0.4.4/smoothness/images/ui-icons_454545_256x240.png
  46. BIN coverage/assets/0.4.4/smoothness/images/ui-icons_888888_256x240.png
  47. BIN coverage/assets/0.4.4/smoothness/images/ui-icons_cd0a0a_256x240.png
  48. +295 −0 coverage/assets/0.4.4/smoothness/jquery-ui-1.8.4.custom.css
  49. +341 −0 coverage/assets/0.4.4/stylesheet.css
  50. +71 −0 coverage/index.html
  51. +5 −0 coverage/resultset.yml
  52. +1 −59 lib/sixarm_ruby_email_address_validation.rb
  53. +1 −0 sixarm_ruby_email_address_validation-1.2.2-sha512.txt
  54. BIN sixarm_ruby_email_address_validation-1.2.2.gem
  55. +10 −3 sixarm_ruby_email_address_validation.gemspec
  56. +0 −1 sixarm_ruby_email_address_validation.sha512.txt
  57. +3 −0 test/sixarm_ruby_email_address_validation_test.rb
View
@@ -0,0 +1,3 @@
+CHANGELOG
+
+2011-04-24 1.2.2 Update for Ruby 1.9.2 and Rails 3.0.6
View
@@ -1,12 +1,10 @@
+= SixArm.com » Ruby » Email address validation using RFC 822 pattern matching
-= SixArm Ruby Gem: email address validation using RFC 822 pattern matching
+Author:: Joel Parker Henderson, joel@joelparkerhenderson.com
+Copyright:: Copyright (c) 2006-2011 Joel Parker Henderson
+License:: See LICENSE.txt file
-Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
-Copyright:: Copyright (c) 2006-2010 Joel Parker Henderson
-License:: CreativeCommons License, Non-commercial Share Alike
-License:: LGPL, GNU Lesser General Public License
-
-Email address regex, to validate an email address using RFC 822.
+Email address regular expression to validate an email address using RFC 822.
This is a gem wrapper around http://tfletcher.com/lib/rfc822.rb
@@ -18,6 +16,9 @@ Example:
end
=> found
+
+== Pattern Match
+
To find an email address in a string, do the pattern match
then use the result, which is the match's string position:
@@ -31,6 +32,9 @@ Example of match position:
match_position = EMAIL_ADDRESS_PATTERN=~'... hello world ...'
=> nil
+
+== Exact Pattern Match
+
To do an exact pattern match, use the EMAIL_ADDRESS_EXACT_PATTERN.
This matches the entire string from start to end; in other words,
the entire string must be one email address.
@@ -57,3 +61,15 @@ Example to validate an email address:
EMAIL_ADDRESS_EXACT_PATTERN=~email_address ? true : false
end
+
+== Rails Validation
+
+To add email address validation to a typical Ruby On Rails model:
+
+ class User
+ include EmailAddressValidation
+ validates :email_address, :format => { :with => EMAIL_ADDRESS_EXACT_PATTERN },
+ end
+
+
+
View
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+require 'rake'
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib' << 'test'
+ t.pattern = 'test/*.rb'
+end
View
@@ -0,0 +1 @@
+1.2.2
@@ -0,0 +1,66 @@
+$(document).ready(function() {
+ $('.file_list').dataTable({
+ "aaSorting": [[ 1, "asc" ]],
+ "bPaginate": false,
+ "bJQueryUI": true,
+ "aoColumns": [
+ null,
+ { "sType": "percent" },
+ null,
+ null,
+ null,
+ null
+ ]
+ });
+
+ $('.source_table tbody tr:odd').addClass('odd');
+ $('.source_table tbody tr:even').addClass('even');
+
+ $("a.src_link").fancybox({
+ 'hideOnContentClick': true
+ });
+
+ // Hide src files and file list container
+ $('.source_files').hide();
+ $('.file_list_container').hide();
+
+ // Add tabs based upon existing file_list_containers
+ $('.file_list_container h2').each(function(){
+ $('.group_tabs').append('<li><a href="#' + $(this).parent().attr('id') + '">' + $(this).html() + '</a></li>');
+ });
+
+ $('.group_tabs a').each( function() {
+ $(this).addClass($(this).attr('href').replace('#', ''));
+ });
+
+ $('.group_tabs a').live('focus', function() {
+ $(this).blur();
+ });
+
+ var favicon_path = $('link[rel="shortcut icon"]').attr('href')
+ $('.group_tabs a').live('click', function(){
+ if (!$(this).parent().hasClass('active')) {
+ $('.group_tabs a').parent().removeClass('active');
+ $(this).parent().addClass('active');
+ $('.file_list_container').hide();
+ $(".file_list_container" + $(this).attr('href')).show();
+ window.location.href = window.location.href.split('#')[0] + $(this).attr('href').replace('#', '#_');
+
+ // Force favicon reload - otherwise the location change containing anchor would drop the favicon...
+ // Works only on firefox, but still... - Anyone know a better solution to force favicon?
+ $('link[rel="shortcut icon"]').remove();
+ $('head').append('<link rel="shortcut icon" type="image/png" href="'+ favicon_path +'" />');
+ };
+ return false;
+ });
+
+ if (jQuery.url.attr('anchor')) {
+ $('.group_tabs a.'+jQuery.url.attr('anchor').replace('_', '')).click();
+ } else {
+ $('.group_tabs a:first').click();
+ };
+
+ $("abbr.timeago").timeago();
+ $('#loading').fadeOut();
+ $('#wrapper').show();
+});
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 4822d53

Please sign in to comment.