tel_to_helper 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: df774c317792d5b97eeaf802f5508a682b8b2e8b
4
+ data.tar.gz: bd5974bde5eaf89d4c0e948a0c92317e13414887
5
+ SHA512:
6
+ metadata.gz: b2d858708e996852a8db8cd395ec4e0b4c8274a5e9e1153203325bf50452e115199b8940c2f1e9cf5e06cbf2b950dd2100a1033bc80e35e02e8b369e8ab64981
7
+ data.tar.gz: 8abfe3ea52d0bebd9c458eb4d85e8d88067a31dcf92c4135e816f3eb46872d957a2a721e3a252951b6d007cdaba514587cb1d8e6c28f4ca86e35953d02822cd3
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ lib/bundler/man
9
+ pkg
10
+ rdoc
11
+ spec/reports
12
+ test/tmp
13
+ test/version_tmp
14
+ tmp
data/.travis.yml ADDED
@@ -0,0 +1,2 @@
1
+ rvm:
2
+ - 2
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'rake'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Jianqiu Xiao <swordray@gmail.com>
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # tel_to_helper
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/tel_to_helper.png)](http://badge.fury.io/rb/tel_to_helper) [![Build Status](https://secure.travis-ci.org/swordray/tel_to_helper.png?branch=master)](http://travis-ci.org/swordray/tel_to_helper) [![Dependency Status](https://gemnasium.com/swordray/tel_to_helper.png?travis)](https://gemnasium.com/swordray/tel_to_helper) [![Code Climate](https://codeclimate.com/github/swordray/tel_to_helper.png)](https://codeclimate.com/github/swordray/tel_to_helper)
4
+
5
+ Action View Telephone Link Helper.
6
+
7
+ ## Requirements
8
+
9
+ * Ruby ~> 2.0
10
+ * Rails
11
+
12
+ ## Installation
13
+
14
+ Include the gem in your Gemfile:
15
+
16
+ ```ruby
17
+ gem 'tel_to_helper'
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```ruby
23
+ tel_to(number, name = nil, link_to_options = nil)
24
+ ```
25
+
26
+ ## Examples
27
+
28
+ ```ruby
29
+ = tel_to '400-881-6609'
30
+ # <a href="tel:400-881-6609">400-881-6609</a>
31
+ ```
32
+ ```ruby
33
+ = tel_to '400-881-6609', 'ihaveu.com Customer Service'
34
+ # <a href="tel:400-881-6609">ihaveu.com Customer Service</a>
35
+ ```
36
+ ```ruby
37
+ = tel_to '400-881-6609', 'ihaveu.com Customer Service', target: '_blank'
38
+ # <a href="tel:400-881-6609" target="_blank">ihaveu.com Customer Service</a>
39
+ ```
40
+
41
+ ## Credits
42
+
43
+ * swordray @[ihaveu](http://www.ihaveu.com/home) @[shuhai](http://tw.shuhai.org/) @[leaf](http://leaf.iacger.com)
44
+
45
+ ## License
46
+
47
+ Copyright © 2014 Jianqiu Xiao <swordray@gmail.com> under The [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ task :default do |t|
2
+ `gem build tel_to_helper.gemspec`
3
+ end
@@ -0,0 +1,15 @@
1
+ require 'action_view/helpers'
2
+
3
+ module ActionView
4
+ module Helpers
5
+ # = Action View Telephone Link Helper
6
+ module TelToHelper
7
+ # Creates a telephone link tag of the given +number+ and +name+. If +nil+
8
+ # is passed as the +name+ the value of the link itself will become the
9
+ # +number+. +options+ and +html_options+ will be same as +link_to.
10
+ def tel_to(number, name = nil, link_to_options = nil)
11
+ link_to(h(name || number), "tel:#{h(number)}", link_to_options) if number.present?
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module TelToHelper #:nodoc:
2
+ VERSION = '0.0.3'
3
+ end
@@ -0,0 +1,4 @@
1
+ require "action_view"
2
+ require "action_view/helpers/tel_to_helper"
3
+
4
+ ActionView::Base.send :include, ActionView::Helpers::TelToHelper if defined? Rails
@@ -0,0 +1,23 @@
1
+ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
+ require 'tel_to_helper/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "tel_to_helper"
6
+ s.version = TelToHelper::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.author = ["Jianqiu Xiao"]
9
+ s.email = ["swordray@gmail.com"]
10
+ s.homepage = "https://github.com/swordray/tel_to_helper"
11
+ s.summary = "Telephone Link Tag Helper"
12
+ s.description = "Generate tel protocol link tag for html view."
13
+ s.license = "MIT"
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.required_ruby_version = "~> 2.0"
21
+
22
+ s.add_dependency 'rails'
23
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tel_to_helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Jianqiu Xiao
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Generate tel protocol link tag for html view.
28
+ email:
29
+ - swordray@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - ".travis.yml"
36
+ - Gemfile
37
+ - LICENSE
38
+ - README.md
39
+ - Rakefile
40
+ - lib/action_view/helpers/tel_to_helper.rb
41
+ - lib/tel_to_helper.rb
42
+ - lib/tel_to_helper/version.rb
43
+ - tel_to_helper.gemspec
44
+ homepage: https://github.com/swordray/tel_to_helper
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '2.0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.2.2
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Telephone Link Tag Helper
68
+ test_files: []