tolerance 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +57 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +8 -0
- data/bin/console +12 -0
- data/bin/setup +8 -0
- data/lib/tolerance/fake_exception.rb +12 -0
- data/lib/tolerance/hook_methods.rb +25 -0
- data/lib/tolerance/version.rb +5 -0
- data/lib/tolerance.rb +19 -0
- data/tolerance.gemspec +32 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d0bc55ccfc16a123c4ad579a6a6f4ab5545cdc039e0394368db8fca3c3a71cfa
|
4
|
+
data.tar.gz: dd209dbe667f79e47cedc7e9101e535788d2ec8e4fb4217f2373fa940ad58c3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: def4445931cbc3fb3f1ee0d131e83045079587a90d70793cc787232e7628c7c6b81467f48ad96b71da4740dde951a393c12b43c30319aee6e1ef136225d7eeef
|
7
|
+
data.tar.gz: 24d6c64d841fb348e62e44b61c94218608dd6a1e58dc2282d20802527ccd04892f2f049f0ed940937d6040491ba2d34ebe55047436c8b37faeb4e42009638e81
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# The behavior of RuboCop can be controlled via the .rubocop.yml
|
2
|
+
# configuration file. It makes it possible to enable/disable
|
3
|
+
# certain cops (checks) and to alter their behavior if they accept
|
4
|
+
# any parameters. The file can be placed either in your home
|
5
|
+
# directory or in some project directory.
|
6
|
+
#
|
7
|
+
# RuboCop will start looking for the configuration file in the directory
|
8
|
+
# where the inspected file is and continue its way up to the root directory.
|
9
|
+
#
|
10
|
+
# See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
|
11
|
+
AllCops:
|
12
|
+
TargetRubyVersion: 2.5
|
13
|
+
|
14
|
+
Metrics:
|
15
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tolerance (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.0)
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
jaro_winkler (1.5.2)
|
13
|
+
method_source (0.9.2)
|
14
|
+
parallel (1.17.0)
|
15
|
+
parser (2.6.3.0)
|
16
|
+
ast (~> 2.4.0)
|
17
|
+
pry (0.12.2)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.9.0)
|
20
|
+
rainbow (3.0.0)
|
21
|
+
rake (10.5.0)
|
22
|
+
rspec (3.8.0)
|
23
|
+
rspec-core (~> 3.8.0)
|
24
|
+
rspec-expectations (~> 3.8.0)
|
25
|
+
rspec-mocks (~> 3.8.0)
|
26
|
+
rspec-core (3.8.0)
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-expectations (3.8.3)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.8.0)
|
31
|
+
rspec-mocks (3.8.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.8.0)
|
34
|
+
rspec-support (3.8.0)
|
35
|
+
rubocop (0.68.1)
|
36
|
+
jaro_winkler (~> 1.5.1)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 2.5, != 2.5.1.1)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
ruby-progressbar (~> 1.7)
|
41
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
42
|
+
ruby-progressbar (1.10.0)
|
43
|
+
unicode-display_width (1.5.0)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
bundler (~> 2.0)
|
50
|
+
pry
|
51
|
+
rake (~> 10.0)
|
52
|
+
rspec (~> 3.0)
|
53
|
+
rubocop
|
54
|
+
tolerance!
|
55
|
+
|
56
|
+
BUNDLED WITH
|
57
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Yoshiyuki Hirano
|
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
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Tolerance
|
2
|
+
|
3
|
+
Regards almost of all typo as tolerance
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'tolerance'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install tolerance
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
You can use only installation. No special setup is required.
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
class Foo
|
27
|
+
def hello
|
28
|
+
__method__
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.hello
|
32
|
+
__method__
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
foo = Foo.new
|
37
|
+
|
38
|
+
foo.hello # => :hello
|
39
|
+
foo.helle # => :hello
|
40
|
+
foo.hellooo # => :hello
|
41
|
+
|
42
|
+
Foo.hello # => :hello
|
43
|
+
Foo.helle # => :hello
|
44
|
+
Foo.hellooo # => :hello
|
45
|
+
```
|
46
|
+
|
47
|
+
Regards almost of all typo as tolerance...!! Goodbye typo, forever..!!
|
48
|
+
|
49
|
+
*CAUTION: This gem is for development only*
|
50
|
+
|
51
|
+
## License
|
52
|
+
|
53
|
+
[MIT License](https://opensource.org/licenses/MIT)
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'tolerance'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
require 'pry'
|
12
|
+
Pry.start
|
data/bin/setup
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'fake_exception'
|
4
|
+
|
5
|
+
module Tolerance
|
6
|
+
module HookMethods # :nodoc:
|
7
|
+
private
|
8
|
+
|
9
|
+
def method_missing(name, *args, &block)
|
10
|
+
fex = FakeException.new(name: name, receiver: self)
|
11
|
+
corrections = ::DidYouMean::VariableNameChecker.new(fex).corrections
|
12
|
+
|
13
|
+
!corrections.empty? ? send(corrections[0], *args, &block) : super
|
14
|
+
rescue ArgumentError
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def respond_to_missing?(name, *args)
|
19
|
+
fex = FakeException.new(name: name, receiver: self)
|
20
|
+
corrections = ::DidYouMean::VariableNameChecker.new(fex).corrections
|
21
|
+
|
22
|
+
!corrections.empty? || super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/tolerance.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'tolerance/hook_methods'
|
4
|
+
require_relative 'tolerance/version'
|
5
|
+
|
6
|
+
require 'pry'
|
7
|
+
|
8
|
+
module Tolerance # :nodoc:
|
9
|
+
def self.tracer
|
10
|
+
@tracer ||= TracePoint.new(:end) do |t|
|
11
|
+
next if t.self.singleton_class? || t.self.ancestors.size == 1
|
12
|
+
|
13
|
+
t.self.include HookMethods
|
14
|
+
t.self.extend HookMethods
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
tracer.enable
|
19
|
+
end
|
data/tolerance.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('./lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'tolerance/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'tolerance'
|
9
|
+
s.version = Tolerance::VERSION
|
10
|
+
s.authors = ['Yoshiyuki Hirano']
|
11
|
+
s.email = ['yhirano@me.com']
|
12
|
+
s.homepage = 'https://github.com/yhirano55/tolerance'
|
13
|
+
s.summary = %(Regards all typo as tolerance)
|
14
|
+
s.description = s.summary
|
15
|
+
s.license = 'MIT'
|
16
|
+
s.files = Dir.chdir(File.expand_path('.', __dir__)) do
|
17
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features|images)/})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
s.bindir = 'exe'
|
23
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
s.require_paths = ['lib']
|
25
|
+
|
26
|
+
s.required_ruby_version = '>= 2.5.0'
|
27
|
+
s.required_rubygems_version = '>= 1.8.11'
|
28
|
+
|
29
|
+
s.add_development_dependency 'bundler', '~> 2.0'
|
30
|
+
s.add_development_dependency 'rake', '~> 10.0'
|
31
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tolerance
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yoshiyuki Hirano
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
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'
|
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'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Regards all typo as tolerance
|
56
|
+
email:
|
57
|
+
- yhirano@me.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".rubocop.yml"
|
65
|
+
- ".travis.yml"
|
66
|
+
- Gemfile
|
67
|
+
- Gemfile.lock
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- bin/console
|
72
|
+
- bin/setup
|
73
|
+
- lib/tolerance.rb
|
74
|
+
- lib/tolerance/fake_exception.rb
|
75
|
+
- lib/tolerance/hook_methods.rb
|
76
|
+
- lib/tolerance/version.rb
|
77
|
+
- tolerance.gemspec
|
78
|
+
homepage: https://github.com/yhirano55/tolerance
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 2.5.0
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.8.11
|
96
|
+
requirements: []
|
97
|
+
rubygems_version: 3.0.3
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: Regards all typo as tolerance
|
101
|
+
test_files: []
|