alexander_graham_bell 0.1.2 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 926ea95a3d2aa6a163c4729f2ef82e2241418f51
4
- data.tar.gz: 0afff154f9914785920404eb76b68bcefa1babc3
2
+ SHA256:
3
+ metadata.gz: 9440cf22dc233bcee4af2a2fc849253c768d5d2b1468dda65cf3b81472f57e82
4
+ data.tar.gz: 40179be3ede0d037192f1d45ce62731acb9307f6d84f5aa6680f4078e58df893
5
5
  SHA512:
6
- metadata.gz: 40a0a7deec8b03e8c8753f2f66fb459db27b13c4be6e10dd610fbbf9f39df68083f0e14fc01b79b689a1b3d2bf7993e628f8d64d4140a859b2b22e6d57aeea92
7
- data.tar.gz: 003fb7a06ee93637b00c932dd7c16d6a56a4b862b191a81eea472841a4729d20cafee4a9f5f22dbb664ca2f8a332e58f850631b4be705f0204028a19c9d100d2
6
+ metadata.gz: 3a1bf6c0e315aff256e6f4ba48432fc00e71ccc0dcec2f574e945010ab164836f975a9a57969e8e927cc4e35cf98db68b52b3bbd462ac3f2e245ce2db4b09723
7
+ data.tar.gz: 6284de23fdcde06539c4a12af6db32c74f1428eaec688504fa13c9a0ece08b9e3384d98ce7160551997737d90debd874ee8e82cea720ff3325dcc1f514b0bd49
@@ -1,26 +1,20 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'alexander_graham_bell/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/alexander_graham_bell/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "alexander_graham_bell"
6
+ spec.name = 'alexander_graham_bell'
8
7
  spec.version = AlexanderGrahamBell::VERSION
9
- spec.authors = ["Scott Speidel","Michael Jewell"]
10
- spec.email = ["scottspeidel@gmail.com", "michaeljewell9911@gmail.com"]
11
-
12
- spec.summary = "Phone number parser and tel link creator."
13
- spec.homepage = "https://github.com/appfolio/alexander-graham-bell"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
8
+ spec.platform = Gem::Platform::RUBY
9
+ spec.author = 'AppFolio'
10
+ spec.email = 'opensource@appfolio.com'
11
+ spec.description = 'Phone number parser and tel link creator.'
12
+ spec.summary = spec.description
13
+ spec.homepage = 'https://github.com/appfolio/alexander_graham_bell'
14
+ spec.license = 'MIT'
15
+ spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
16
+ spec.require_paths = ['lib']
20
17
 
21
- spec.add_development_dependency "bundler", "~> 1.9"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "minitest", "~> 5.0"
24
- spec.add_development_dependency "guard"
25
- spec.add_development_dependency "guard-minitest"
18
+ spec.required_ruby_version = Gem::Requirement.new('< 3.5')
19
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
26
20
  end
@@ -1,3 +1,3 @@
1
1
  module AlexanderGrahamBell
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -4,11 +4,11 @@ require 'alexander_graham_bell/phone'
4
4
 
5
5
  module AlexanderGrahamBell
6
6
  class << self
7
- def tel_link(phone_number, escaper = ERB::Util.method(:h))
7
+ def tel_link(phone_number)
8
8
  phone = Phone.new(phone_number)
9
- escaped_phone_number = escape_phone_number(phone_number, escaper)
9
+ escaped_phone_number = escape_phone_number(phone_number)
10
10
  return escaped_phone_number unless phone.valid?
11
- "<a href=\"tel:#{phone.number}#{isub(phone)}\">#{escaped_phone_number}</a>"
11
+ "<a href=\"#{tel_href(phone_number)}\">#{escaped_phone_number}</a>"
12
12
  end
13
13
 
14
14
  def tel_href(phone_number)
@@ -20,8 +20,8 @@ module AlexanderGrahamBell
20
20
 
21
21
  private
22
22
 
23
- def escape_phone_number(phone_number, escaper = ERB::Util.method(:h))
24
- escaper ? escaper.call(phone_number) : phone_number
23
+ def escape_phone_number(phone_number)
24
+ ERB::Util.h(phone_number)
25
25
  end
26
26
 
27
27
  def isub(phone)
metadata CHANGED
@@ -1,130 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexander_graham_bell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Scott Speidel
8
- - Michael Jewell
9
- autorequire:
10
- bindir: exe
7
+ - AppFolio
8
+ bindir: bin
11
9
  cert_chain: []
12
- date: 2016-03-11 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '1.9'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '1.9'
28
- - !ruby/object:Gem::Dependency
29
- name: rake
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: minitest
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '5.0'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '5.0'
56
- - !ruby/object:Gem::Dependency
57
- name: guard
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: guard-minitest
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- description:
85
- email:
86
- - scottspeidel@gmail.com
87
- - michaeljewell9911@gmail.com
10
+ date: 2025-03-06 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Phone number parser and tel link creator.
13
+ email: opensource@appfolio.com
88
14
  executables: []
89
15
  extensions: []
90
16
  extra_rdoc_files: []
91
17
  files:
92
- - ".gitignore"
93
- - ".travis.yml"
94
- - Gemfile
95
- - Guardfile
96
- - LICENSE.txt
97
- - README.md
98
- - Rakefile
99
18
  - alexander_graham_bell.gemspec
100
- - bin/console
101
- - bin/setup
102
19
  - lib/alexander_graham_bell.rb
103
20
  - lib/alexander_graham_bell/phone.rb
104
21
  - lib/alexander_graham_bell/version.rb
105
- homepage: https://github.com/appfolio/alexander-graham-bell
22
+ homepage: https://github.com/appfolio/alexander_graham_bell
106
23
  licenses:
107
24
  - MIT
108
- metadata: {}
109
- post_install_message:
25
+ metadata:
26
+ allowed_push_host: https://rubygems.org
110
27
  rdoc_options: []
111
28
  require_paths:
112
29
  - lib
113
30
  required_ruby_version: !ruby/object:Gem::Requirement
114
31
  requirements:
115
- - - ">="
32
+ - - "<"
116
33
  - !ruby/object:Gem::Version
117
- version: '0'
34
+ version: '3.5'
118
35
  required_rubygems_version: !ruby/object:Gem::Requirement
119
36
  requirements:
120
37
  - - ">="
121
38
  - !ruby/object:Gem::Version
122
39
  version: '0'
123
40
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.4.5.1
126
- signing_key:
41
+ rubygems_version: 3.6.2
127
42
  specification_version: 4
128
43
  summary: Phone number parser and tel link creator.
129
44
  test_files: []
130
- has_rdoc:
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.4
4
- before_install: gem install bundler -v 1.11.2
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in alexander_graham_bell.gemspec
4
- gemspec
data/Guardfile DELETED
@@ -1,5 +0,0 @@
1
- guard :minitest do
2
- watch(%r{^test/(.*)\/?test_(.*)\.rb$})
3
- watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
4
- watch(%r{^test/test_helper\.rb$}) { 'test' }
5
- end
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Scott Speidel
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,45 +0,0 @@
1
- [![Build Status](https://circleci.com/gh/appfolio/alexander_graham_bell.svg?style=svg)](https://circleci.com/gh/appfolio/alexander_graham_bell.svg?style=svg)
2
-
3
- # AlexanderGrahamBell
4
-
5
- Phone number parser and tel link creator.
6
-
7
- ## Install
8
-
9
- ```
10
- gem install alexander_graham_bell
11
- ```
12
-
13
-
14
- ## Requirements
15
-
16
- * Ruby 2.2.3 or higher
17
-
18
- ## Examples
19
- #### Generate a tel link
20
- ```ruby
21
- puts AlexanderGrahamBell.tel_link('1-800-555-1234')
22
- # <a href=\"tel:18005551234\">1-800-555-1234</a>
23
- ```
24
- #### Generate a tel link with an extension
25
- ```ruby
26
- puts AlexanderGrahamBell.tel_link('1-800-555-1234ext5')
27
- #<a href=\"tel:18005551234;isub=5\">1-800-555-1234ext5</a>
28
- ```
29
- #### Get the href contents
30
- ```ruby
31
- puts AlexanderGrahamBell.tel_href('1-800-555-1234')
32
- # tel:18005551234
33
- ```
34
- #### For use with rails
35
- ```ruby
36
- # If you're using rails and you want to html escape everything, wrap it in your own module or class.
37
-
38
- module MyTelLinkGenerator
39
- def self.build(phone_number)
40
- AlexanderGrahamBell.tel_link(phone_number).html_safe
41
- end
42
- end
43
-
44
- MyTelLinkGenerator.build('+18052234567ext5')
45
- ```
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
9
-
10
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "alexander_graham_bell"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here