phony 1.1.9 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/phony.rb CHANGED
@@ -1,11 +1,3 @@
1
- begin
2
- gem 'activesupport', '~> 3.0'
3
- rescue LoadError
4
- puts "phony requires activesupport ~> 3.0"
5
- end
6
-
7
- require 'active_support/core_ext/object/blank'
8
-
9
1
  # Framework.
10
2
  #
11
3
  require File.expand_path '../phony/vanity', __FILE__
@@ -26,14 +26,16 @@ module Phony
26
26
  def format_cc_ndc_local format, space, cc, ndc, *parts
27
27
  "#{format_cc_ndc(format, space, cc, ndc)}#{format_local(space, parts)}"
28
28
  end
29
- def format_cc_ndc format, space, cc, ndc
29
+ # TODO = '' needed? Specs say no.
30
+ #
31
+ def format_cc_ndc format, space, cc, ndc = ''
30
32
  format, split_phone_number = case format
31
33
  when nil, :international_absolute, :international, :+
32
- [ndc.blank? ? '+%s%s' : '+%s%s%s%s', [cc, space, ndc, space]]
34
+ [ndc.empty? ? '+%s%s' : '+%s%s%s%s', [cc, space, ndc, space]]
33
35
  when :international_relative
34
- [ndc.blank? ? '00%s%s' : '00%s%s%s%s', [cc, space, ndc, space]]
36
+ [ndc.empty? ? '00%s%s' : '00%s%s%s%s', [cc, space, ndc, space]]
35
37
  when :national
36
- [ndc.blank? ? '' : '0%s%s', [ndc, space]]
38
+ [ndc.empty? ? '' : '0%s%s', [ndc, space]]
37
39
  when :local
38
40
  ['', []]
39
41
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 1
8
- - 9
9
- version: 1.1.9
7
+ - 2
8
+ - 0
9
+ version: 1.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Florian Hanke
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-09 00:00:00 +01:00
17
+ date: 2011-01-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -62,7 +62,7 @@ files:
62
62
  - spec/lib/phony/national_splitters/variable_spec.rb
63
63
  - spec/lib/phony/vanity_spec.rb
64
64
  - spec/lib/phony_spec.rb
65
- has_rdoc: false
65
+ has_rdoc: true
66
66
  homepage: http://github.com/floere/phony
67
67
  licenses: []
68
68