Skip to content
Browse files

Version 1.0.0, converted from plugin to gem

  • Loading branch information...
1 parent a5ac68b commit 956fa5f724c7b83351c14e08039a1097dd46edde @Narnach committed Mar 27, 2012
Showing with 90 additions and 46 deletions.
  1. +60 −0 README.md
  2. +0 −44 README.rdoc
  3. +0 −2 init.rb
  4. +30 −0 number_recognizer.gemspec
View
60 README.md
@@ -0,0 +1,60 @@
+NumberRecognizer
+================
+
+NumberRecognizer is library to recognize mobile phone numbers. It can make educated guesses to correct local numbers into numbers in international format.
+
+Examples
+--------
+
+ require "number_recognizer"
+ @nc = NumberRecognizer.new("0612345678")
+ @nc.valid_or_correct_mobile? # => true
+ @nc.country_name # => "Netherlands"
+ @nc.country # => "31"
+ @nc.prefix # => "31"
+ @nc.local_number # => "612345678"
+ @nc.normalized_number # => "31612345678"
+
+Supported countries
+-------------------
+
+It does not aim for worldwide coverage and correction, as that is not the problem I'm trying to solve.
+If you want to add a country, feel free to send me a pull request or create a feature request.
+
+* Australia (614xxxxxxxx)
+* Belgium (324xxxxxxxx)
+* England (447xxxxxxxx, 447xxxxxxxxx)
+* Germany (491xxxxxxxxx, 491xxxxxxxxxx)
+* Netherlands (316xxxxxxxx)
+* Portugal (3519xxxxxxxx)
+* Spain (346xxxxxxxx, 347xxxxxxxx)
+
+Some countries have some number ranges not covered. The regular expressions cover those, so check [lib/number_recognizer.rb](http://github.com/Narnach/number_recognizer/blob/master/lib/number_recognizer.rb) for the details.
+
+It is also possible to add your own custom format:
+
+ NumberRecognizer.add_format :country => "Utopia", :mobile=>true, :format => /(99)(9\d{8})/, :country_code=>999
+
+Installation
+------------
+
+Simply install the gem from rubygems:
+
+ gem install number_recognizer
+
+If you use Bundler, add it to your Gemfile and the do a bundle install:
+
+ gem "number_recognizer"
+
+Bug tracking / feature requests
+-------------------------------
+
+I use Github issues for this: https://github.com/Narnach/number_recognizer/issues
+
+Disclaimer
+----------
+
+It scratches my own itch and does not aim to solve everyone's problems.
+If it works for you, great! If it does not; fork it, patch it and send me a pull request.
+
+Written by Wes 'Narnach' Oldenbeuving in 2009. Licensed under the MIT license.
View
44 README.rdoc
@@ -1,44 +0,0 @@
-= NumberRecognizer
-
-NumberRecognizer is a rails plugin to recognize mobile phone numbers. It can make educated guesses to correct local numbers into numbers in international format.
-
-== Examples
-
- @nc = NumberRecognizer.new("0612345678")
- @nc.valid_or_correct_mobile? # => true
- @nc.country_name # => "Netherlands"
- @nc.country # => "31"
- @nc.prefix # => "31"
- @nc.local_number # => "612345678"
- @nc.normalized_number # => "31612345678"
-
-== Supported countries
-
-It does not aim for worldwide coverage and correction, as that is not the problem I'm trying to solve.
-If want to add a country, feel free to send me a pull request or create a feature request.
-
-* Australia (614xxxxxxxx)
-* Belgium (324xxxxxxxx)
-* England (447xxxxxxxx, 447xxxxxxxxx)
-* Netherlands (316xxxxxxxx)
-* Portugal (3519xxxxxxxx)
-* Spain (346xxxxxxxx, 347xxxxxxxx)
-
-It is also possible to add your own custom format:
-
- NumberRecognizer.add_format :country => "Utopia", :mobile=>true, :format => /(99)(9\d{8})/, :country_code=>999
-
-== Installation
-
- script/plugin install git://github.com/Narnach/number_recognizer.git
-
-== Bug tracking / feature requests
-
-I use Github issues for this: https://github.com/Narnach/number_recognizer/issues
-
-== Disclaimer
-
-It scratches my own itch and does not aim to solve everyone's problems.
-If it works for you, great! If it does not; fork it, patch it and send me a pull request.
-
-Written by Wes 'Narnach' Oldenbeuving in 2009. Licensed under the MIT license.
View
2 init.rb
@@ -1,2 +0,0 @@
-# -*- encoding : utf-8 -*-
-require_relative "lib/number_recognizer"
View
30 number_recognizer.gemspec
@@ -0,0 +1,30 @@
+Gem::Specification.new do |s|
+ # Project
+ s.name = 'number_recognizer'
+ s.summary = "NumberRecognizer is library to recognize mobile phone numbers. It can make educated guesses to correct local numbers into numbers in international format."
+ s.description = s.summary
+ s.version = '1.0.0'
+ s.date = '2012-03-27'
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Wes Oldenbeuving"]
+ s.email = "narnach@me.com"
+ s.homepage = "http://www.github.com/narnach/number_recognizer"
+
+ # Files
+ root_files = %w[Readme.md number_recognizer.gemspec MIT-LICENSE]
+ bin_files = []
+ lib_files = %w[number_recognizer number_recognizer/format_dsl]
+ s.bindir = "bin"
+ s.require_path = "lib"
+ s.executables = bin_files
+ s.test_files = %w[number_recognizer].map{|f| "spec/#{f}_spec.rb"}
+ s.files = root_files + s.test_files + bin_files.map {|f| 'bin/%s' % f} + lib_files.map {|f| 'lib/%s.rb' % f} + %w[spec/spec_helper.rb]
+
+ # rdoc
+ s.has_rdoc = true
+ s.extra_rdoc_files = %w[ Readme.md]
+ s.rdoc_options << '--inline-source' << '--line-numbers' << '--main' << 'Readme.md'
+
+ # Requirements
+ s.required_ruby_version = ">= 1.8.0"
+end

0 comments on commit 956fa5f

Please sign in to comment.
Something went wrong with that request. Please try again.