pinpoint 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ require 'pinpoint/us_states'
2
+ require 'pinpoint/formats'
3
+
1
4
  module Addressable
2
5
  module ClassMethods
3
6
  def address(name)
@@ -18,14 +21,14 @@ module Addressable
18
21
  :presence => {
19
22
  :if => :#{name}_incomplete? },
20
23
  :inclusion => {
21
- :in => US_STATES,
24
+ :in => Pinpoint::US_STATES,
22
25
  :allow_blank => true }
23
26
 
24
27
  validates :#{name}_postal_code,
25
28
  :presence => {
26
29
  :if => :#{name}_incomplete? },
27
30
  :format => {
28
- :with => Chirrpy::FORMATS[:zip_code],
31
+ :with => Pinpoint::FORMATS[:zip_code],
29
32
  :allow_blank => true }
30
33
  VALIDATIONIZATION
31
34
 
@@ -0,0 +1,7 @@
1
+ module Pinpoint
2
+ FORMATS = {
3
+ # Zip Code: 5 digits
4
+ # Optionally followed by a dash and 4 more digits
5
+ :zip_code => /^\d{5}(?:\-\d{4})?$/,
6
+ }
7
+ end
@@ -0,0 +1,3 @@
1
+ Pinpoint::US_STATES = %w(AK AL AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD
2
+ ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT
3
+ WA WI WV WY)
@@ -1,3 +1,3 @@
1
1
  module Pinpoint
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -22,6 +22,8 @@ extra_rdoc_files:
22
22
  - LICENSE
23
23
  files:
24
24
  - lib/pinpoint/addressable.rb
25
+ - lib/pinpoint/formats.rb
26
+ - lib/pinpoint/us_states.rb
25
27
  - lib/pinpoint/version.rb
26
28
  - lib/pinpoint.rb
27
29
  - Rakefile