-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed ------- * `rack` as dependency * Unused `config.ru` Changed ------- * Default path for cache is now in `./tmp` directory instead of `./config` Added ----- * Support of Rails 6 Development ----------- * [EditorConfig](https://editorconfig.org/) added * [RuboCop](https://github.com/rubocop-hq/rubocop) added and offenses fixed * RuboCop task added for Travis CI * Drop support for Ruby <= 2.2 (they even will not get security patches) * Ignore built gems for git
- Loading branch information
1 parent
93fe240
commit 48236e0
Showing
25 changed files
with
199 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ Gemfile.lock | |
*.rbc | ||
coverage | ||
doc | ||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.4 | ||
NewCops: enable | ||
|
||
Layout/MultilineMethodCallIndentation: | ||
EnforcedStyle: indented | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- spec/**/* | ||
|
||
Metrics/LineLength: | ||
Exclude: | ||
- spec/support/* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
language: ruby | ||
|
||
rvm: | ||
- 2.4.9 | ||
- 2.5.7 | ||
- 2.6.5 | ||
script: bundle exec rspec | ||
- 2.4 | ||
- 2.5 | ||
- 2.6 | ||
|
||
before_install: | ||
- gem update --system | ||
# fixes Travis CI error: NoMethodError: undefined method `spec' for nil:NilClass | ||
- gem install bundler | ||
|
||
cache: bundler | ||
|
||
script: | ||
- bundle exec rspec | ||
- bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
module VoightKampff::Methods | ||
def human? | ||
VoightKampff::Test.new(user_agent).human? | ||
end | ||
# frozen_string_literal: true | ||
|
||
module VoightKampff | ||
# Helper for Rack::Request | ||
module Methods | ||
extend Forwardable | ||
def_delegators :voight_kampff, :human?, :bot?, :replicant? | ||
|
||
private | ||
|
||
def bot? | ||
VoightKampff::Test.new(user_agent).bot? | ||
def voight_kampff | ||
VoightKampff::Test.new(user_agent) | ||
end | ||
end | ||
alias :replicant? :bot? | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
# Reopen the Rack::Request class to add bot detection methods | ||
Rack::Request.class_eval do | ||
include VoightKampff::Methods | ||
end | ||
Rack::Request.include VoightKampff::Methods if defined?(Rack::Request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.