reserved_subdomain 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +0 -0
- data/lib/reserved_subdomain/file.rb +0 -0
- data/lib/reserved_subdomain/literal.rb +0 -0
- data/lib/reserved_subdomain/literals/iso_3166_1.txt +0 -0
- data/lib/reserved_subdomain/literals/iso_639_1.txt +0 -0
- data/lib/reserved_subdomain/literals/miscellaneous.txt +0 -0
- data/lib/reserved_subdomain/literals/tlds.txt +0 -0
- data/lib/reserved_subdomain/pattern.rb +0 -0
- data/lib/reserved_subdomain/prefix.rb +0 -0
- data/lib/reserved_subdomain/version.rb +1 -1
- data/lib/reserved_subdomain.rb +0 -0
- metadata +2 -16
- data/.gitignore +0 -54
- data/.rspec +0 -3
- data/.rubocop.yml +0 -45
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -13
- data/Gemfile +0 -13
- data/Gemfile.local.example +0 -11
- data/README.md +0 -35
- data/Rakefile +0 -11
- data/bin/build_literals +0 -32
- data/bin/console +0 -2
- data/bin/rspec +0 -29
- data/bin/rubocop +0 -29
- data/reserved_subdomain.gemspec +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00aff3e49b7d612224b6a8ca2eb03f80cffb9e15cd539097a858d35ec5caedd
|
4
|
+
data.tar.gz: 6dc457ae16753efac87f44bb2213c96c84d01ea0c82313f895c851851f4de353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ba9afc504f692d598ccd5542c1f0512776a9bd135fe7bc689db7e328602717e6ac6a9fa038540c11ae2cdb2ac18609a539b5ebd08eb94f4b3ff3857b8ed01a8
|
7
|
+
data.tar.gz: a6d02a20054453e3e207c4257c58cba77734ef8ff7bc0af65365001c933684a07b6d3385a967fb4965438d18c542dd9baf5e38273b9861b437b9287e8c60f07e
|
data/LICENSE
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/reserved_subdomain.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reserved_subdomain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Sayers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -17,20 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".gitignore"
|
21
|
-
- ".rspec"
|
22
|
-
- ".rubocop.yml"
|
23
|
-
- ".travis.yml"
|
24
|
-
- CHANGELOG.md
|
25
|
-
- Gemfile
|
26
|
-
- Gemfile.local.example
|
27
20
|
- LICENSE
|
28
|
-
- README.md
|
29
|
-
- Rakefile
|
30
|
-
- bin/build_literals
|
31
|
-
- bin/console
|
32
|
-
- bin/rspec
|
33
|
-
- bin/rubocop
|
34
21
|
- lib/reserved_subdomain.rb
|
35
22
|
- lib/reserved_subdomain/file.rb
|
36
23
|
- lib/reserved_subdomain/literal.rb
|
@@ -41,7 +28,6 @@ files:
|
|
41
28
|
- lib/reserved_subdomain/pattern.rb
|
42
29
|
- lib/reserved_subdomain/prefix.rb
|
43
30
|
- lib/reserved_subdomain/version.rb
|
44
|
-
- reserved_subdomain.gemspec
|
45
31
|
homepage: https://github.com/dominicsayers/reserved_subdomain
|
46
32
|
licenses:
|
47
33
|
- MIT
|
data/.gitignore
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
.byebug_history
|
2
|
-
Gemfile.local
|
3
|
-
Gemfile.lock
|
4
|
-
*.local
|
5
|
-
*.gem
|
6
|
-
*.rbc
|
7
|
-
/.config
|
8
|
-
/coverage/
|
9
|
-
/InstalledFiles
|
10
|
-
/pkg/
|
11
|
-
/spec/reports/
|
12
|
-
/spec/examples.txt
|
13
|
-
/test/tmp/
|
14
|
-
/test/version_tmp/
|
15
|
-
/tmp/
|
16
|
-
|
17
|
-
# Used by dotenv library to load environment variables.
|
18
|
-
# .env
|
19
|
-
|
20
|
-
## Specific to RubyMotion:
|
21
|
-
.dat*
|
22
|
-
.repl_history
|
23
|
-
build/
|
24
|
-
*.bridgesupport
|
25
|
-
build-iPhoneOS/
|
26
|
-
build-iPhoneSimulator/
|
27
|
-
|
28
|
-
## Specific to RubyMotion (use of CocoaPods):
|
29
|
-
#
|
30
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
31
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
32
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
33
|
-
#
|
34
|
-
# vendor/Pods/
|
35
|
-
|
36
|
-
## Documentation cache and generated files:
|
37
|
-
/.yardoc/
|
38
|
-
/_yardoc/
|
39
|
-
/doc/
|
40
|
-
/rdoc/
|
41
|
-
|
42
|
-
## Environment normalization:
|
43
|
-
/.bundle/
|
44
|
-
/vendor/bundle
|
45
|
-
/lib/bundler/man/
|
46
|
-
|
47
|
-
# for a library or gem, you might want to ignore these files since the code is
|
48
|
-
# intended to run in multiple environments; otherwise, check them in:
|
49
|
-
# Gemfile.lock
|
50
|
-
.ruby-version
|
51
|
-
.ruby-gemset
|
52
|
-
|
53
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
-
.rvmrc
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
---
|
2
|
-
require: rubocop-rspec
|
3
|
-
|
4
|
-
AllCops:
|
5
|
-
DisplayStyleGuide: true
|
6
|
-
DisplayCopNames: true
|
7
|
-
TargetRubyVersion: 2.2
|
8
|
-
Exclude:
|
9
|
-
- bin/*
|
10
|
-
|
11
|
-
Layout/DotPosition:
|
12
|
-
EnforcedStyle: leading
|
13
|
-
Enabled: true
|
14
|
-
|
15
|
-
Layout/ExtraSpacing:
|
16
|
-
Enabled: true
|
17
|
-
|
18
|
-
Metrics/BlockLength:
|
19
|
-
Exclude:
|
20
|
-
- spec/**/*
|
21
|
-
|
22
|
-
Metrics/LineLength:
|
23
|
-
Max: 120
|
24
|
-
Exclude:
|
25
|
-
- spec/**/*
|
26
|
-
|
27
|
-
Naming/FileName:
|
28
|
-
Enabled: true
|
29
|
-
|
30
|
-
Style/ClassAndModuleChildren:
|
31
|
-
EnforcedStyle: nested
|
32
|
-
Enabled: true
|
33
|
-
|
34
|
-
Style/Documentation:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Style/StringLiterals:
|
38
|
-
EnforcedStyle: single_quotes
|
39
|
-
Enabled: true
|
40
|
-
|
41
|
-
Style/TrailingCommaInArguments:
|
42
|
-
EnforcedStyleForMultiline: comma
|
43
|
-
|
44
|
-
Style/TrailingCommaInArrayLiteral:
|
45
|
-
EnforcedStyleForMultiline: comma
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.2
|
5
|
-
- 2.3
|
6
|
-
- 2.4
|
7
|
-
- 2.5
|
8
|
-
- 2.6
|
9
|
-
before_script:
|
10
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
-
- chmod +x ./cc-test-reporter
|
12
|
-
- ./cc-test-reporter before-build
|
13
|
-
script:
|
14
|
-
- bundle exec rspec spec
|
15
|
-
after_script:
|
16
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
|
3
|
-
## [Unreleased](https://github.com/dominicsayers/reserved_subdomain/tree/HEAD)
|
4
|
-
|
5
|
-
**Merged pull requests:**
|
6
|
-
|
7
|
-
- New build [\#4](https://github.com/dominicsayers/reserved_subdomain/pull/4) ([dominicsayers](https://github.com/dominicsayers))
|
8
|
-
- Add Simplecov and report to CodeClimate from Travis [\#3](https://github.com/dominicsayers/reserved_subdomain/pull/3) ([dominicsayers](https://github.com/dominicsayers))
|
9
|
-
- Initial commit [\#1](https://github.com/dominicsayers/reserved_subdomain/pull/1) ([dominicsayers](https://github.com/dominicsayers))
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gemspec
|
6
|
-
|
7
|
-
group :test do
|
8
|
-
gem 'rspec'
|
9
|
-
gem 'simplecov-console'
|
10
|
-
end
|
11
|
-
|
12
|
-
local_gemfile = 'Gemfile.local'
|
13
|
-
eval(File.read(local_gemfile)) if File.exist?(local_gemfile) # rubocop:disable Security/Eval
|
data/Gemfile.local.example
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Copy this file to a file named Gemfile.local to add these gems to your dev toolset
|
2
|
-
# Feel free to modify Gemfile.local to suit your own preferences
|
3
|
-
group :development do
|
4
|
-
gem 'github_changelog_generator'
|
5
|
-
gem 'gem-release'
|
6
|
-
gem 'guard'
|
7
|
-
gem 'guard-rspec'
|
8
|
-
gem 'guard-rubocop'
|
9
|
-
gem 'rake'
|
10
|
-
gem 'rubocop'
|
11
|
-
end
|
data/README.md
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# ReservedSubdomain
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/reserved_subdomain.svg)](https://rubygems.org/gems/reserved_subdomain)
|
3
|
-
[![Gem downloads](https://img.shields.io/gem/dt/reserved_subdomain.svg)](https://rubygems.org/gems/reserved_subdomain)
|
4
|
-
[![Build Status](https://travis-ci.org/dominicsayers/reserved_subdomain.svg?branch=master)](https://travis-ci.org/dominicsayers/reserved_subdomain)
|
5
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/53c0395f76bc52f53b60/maintainability)](https://codeclimate.com/github/dominicsayers/reserved_subdomain/maintainability)
|
6
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/53c0395f76bc52f53b60/test_coverage)](https://codeclimate.com/github/dominicsayers/reserved_subdomain/test_coverage)
|
7
|
-
[![Dependency Status](https://dependencyci.com/github/dominicsayers/reserved_subdomain/badge)](https://dependencyci.com/github/dominicsayers/reserved_subdomain)
|
8
|
-
[![security](https://hakiri.io/github/dominicsayers/reserved_subdomain/master.svg)](https://hakiri.io/github/dominicsayers/reserved_subdomain/master)
|
9
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5aeeb051546b4ecc9f0c78317d8c6af8)](https://www.codacy.com/app/dominicsayers/reserved_subdomain)
|
10
|
-
|
11
|
-
ReservedSubdomain is a Ruby gem that checks whether a proposed subdomain should be a reserved name.
|
12
|
-
|
13
|
-
It checks for common patterns such as `www` or `mail`. It checks all gTLDs. It checks some common language and country codes.
|
14
|
-
|
15
|
-
## Installation
|
16
|
-
|
17
|
-
Add this line to your application's Gemfile:
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
gem 'reserved_subdomain'
|
21
|
-
```
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
ReservedSubdomain.new('www').reserved? # => true
|
27
|
-
```
|
28
|
-
|
29
|
-
## Configuration
|
30
|
-
|
31
|
-
Each time you use ReservedSubdomain it loads the list of reserved names from a file. This can be slow if you're doing these checks frequently.
|
32
|
-
|
33
|
-
In this case you can set the environment variable `RESERVED_SUBDOMAIN_PRELOAD` to "true" and the list will be preloaded.
|
34
|
-
|
35
|
-
Of course if you preload the list it will stay memory-resident and take up a significant amount of room. Your call.
|
data/Rakefile
DELETED
data/bin/build_literals
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
lib = File.expand_path('../lib', __dir__)
|
5
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
-
|
7
|
-
require 'csv'
|
8
|
-
require 'open-uri'
|
9
|
-
require 'reserved_subdomain'
|
10
|
-
|
11
|
-
# TLDs
|
12
|
-
uri = URI.parse('http://data.iana.org/TLD/tlds-alpha-by-domain.txt')
|
13
|
-
file = ReservedSubdomain::File.new(:tlds)
|
14
|
-
file.literals = uri.read.downcase.split("\n")
|
15
|
-
content = file.remove_reserved!.save.literals
|
16
|
-
ReservedSubdomain::File.new(:miscellaneous).dedupe!(content).save
|
17
|
-
|
18
|
-
# Country codes
|
19
|
-
uri = URI.parse('https://datahub.io/core/country-list/r/data.csv')
|
20
|
-
io = uri.open
|
21
|
-
csv = CSV.parse(io, headers: true)
|
22
|
-
|
23
|
-
file = ReservedSubdomain::File.new(:iso_3166_1)
|
24
|
-
file.literals = csv.map { |row| row["Code"].downcase }
|
25
|
-
content = file.remove_reserved!.save.literals
|
26
|
-
ReservedSubdomain::File.new(:miscellaneous).dedupe!(content).save
|
27
|
-
|
28
|
-
# Language codes
|
29
|
-
# TODO: Find a source of ISO-639 language codes and add them to the list of literals
|
30
|
-
file = ReservedSubdomain::File.new(:iso_639_1)
|
31
|
-
content = file.remove_reserved!.save.literals
|
32
|
-
ReservedSubdomain::File.new(:miscellaneous).dedupe!(content).save
|
data/bin/console
DELETED
data/bin/rspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'rspec' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "pathname"
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
14
|
-
|
15
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
-
|
17
|
-
if File.file?(bundle_binstub)
|
18
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
-
load(bundle_binstub)
|
20
|
-
else
|
21
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
require "rubygems"
|
27
|
-
require "bundler/setup"
|
28
|
-
|
29
|
-
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'rubocop' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "pathname"
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
14
|
-
|
15
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
-
|
17
|
-
if File.file?(bundle_binstub)
|
18
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
-
load(bundle_binstub)
|
20
|
-
else
|
21
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
require "rubygems"
|
27
|
-
require "bundler/setup"
|
28
|
-
|
29
|
-
load Gem.bin_path("rubocop", "rubocop")
|
data/reserved_subdomain.gemspec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
lib = File.expand_path('lib', __dir__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'reserved_subdomain/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'reserved_subdomain'
|
7
|
-
s.version = ReservedSubdomain::VERSION
|
8
|
-
s.authors = ['Dominic Sayers']
|
9
|
-
s.email = ['dominic@sayers.cc']
|
10
|
-
s.summary = 'Identify subdomain names that should be reserved'
|
11
|
-
s.homepage = 'https://github.com/dominicsayers/reserved_subdomain'
|
12
|
-
s.license = 'MIT'
|
13
|
-
|
14
|
-
s.files = `git ls-files`.split($RS).reject { |file| file =~ %r{^spec/} }
|
15
|
-
s.require_paths = ['lib']
|
16
|
-
end
|