html-proofer-mailto_awesome 0.1.1 → 1.0.3

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: b493bf7a933852a876e4c3ad97030837ebe08f8f
4
- data.tar.gz: 62df5ac9c50e3ea376999a9782b39ed35ce2a39f
2
+ SHA256:
3
+ metadata.gz: b50ac92c025baefaa7d187920e89dba660fe4cd64ebb05be16ba4bf0f9887d69
4
+ data.tar.gz: e6554d23a2672709851c65df9b1eb940a69d8208bf937bc207ec16749db11b51
5
5
  SHA512:
6
- metadata.gz: b284e0b28a396cd929102200d78a5090f284c9b48bceb3200ab046319a20218a79452b9f4c220315d428fa8ceb6a9a6c04a526a48480f5dc8428ef2af3447f08
7
- data.tar.gz: 21b700379869ee22f868e4ce42ff03f2ca598fc3ff143e3f85272de76a2f2ed864750bd6a4621d298ddfbcef935237412bb45d581949d853af7a2087c5827369
6
+ metadata.gz: a89abac418858ad2e9cf9b902344fedc950165e34c9f65b7b4605148472b702e24929746a4ccd1460731a0f42956ccf36724704bd1fe319d129c73cf35cc8aac
7
+ data.tar.gz: fa9e144ae5d1fcb1690d11bf17a899c3bd9153b27129b2ed06e67c2e9d05dbbfe1b6c0b2f4e2b48745cd309bfb024237627bede12a9ec36780dc66190632f3c6
@@ -0,0 +1,4 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [fulldecent]
4
+ custom: ["https://www.paypal.me/fulldecent", "https://amazon.com/hz/wishlist/ls/EE78A23EEGQB"]
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ /vendor/*
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in html-proofer-mailto_awesome.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ html-proofer-mailto_awesome (1.0.0)
5
+ html-proofer (~> 3.0, >= 3.15.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ diff-lcs (1.3)
13
+ ethon (0.12.0)
14
+ ffi (>= 1.3.0)
15
+ ffi (1.11.3)
16
+ html-proofer (3.15.0)
17
+ addressable (~> 2.3)
18
+ mercenary (~> 0.3)
19
+ nokogumbo (~> 2.0)
20
+ parallel (~> 1.3)
21
+ rainbow (~> 3.0)
22
+ typhoeus (~> 1.3)
23
+ yell (~> 2.0)
24
+ mercenary (0.3.6)
25
+ mini_portile2 (2.4.0)
26
+ nokogiri (1.10.7)
27
+ mini_portile2 (~> 2.4.0)
28
+ nokogumbo (2.0.2)
29
+ nokogiri (~> 1.8, >= 1.8.4)
30
+ parallel (1.19.1)
31
+ public_suffix (4.0.1)
32
+ rainbow (3.0.0)
33
+ rake (12.3.3)
34
+ rspec (3.8.0)
35
+ rspec-core (~> 3.8.0)
36
+ rspec-expectations (~> 3.8.0)
37
+ rspec-mocks (~> 3.8.0)
38
+ rspec-core (3.8.2)
39
+ rspec-support (~> 3.8.0)
40
+ rspec-expectations (3.8.4)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.8.0)
43
+ rspec-mocks (3.8.1)
44
+ diff-lcs (>= 1.2.0, < 2.0)
45
+ rspec-support (~> 3.8.0)
46
+ rspec-support (3.8.2)
47
+ timecop (0.9.1)
48
+ typhoeus (1.3.1)
49
+ ethon (>= 0.9.0)
50
+ vcr (3.0.3)
51
+ yell (2.2.0)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ bundler (~> 2.0.2)
58
+ html-proofer-mailto_awesome!
59
+ rake (~> 12.3.1)
60
+ rspec (~> 3.5, >= 3.5.0)
61
+ timecop (~> 0.8, >= 0.8.1)
62
+ vcr (~> 3.0, >= 3.0.3)
63
+
64
+ BUNDLED WITH
65
+ 2.0.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 William Entriken
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,80 @@
1
+ [![Build Status](https://travis-ci.org/fulldecent/html-proofer-mailto_awesome.svg?branch=master)](https://travis-ci.org/fulldecent/html-proofer-mailto_awesome)
2
+
3
+ # html-proofer-mailto_awesome
4
+ A custom [html-proofer](https://github.com/gjtorikian/html-proofer) test that makes your `mailto:` links awesome.
5
+
6
+ ## What is an awesome `mailto` link?
7
+
8
+ We should use awesome links as psychological warfare against users. Users will send us emails with stupid or annoying content that we don't want. At big companies (like Amazon) they have abandoned email altogether because of this reason. So instead we prefill the email with the message we want to receive. It takes active cognitive effort for the user to put in their unwanted message.
9
+
10
+ For example, this is a not-awesome `mailto` link:
11
+
12
+ ```html
13
+ <a href="mailto:support@pacificmedicaltraining.com">Email us</a>
14
+ ```
15
+
16
+ This is an awesome link:
17
+
18
+ ```html
19
+ <a href="mailto:support@pacificmedicaltraining.com?subject=Signing up&amp;body=Hello,\nI'd like to sign up for your course, can you please send me more information.">Email us</a>
20
+ ```
21
+
22
+ For more reference, see http://marcwitteveen.com/mailtogenerator/
23
+
24
+ ## How do I use it
25
+
26
+ Follow the same instructions as for any [html-proofer custom class](https://github.com/gjtorikian/html-proofer/wiki/Extensions-(custom-classes)).
27
+
28
+ Our ruby gem is [html-proofer-mailto_awesome](https://rubygems.org/gems/html-proofer-mailto_awesome)
29
+
30
+ 1. Add new dependency to your Ruby project
31
+
32
+ In Gemfile:
33
+
34
+ gem 'html-proofer-mailto_awesome'
35
+
36
+ Or in your .gemspec:
37
+
38
+ Gem::Specification.new do |s|
39
+ ...
40
+ s.add_runtime_dependency 'html-proofer-mailto_awesome'
41
+ end
42
+
43
+ 2. Create a Rakefile like the following and add it to your project
44
+
45
+ task :default => [:test]
46
+
47
+ desc 'run Rspec specs'
48
+ task :test do
49
+ sh 'rspec spec'
50
+ end
51
+
52
+ 3. Run `bundle install`
53
+
54
+ 4. Run `rake`
55
+
56
+ Also if you like, you can enable your project for continuous integration testing with Travis:
57
+
58
+ 1. Set up Travis CI for your project
59
+
60
+ 2. Add a `.travis.yml` file like the following to your project and your spec will run automatically
61
+
62
+ language: ruby
63
+ rvm:
64
+ - 2.5.3
65
+ For additional tests you can run on your website, see [Lightning Sites](https://github.com/fulldecent/lightning-sites) and for a sample GitHub project that implements this testing and follows many other HTML development best practices, see [HTML Website Template](https://github.com/fulldecent/html-website-template).
66
+
67
+ For a full example of a website project that includes testing continuous integration testing for awesome mailto links and many other best practices, see our
68
+
69
+ ## Contributing
70
+
71
+ This project is released under the MIT license.
72
+
73
+ Releasing new versions:
74
+
75
+ ```sh
76
+ gem bump
77
+ rm html-proofer-mailto_awesome-*.gem
78
+ gem build html-proofer-mailto_awesome.gemspec
79
+ gem push html-proofer-mailto_awesome-*.gem
80
+ ```
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "html/proofer/mailto_awesome"
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(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,30 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'html/proofer/mailto_awesome/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'html-proofer-mailto_awesome'
7
+ spec.version = MailtoAwesome::VERSION
8
+ spec.authors = ['William Entriken']
9
+ spec.email = 'github.com@phor.net'
10
+
11
+ spec.summary = 'Checker for mailto links'
12
+ spec.description = 'A custom html-proofer test that makes your mailto links awesome'
13
+ spec.homepage = 'https://github.com/fulldecent/html-proofer-mailto_awesome'
14
+ spec.license = 'MIT'
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 2.0.2"
25
+ spec.add_development_dependency "rake", "~> 12.3.1"
26
+ spec.add_runtime_dependency 'html-proofer', '~> 3.0', '>= 3.15.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.5', '>= 3.5.0'
28
+ spec.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.3'
29
+ spec.add_development_dependency 'timecop', '~> 0.8', '>= 0.8.1'
30
+ end
@@ -0,0 +1,3 @@
1
+ module MailtoAwesome
2
+ VERSION = "1.0.3"
3
+ end
@@ -1,23 +1,32 @@
1
- class MailtoAwesome < ::HTMLProofer::Check
2
- def mailto?
3
- return false if @link.ignore? || @link.href.nil?
4
- @link.href.match /mailto/
5
- end
6
-
7
- def awesome?
8
- @link.href.include? 'subject' and @link.href.include? 'body'
9
- end
10
-
11
- def run
12
- @html.css('a').each do |node|
13
- @link = create_element(node)
14
- line = node.line
15
- content = node.to_s
1
+ require "html/proofer/mailto_awesome/version"
16
2
 
17
- if mailto? && !awesome?
18
- add_issue("This is a not-awesome mailto link!", line: line, content: content)
19
- end
3
+ module Html
4
+ module Proofer
5
+ module MailtoAwesome
6
+ class Error < StandardError; end
7
+ class MailToAwesome < ::HTMLProofer::Check
8
+ def mailto?
9
+ return false if @link.ignore? || @link.href.nil?
10
+ @link.href.match /^mailto:/i
11
+ end
12
+
13
+ def awesome?
14
+ @link.href.downcase.include? 'subject=' and @link.href.downcase.include? 'body='
15
+ end
16
+
17
+ def run
18
+ return unless @options[:check_mailto_awesome]
19
+ @html.css('a').each do |node|
20
+ @link = create_element(node)
21
+ line = node.line
22
+ content = node.to_s
23
+
24
+ if mailto? && !awesome?
25
+ add_issue("This is a not-awesome mailto link!", line: line, content: content)
26
+ end
27
+ end
28
+ end
29
+ end
20
30
  end
21
31
  end
22
- endclass MailtoAwesome
23
- end
32
+ end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer-mailto_awesome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Entriken
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-05 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.2
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 12.3.1
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 12.3.1
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: html-proofer
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -19,7 +47,7 @@ dependencies:
19
47
  version: '3.0'
20
48
  - - ">="
21
49
  - !ruby/object:Gem::Version
22
- version: 3.0.0
50
+ version: 3.15.0
23
51
  type: :runtime
24
52
  prerelease: false
25
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,13 +57,86 @@ dependencies:
29
57
  version: '3.0'
30
58
  - - ">="
31
59
  - !ruby/object:Gem::Version
32
- version: 3.0.0
60
+ version: 3.15.0
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 3.5.0
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.5'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 3.5.0
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '3.5'
81
+ - !ruby/object:Gem::Dependency
82
+ name: vcr
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '3.0'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 3.0.3
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '3.0'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 3.0.3
101
+ - !ruby/object:Gem::Dependency
102
+ name: timecop
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '0.8'
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 0.8.1
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.8'
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 0.8.1
33
121
  description: A custom html-proofer test that makes your mailto links awesome
34
122
  email: github.com@phor.net
35
123
  executables: []
36
124
  extensions: []
37
125
  extra_rdoc_files: []
38
126
  files:
127
+ - ".github/FUNDING.yml"
128
+ - ".gitignore"
129
+ - ".rspec"
130
+ - ".travis.yml"
131
+ - Gemfile
132
+ - Gemfile.lock
133
+ - LICENSE
134
+ - README.md
135
+ - Rakefile
136
+ - bin/console
137
+ - bin/setup
138
+ - html-proofer-mailto_awesome.gemspec
139
+ - lib/html/proofer/mailto_awesome/version.rb
39
140
  - lib/mailto_awesome.rb
40
141
  homepage: https://github.com/fulldecent/html-proofer-mailto_awesome
41
142
  licenses:
@@ -56,9 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
157
  - !ruby/object:Gem::Version
57
158
  version: '0'
58
159
  requirements: []
59
- rubyforge_project:
60
- rubygems_version: 2.6.11
160
+ rubygems_version: 3.0.6
61
161
  signing_key:
62
162
  specification_version: 4
63
- summary: Custom html-proofer test
163
+ summary: Checker for mailto links
64
164
  test_files: []